Home / Function/ _get_invocation_params() — langchain Function Reference

_get_invocation_params() — langchain Function Reference

Architecture documentation for the _get_invocation_params() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  a10e6ce4_b133_c5d1_0803_af77a79a94f1["_get_invocation_params()"]
  2a683305_667b_3567_cab9_9f77e29d4afa["BaseChatOpenAI"]
  a10e6ce4_b133_c5d1_0803_af77a79a94f1 -->|defined in| 2a683305_667b_3567_cab9_9f77e29d4afa
  3f68277e_70a2_a3d7_dd6c_e3ff55aa8706["_get_ls_params()"]
  3f68277e_70a2_a3d7_dd6c_e3ff55aa8706 -->|calls| a10e6ce4_b133_c5d1_0803_af77a79a94f1
  style a10e6ce4_b133_c5d1_0803_af77a79a94f1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/langchain_openai/chat_models/base.py lines 1693–1712

    def _get_invocation_params(
        self, stop: list[str] | None = None, **kwargs: Any
    ) -> dict[str, Any]:
        """Get the parameters used to invoke the model."""
        params = {
            "model": self.model_name,
            **super()._get_invocation_params(stop=stop),
            **self._default_params,
            **kwargs,
        }
        # Redact headers from built-in remote MCP tool invocations
        if (tools := params.get("tools")) and isinstance(tools, list):
            params["tools"] = [
                ({**tool, "headers": "**REDACTED**"} if "headers" in tool else tool)
                if isinstance(tool, dict) and tool.get("type") == "mcp"
                else tool
                for tool in tools
            ]

        return params

Domain

Subdomains

Called By

Frequently Asked Questions

What does _get_invocation_params() do?
_get_invocation_params() is a function in the langchain codebase, defined in libs/partners/openai/langchain_openai/chat_models/base.py.
Where is _get_invocation_params() defined?
_get_invocation_params() is defined in libs/partners/openai/langchain_openai/chat_models/base.py at line 1693.
What calls _get_invocation_params()?
_get_invocation_params() is called by 1 function(s): _get_ls_params.

Analyze Your Own Codebase

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

Try Supermodel Free