Home / Function/ args() — langchain Function Reference

args() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  0f85e751_1e8f_8d82_ae8a_eabd2b6f7d88["args()"]
  5ebe56ae_0ac8_cb13_b5a9_ee567b924009["BaseTool"]
  0f85e751_1e8f_8d82_ae8a_eabd2b6f7d88 -->|defined in| 5ebe56ae_0ac8_cb13_b5a9_ee567b924009
  style 0f85e751_1e8f_8d82_ae8a_eabd2b6f7d88 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tools/base.py lines 568–584

    def args(self) -> dict:
        """Get the tool's input arguments schema.

        Returns:
            `dict` containing the tool's argument properties.
        """
        if isinstance(self.args_schema, dict):
            json_schema = self.args_schema
        elif self.args_schema and issubclass(self.args_schema, BaseModelV1):
            json_schema = self.args_schema.schema()
        else:
            input_schema = self.tool_call_schema
            if isinstance(input_schema, dict):
                json_schema = input_schema
            else:
                json_schema = input_schema.model_json_schema()
        return cast("dict", json_schema["properties"])

Subdomains

Frequently Asked Questions

What does args() do?
args() is a function in the langchain codebase, defined in libs/core/langchain_core/tools/base.py.
Where is args() defined?
args() is defined in libs/core/langchain_core/tools/base.py at line 568.

Analyze Your Own Codebase

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

Try Supermodel Free