Home / Class/ _MockStructuredToolWithRawOutput Class — langchain Architecture

_MockStructuredToolWithRawOutput Class — langchain Architecture

Architecture documentation for the _MockStructuredToolWithRawOutput class in test_tools.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  43ccebe7_146a_45c9_c058_3ddbd6fe21b2["_MockStructuredToolWithRawOutput"]
  18e85ff8_9a5d_f800_f722_027398dc89e7["BaseTool"]
  43ccebe7_146a_45c9_c058_3ddbd6fe21b2 -->|extends| 18e85ff8_9a5d_f800_f722_027398dc89e7
  8e7836ae_e72c_f670_72a5_4ca6d46e3555["test_tools.py"]
  43ccebe7_146a_45c9_c058_3ddbd6fe21b2 -->|defined in| 8e7836ae_e72c_f670_72a5_4ca6d46e3555
  a18387e5_1b2c_dc2a_8562_5fb9868b6f01["_run()"]
  43ccebe7_146a_45c9_c058_3ddbd6fe21b2 -->|method| a18387e5_1b2c_dc2a_8562_5fb9868b6f01

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_tools.py lines 1497–1510

class _MockStructuredToolWithRawOutput(BaseTool):
    name: str = "structured_api"
    args_schema: type[BaseModel] = _MockSchema
    description: str = "A Structured Tool"
    response_format: Literal["content_and_artifact"] = "content_and_artifact"

    @override
    def _run(
        self,
        arg1: int,
        arg2: bool,
        arg3: dict[str, Any] | None = None,
    ) -> tuple[str, dict[str, Any]]:
        return f"{arg1} {arg2}", {"arg1": arg1, "arg2": arg2, "arg3": arg3}

Extends

Frequently Asked Questions

What is the _MockStructuredToolWithRawOutput class?
_MockStructuredToolWithRawOutput is a class in the langchain codebase, defined in libs/core/tests/unit_tests/test_tools.py.
Where is _MockStructuredToolWithRawOutput defined?
_MockStructuredToolWithRawOutput is defined in libs/core/tests/unit_tests/test_tools.py at line 1497.
What does _MockStructuredToolWithRawOutput extend?
_MockStructuredToolWithRawOutput extends BaseTool.

Analyze Your Own Codebase

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

Try Supermodel Free