Home / Function/ ainvoke() — langchain Function Reference

ainvoke() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  1d771513_400f_5264_361c_04bcb00f97ac["ainvoke()"]
  5ebe56ae_0ac8_cb13_b5a9_ee567b924009["BaseTool"]
  1d771513_400f_5264_361c_04bcb00f97ac -->|defined in| 5ebe56ae_0ac8_cb13_b5a9_ee567b924009
  c2f33b98_e5b2_c424_d7d3_8cbd05da78d1["arun()"]
  1d771513_400f_5264_361c_04bcb00f97ac -->|calls| c2f33b98_e5b2_c424_d7d3_8cbd05da78d1
  9e451f25_97c2_f2c6_30eb_6fb62f743dc0["_prep_run_args()"]
  1d771513_400f_5264_361c_04bcb00f97ac -->|calls| 9e451f25_97c2_f2c6_30eb_6fb62f743dc0
  style 1d771513_400f_5264_361c_04bcb00f97ac fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tools/base.py lines 645–652

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

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free