test_create_agent_with_session_context() — langchain Function Reference
Architecture documentation for the test_create_agent_with_session_context() function in test_middleware_typing.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 27b994dc_b992_176a_b714_3bc8cf22cb34["test_create_agent_with_session_context()"] 689eac1f_5845_440c_f60b_988968e02ee6["test_middleware_typing.py"] 27b994dc_b992_176a_b714_3bc8cf22cb34 -->|defined in| 689eac1f_5845_440c_f60b_988968e02ee6 style 27b994dc_b992_176a_b714_3bc8cf22cb34 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware_typing/test_middleware_typing.py lines 263–270
def test_create_agent_with_session_context(fake_model: GenericFakeChatModel) -> None:
"""Typed: context_schema=SessionContext requires matching middleware."""
agent: CompiledStateGraph[Any, SessionContext, Any, Any] = create_agent(
model=fake_model,
middleware=[SessionContextMiddleware()], # Matches SessionContext
context_schema=SessionContext,
)
assert agent is not None
Domain
Subdomains
Source
Frequently Asked Questions
What does test_create_agent_with_session_context() do?
test_create_agent_with_session_context() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware_typing/test_middleware_typing.py.
Where is test_create_agent_with_session_context() defined?
test_create_agent_with_session_context() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware_typing/test_middleware_typing.py at line 263.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free