test_init_chat_model_chain() — langchain Function Reference
Architecture documentation for the test_init_chat_model_chain() function in test_base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD c1c410ad_6723_11bc_dfc0_81424f2ecb99["test_init_chat_model_chain()"] 5e2f53a9_3eca_02ae_2a24_76cc12a6efaf["test_base.py"] c1c410ad_6723_11bc_dfc0_81424f2ecb99 -->|defined in| 5e2f53a9_3eca_02ae_2a24_76cc12a6efaf style c1c410ad_6723_11bc_dfc0_81424f2ecb99 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/integration_tests/chat_models/test_base.py lines 22–37
async def test_init_chat_model_chain() -> None:
model = init_chat_model("gpt-4o", configurable_fields="any", config_prefix="bar")
model_with_tools = model.bind_tools([Multiply])
model_with_config = model_with_tools.with_config(
RunnableConfig(tags=["foo"]),
configurable={"bar_model": "claude-sonnet-4-5-20250929"},
)
prompt = ChatPromptTemplate.from_messages([("system", "foo"), ("human", "{input}")])
chain = prompt | model_with_config
output = chain.invoke({"input": "bar"})
assert isinstance(output, AIMessage)
events = [
event async for event in chain.astream_events({"input": "bar"}, version="v2")
]
assert events
Domain
Subdomains
Source
Frequently Asked Questions
What does test_init_chat_model_chain() do?
test_init_chat_model_chain() is a function in the langchain codebase, defined in libs/langchain/tests/integration_tests/chat_models/test_base.py.
Where is test_init_chat_model_chain() defined?
test_init_chat_model_chain() is defined in libs/langchain/tests/integration_tests/chat_models/test_base.py at line 22.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free