Home / Function/ invoke() — langchain Function Reference

invoke() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ede8808b_c1b5_3ed7_439d_90ebc56dd263["invoke()"]
  5ebe56ae_0ac8_cb13_b5a9_ee567b924009["BaseTool"]
  ede8808b_c1b5_3ed7_439d_90ebc56dd263 -->|defined in| 5ebe56ae_0ac8_cb13_b5a9_ee567b924009
  51b059af_20e0_9233_077d_cd590dd94dc8["run()"]
  ede8808b_c1b5_3ed7_439d_90ebc56dd263 -->|calls| 51b059af_20e0_9233_077d_cd590dd94dc8
  9e451f25_97c2_f2c6_30eb_6fb62f743dc0["_prep_run_args()"]
  ede8808b_c1b5_3ed7_439d_90ebc56dd263 -->|calls| 9e451f25_97c2_f2c6_30eb_6fb62f743dc0
  style ede8808b_c1b5_3ed7_439d_90ebc56dd263 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tools/base.py lines 635–642

    def invoke(
        self,
        input: str | dict | ToolCall,
        config: RunnableConfig | None = None,
        **kwargs: Any,
    ) -> Any:
        tool_input, kwargs = _prep_run_args(input, config, **kwargs)
        return self.run(tool_input, **kwargs)

Subdomains

Frequently Asked Questions

What does invoke() do?
invoke() is a function in the langchain codebase, defined in libs/core/langchain_core/tools/base.py.
Where is invoke() defined?
invoke() is defined in libs/core/langchain_core/tools/base.py at line 635.
What does invoke() call?
invoke() calls 2 function(s): _prep_run_args, run.

Analyze Your Own Codebase

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

Try Supermodel Free