Home / Function/ test_backwards_compat_with_context_schema() — langchain Function Reference

test_backwards_compat_with_context_schema() — langchain Function Reference

Architecture documentation for the test_backwards_compat_with_context_schema() function in test_middleware_type_errors.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  79ca7e4b_a691_63f9_cf5c_b87539b9cc12["test_backwards_compat_with_context_schema()"]
  47e0e3d7_cac1_0ec3_228a_0fd46437bc22["test_middleware_type_errors.py"]
  79ca7e4b_a691_63f9_cf5c_b87539b9cc12 -->|defined in| 47e0e3d7_cac1_0ec3_228a_0fd46437bc22
  style 79ca7e4b_a691_63f9_cf5c_b87539b9cc12 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware_typing/test_middleware_type_errors.py lines 121–129

def test_backwards_compat_with_context_schema() -> None:
    # TYPE ERROR: BackwardsCompatibleMiddleware is AgentMiddleware[..., None]
    # but context_schema=UserContext expects AgentMiddleware[..., UserContext]
    fake_model = FakeToolCallingModel()
    _agent = create_agent(  # type: ignore[misc]
        model=fake_model,
        middleware=[BackwardsCompatibleMiddleware()],
        context_schema=UserContext,
    )

Domain

Subdomains

Frequently Asked Questions

What does test_backwards_compat_with_context_schema() do?
test_backwards_compat_with_context_schema() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware_typing/test_middleware_type_errors.py.
Where is test_backwards_compat_with_context_schema() defined?
test_backwards_compat_with_context_schema() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware_typing/test_middleware_type_errors.py at line 121.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free