test_simple_tool_args_schema_dict() — langchain Function Reference
Architecture documentation for the test_simple_tool_args_schema_dict() function in test_tools.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD cd25b674_fdb2_5b1a_c50d_9c34b94d6aff["test_simple_tool_args_schema_dict()"] 8e7836ae_e72c_f670_72a5_4ca6d46e3555["test_tools.py"] cd25b674_fdb2_5b1a_c50d_9c34b94d6aff -->|defined in| 8e7836ae_e72c_f670_72a5_4ca6d46e3555 beffa773_a4d3_0857_9757_4deff441ad96["_get_tool_call_json_schema()"] cd25b674_fdb2_5b1a_c50d_9c34b94d6aff -->|calls| beffa773_a4d3_0857_9757_4deff441ad96 style cd25b674_fdb2_5b1a_c50d_9c34b94d6aff fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/test_tools.py lines 2670–2702
def test_simple_tool_args_schema_dict() -> None:
args_schema = {
"properties": {
"a": {"title": "A", "type": "integer"},
},
"required": ["a"],
"title": "square",
"type": "object",
"description": "square a number",
}
tool = Tool(
name="square",
description="square a number",
args_schema=args_schema,
func=lambda a: a * a,
)
assert tool.invoke({"a": 2}) == 4
assert tool.args_schema == args_schema
# test that the tool call schema is the same as the args schema
assert _get_tool_call_json_schema(tool) == args_schema
# test that the input schema is the same as the parent (Runnable) input schema
assert (
tool.get_input_schema().model_json_schema()
== create_model_v2(
tool.get_name("Input"),
root=tool.InputType,
module_name=tool.__class__.__module__,
).model_json_schema()
)
# test that args are extracted correctly
assert tool.args == {
"a": {"title": "A", "type": "integer"},
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_simple_tool_args_schema_dict() do?
test_simple_tool_args_schema_dict() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_tools.py.
Where is test_simple_tool_args_schema_dict() defined?
test_simple_tool_args_schema_dict() is defined in libs/core/tests/unit_tests/test_tools.py at line 2670.
What does test_simple_tool_args_schema_dict() call?
test_simple_tool_args_schema_dict() calls 1 function(s): _get_tool_call_json_schema.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free