test_subclass_annotated_base_tool_accepted() — langchain Function Reference
Architecture documentation for the test_subclass_annotated_base_tool_accepted() function in test_tools.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 72ee2a7d_fff8_0007_424c_0f57341c5ee2["test_subclass_annotated_base_tool_accepted()"] 8e7836ae_e72c_f670_72a5_4ca6d46e3555["test_tools.py"] 72ee2a7d_fff8_0007_424c_0f57341c5ee2 -->|defined in| 8e7836ae_e72c_f670_72a5_4ca6d46e3555 style 72ee2a7d_fff8_0007_424c_0f57341c5ee2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/test_tools.py lines 178–197
def test_subclass_annotated_base_tool_accepted() -> None:
"""Test BaseTool child w/ custom schema isn't overwritten."""
class _ForwardRefAnnotatedTool(BaseTool):
name: str = "structured_api"
args_schema: type[_MockSchema] = _MockSchema
description: str = "A Structured Tool"
@override
def _run(self, *, arg1: int, arg2: bool, arg3: dict | None = None) -> str:
return f"{arg1} {arg2} {arg3}"
async def _arun(
self, *, arg1: int, arg2: bool, arg3: dict | None = None
) -> str:
raise NotImplementedError
assert issubclass(_ForwardRefAnnotatedTool, BaseTool)
tool = _ForwardRefAnnotatedTool()
assert tool.args_schema == _MockSchema
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_subclass_annotated_base_tool_accepted() do?
test_subclass_annotated_base_tool_accepted() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_tools.py.
Where is test_subclass_annotated_base_tool_accepted() defined?
test_subclass_annotated_base_tool_accepted() is defined in libs/core/tests/unit_tests/test_tools.py at line 178.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free