Home / Function/ _get_tool_call_json_schema() — langchain Function Reference

_get_tool_call_json_schema() — langchain Function Reference

Architecture documentation for the _get_tool_call_json_schema() function in test_tools.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  beffa773_a4d3_0857_9757_4deff441ad96["_get_tool_call_json_schema()"]
  8e7836ae_e72c_f670_72a5_4ca6d46e3555["test_tools.py"]
  beffa773_a4d3_0857_9757_4deff441ad96 -->|defined in| 8e7836ae_e72c_f670_72a5_4ca6d46e3555
  6637392e_2d6d_1e6c_3fe7_b510079fdfd1["test_tool_inherited_injected_arg()"]
  6637392e_2d6d_1e6c_3fe7_b510079fdfd1 -->|calls| beffa773_a4d3_0857_9757_4deff441ad96
  8b119e08_dd0d_598f_c2e1_5d4342ec8eda["test_args_schema_as_pydantic()"]
  8b119e08_dd0d_598f_c2e1_5d4342ec8eda -->|calls| beffa773_a4d3_0857_9757_4deff441ad96
  1bdacb9b_b5a2_c146_ddc0_35d5d2f114ad["test_args_schema_explicitly_typed()"]
  1bdacb9b_b5a2_c146_ddc0_35d5d2f114ad -->|calls| beffa773_a4d3_0857_9757_4deff441ad96
  c4784546_78c4_7d10_72d9_6bd529eb66b3["test_tool_args_schema_pydantic_v2_with_metadata()"]
  c4784546_78c4_7d10_72d9_6bd529eb66b3 -->|calls| beffa773_a4d3_0857_9757_4deff441ad96
  bdb2a8b3_d7f4_9eb2_8272_89edcd9bb363["test_structured_tool_args_schema_dict()"]
  bdb2a8b3_d7f4_9eb2_8272_89edcd9bb363 -->|calls| beffa773_a4d3_0857_9757_4deff441ad96
  cd25b674_fdb2_5b1a_c50d_9c34b94d6aff["test_simple_tool_args_schema_dict()"]
  cd25b674_fdb2_5b1a_c50d_9c34b94d6aff -->|calls| beffa773_a4d3_0857_9757_4deff441ad96
  style beffa773_a4d3_0857_9757_4deff441ad96 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_tools.py lines 83–92

def _get_tool_call_json_schema(tool: BaseTool) -> dict[str, Any]:
    tool_schema = tool.tool_call_schema
    if isinstance(tool_schema, dict):
        return tool_schema

    if issubclass(tool_schema, BaseModel):
        return tool_schema.model_json_schema()
    if issubclass(tool_schema, BaseModelV1):
        return tool_schema.schema()
    return {}

Domain

Subdomains

Frequently Asked Questions

What does _get_tool_call_json_schema() do?
_get_tool_call_json_schema() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_tools.py.
Where is _get_tool_call_json_schema() defined?
_get_tool_call_json_schema() is defined in libs/core/tests/unit_tests/test_tools.py at line 83.
What calls _get_tool_call_json_schema()?
_get_tool_call_json_schema() is called by 6 function(s): test_args_schema_as_pydantic, test_args_schema_explicitly_typed, test_simple_tool_args_schema_dict, test_structured_tool_args_schema_dict, test_tool_args_schema_pydantic_v2_with_metadata, test_tool_inherited_injected_arg.

Analyze Your Own Codebase

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

Try Supermodel Free