test_generic_fake_chat_model_invoke() — langchain Function Reference
Architecture documentation for the test_generic_fake_chat_model_invoke() function in test_fake_chat_model.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 73f0998f_e2f5_3c70_d83b_76dced4b6862["test_generic_fake_chat_model_invoke()"] 06318702_96e4_1032_1475_4dde8fe1f643["test_fake_chat_model.py"] 73f0998f_e2f5_3c70_d83b_76dced4b6862 -->|defined in| 06318702_96e4_1032_1475_4dde8fe1f643 style 73f0998f_e2f5_3c70_d83b_76dced4b6862 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/fake/test_fake_chat_model.py lines 26–35
def test_generic_fake_chat_model_invoke() -> None:
# Will alternate between responding with hello and goodbye
infinite_cycle = cycle([AIMessage(content="hello"), AIMessage(content="goodbye")])
model = GenericFakeChatModel(messages=infinite_cycle)
response = model.invoke("meow")
assert response == _any_id_ai_message(content="hello")
response = model.invoke("kitty")
assert response == _any_id_ai_message(content="goodbye")
response = model.invoke("meow")
assert response == _any_id_ai_message(content="hello")
Domain
Subdomains
Source
Frequently Asked Questions
What does test_generic_fake_chat_model_invoke() do?
test_generic_fake_chat_model_invoke() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/fake/test_fake_chat_model.py.
Where is test_generic_fake_chat_model_invoke() defined?
test_generic_fake_chat_model_invoke() is defined in libs/core/tests/unit_tests/fake/test_fake_chat_model.py at line 26.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free