Home / Function/ test_tool_return_output_mixin() — langchain Function Reference

test_tool_return_output_mixin() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  7f2a5d6e_2c2b_2af4_68e9_87dc78b76795["test_tool_return_output_mixin()"]
  8e7836ae_e72c_f670_72a5_4ca6d46e3555["test_tools.py"]
  7f2a5d6e_2c2b_2af4_68e9_87dc78b76795 -->|defined in| 8e7836ae_e72c_f670_72a5_4ca6d46e3555
  b621c544_d6db_7e8d_7240_9ce08870d71a["foo()"]
  7f2a5d6e_2c2b_2af4_68e9_87dc78b76795 -->|calls| b621c544_d6db_7e8d_7240_9ce08870d71a
  style 7f2a5d6e_2c2b_2af4_68e9_87dc78b76795 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_tools.py lines 2590–2613

def test_tool_return_output_mixin() -> None:
    class Bar(ToolOutputMixin):
        def __init__(self, x: int) -> None:
            self.x = x

        def __eq__(self, other: object) -> bool:
            return isinstance(other, self.__class__) and self.x == other.x

        def __hash__(self) -> int:
            return hash(self.x)

    @tool
    def foo(x: int) -> Bar:
        """Foo."""
        return Bar(x=x)

    assert foo.invoke(
        {
            "type": "tool_call",
            "args": {"x": 0},
            "name": "foo",
            "id": "bar",
        }
    ) == Bar(x=0)

Domain

Subdomains

Calls

Frequently Asked Questions

What does test_tool_return_output_mixin() do?
test_tool_return_output_mixin() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/test_tools.py.
Where is test_tool_return_output_mixin() defined?
test_tool_return_output_mixin() is defined in libs/core/tests/unit_tests/test_tools.py at line 2590.
What does test_tool_return_output_mixin() call?
test_tool_return_output_mixin() calls 1 function(s): foo.

Analyze Your Own Codebase

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

Try Supermodel Free