Home / Function/ wrap_model_call() — langchain Function Reference

wrap_model_call() — langchain Function Reference

Architecture documentation for the wrap_model_call() function in test_response_format.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  8bf7d888_c163_f6dc_ebf8_00b118b0434e["wrap_model_call()"]
  3af14c36_b09f_fc28_d887_95a53c65f883["ModelSwappingMiddleware"]
  8bf7d888_c163_f6dc_ebf8_00b118b0434e -->|defined in| 3af14c36_b09f_fc28_d887_95a53c65f883
  3a8452d0_bc0b_b762_5ef2_4ace62e82c54["test_middleware_model_swap_provider_to_tool_strategy()"]
  3a8452d0_bc0b_b762_5ef2_4ace62e82c54 -->|calls| 8bf7d888_c163_f6dc_ebf8_00b118b0434e
  style 8bf7d888_c163_f6dc_ebf8_00b118b0434e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/test_response_format.py lines 826–832

            def wrap_model_call(
                self,
                request: ModelRequest,
                handler: Callable[[ModelRequest], ModelResponse],
            ) -> ModelCallResult:
                # Replace the model with our custom test model
                return handler(request.override(model=model))

Domain

Subdomains

Frequently Asked Questions

What does wrap_model_call() do?
wrap_model_call() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/test_response_format.py.
Where is wrap_model_call() defined?
wrap_model_call() is defined in libs/langchain_v1/tests/unit_tests/agents/test_response_format.py at line 826.
What calls wrap_model_call()?
wrap_model_call() is called by 1 function(s): test_middleware_model_swap_provider_to_tool_strategy.

Analyze Your Own Codebase

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

Try Supermodel Free