Home / Function/ _validate_tools() — langchain Function Reference

_validate_tools() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  db3bfef1_e457_395a_3bef_a1f5fcfce110["_validate_tools()"]
  2d166c20_d149_321c_980b_160d189505a7["ReActTextWorldAgent"]
  db3bfef1_e457_395a_3bef_a1f5fcfce110 -->|defined in| 2d166c20_d149_321c_980b_160d189505a7
  69c63b42_b705_9469_8c9e_d44467ef41ff["_validate_tools()"]
  69c63b42_b705_9469_8c9e_d44467ef41ff -->|calls| db3bfef1_e457_395a_3bef_a1f5fcfce110
  69c63b42_b705_9469_8c9e_d44467ef41ff["_validate_tools()"]
  db3bfef1_e457_395a_3bef_a1f5fcfce110 -->|calls| 69c63b42_b705_9469_8c9e_d44467ef41ff
  style db3bfef1_e457_395a_3bef_a1f5fcfce110 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/react/base.py lines 153–162

    def _validate_tools(cls, tools: Sequence[BaseTool]) -> None:
        validate_tools_single_input(cls.__name__, tools)
        super()._validate_tools(tools)
        if len(tools) != 1:
            msg = f"Exactly one tool must be specified, but got {tools}"
            raise ValueError(msg)
        tool_names = {tool.name for tool in tools}
        if tool_names != {"Play"}:
            msg = f"Tool name should be Play, got {tool_names}"
            raise ValueError(msg)

Subdomains

Called By

Frequently Asked Questions

What does _validate_tools() do?
_validate_tools() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/react/base.py.
Where is _validate_tools() defined?
_validate_tools() is defined in libs/langchain/langchain_classic/agents/react/base.py at line 153.
What does _validate_tools() call?
_validate_tools() calls 1 function(s): _validate_tools.
What calls _validate_tools()?
_validate_tools() is called by 1 function(s): _validate_tools.

Analyze Your Own Codebase

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

Try Supermodel Free