File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
posthog/test/ai/langchain Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -604,7 +604,8 @@ def test_groups(mock_client):
604604 ("user" , "Foo" ),
605605 ]
606606 )
607- chain = prompt | ChatOpenAI (api_key = "test" , model = "gpt-4o-mini" )
607+ model = FakeMessagesListChatModel (responses = [AIMessage (content = "Bar" )])
608+ chain = prompt | model
608609 callbacks = CallbackHandler (mock_client , groups = {"company" : "test_company" })
609610 chain .invoke ({}, config = {"callbacks" : [callbacks ]})
610611
@@ -620,7 +621,8 @@ def test_privacy_mode_local(mock_client):
620621 ("user" , "Foo" ),
621622 ]
622623 )
623- chain = prompt | ChatOpenAI (api_key = "test" , model = "gpt-4o-mini" )
624+ model = FakeMessagesListChatModel (responses = [AIMessage (content = "Bar" )])
625+ chain = prompt | model
624626 callbacks = CallbackHandler (mock_client , privacy_mode = True )
625627 chain .invoke ({}, config = {"callbacks" : [callbacks ]})
626628
@@ -638,7 +640,8 @@ def test_privacy_mode_global(mock_client):
638640 ("user" , "Foo" ),
639641 ]
640642 )
641- chain = prompt | ChatOpenAI (api_key = "test" , model = "gpt-4o-mini" )
643+ model = FakeMessagesListChatModel (responses = [AIMessage (content = "Bar" )])
644+ chain = prompt | model
642645 callbacks = CallbackHandler (mock_client )
643646 chain .invoke ({}, config = {"callbacks" : [callbacks ]})
644647
You can’t perform that action at this time.
0 commit comments