Home / Class/ InjectedTool Class — langchain Architecture

InjectedTool Class — langchain Architecture

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

Entity Profile

Dependency Diagram

graph TD
  957bd409_c0cf_b436_8628_ded8bd432278["InjectedTool"]
  18e85ff8_9a5d_f800_f722_027398dc89e7["BaseTool"]
  957bd409_c0cf_b436_8628_ded8bd432278 -->|extends| 18e85ff8_9a5d_f800_f722_027398dc89e7
  8e7836ae_e72c_f670_72a5_4ca6d46e3555["test_tools.py"]
  957bd409_c0cf_b436_8628_ded8bd432278 -->|defined in| 8e7836ae_e72c_f670_72a5_4ca6d46e3555
  edfeceba_efa7_b961_8c6b_ce5c63643bad["_run()"]
  957bd409_c0cf_b436_8628_ded8bd432278 -->|method| edfeceba_efa7_b961_8c6b_ce5c63643bad

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_tools.py lines 1650–1662

class InjectedTool(BaseTool):
    name: str = "foo"
    description: str = "foo."

    @override
    def _run(self, x: int, y: Annotated[str, InjectedToolArg]) -> Any:
        """Foo.

        Args:
            x: abc
            y: 123
        """
        return y

Extends

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free