Home / Function/ wrap_model_call() — langchain Function Reference

wrap_model_call() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  3c54d662_4742_a3c4_5bc8_13544c592e38["wrap_model_call()"]
  546b3f0b_6988_ae2d_a04f_e60cc048d3ff["ClaudeBashToolMiddleware"]
  3c54d662_4742_a3c4_5bc8_13544c592e38 -->|defined in| 546b3f0b_6988_ae2d_a04f_e60cc048d3ff
  style 3c54d662_4742_a3c4_5bc8_13544c592e38 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/langchain_anthropic/middleware/bash.py lines 59–69

    def wrap_model_call(
        self,
        request: ModelRequest,
        handler: Callable[[ModelRequest], ModelResponse],
    ) -> ModelResponse:
        """Replace parent's shell tool with Claude's bash descriptor."""
        filtered = [
            t for t in request.tools if getattr(t, "name", None) != BASH_TOOL_NAME
        ]
        tools = [*filtered, {"type": BASH_TOOL_TYPE, "name": BASH_TOOL_NAME}]
        return handler(request.override(tools=tools))

Domain

Subdomains

Frequently Asked Questions

What does wrap_model_call() do?
wrap_model_call() is a function in the langchain codebase, defined in libs/partners/anthropic/langchain_anthropic/middleware/bash.py.
Where is wrap_model_call() defined?
wrap_model_call() is defined in libs/partners/anthropic/langchain_anthropic/middleware/bash.py at line 59.

Analyze Your Own Codebase

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

Try Supermodel Free