Home / Function/ test_injected_arg_with_complex_type() — langchain Function Reference

test_injected_arg_with_complex_type() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  98379abc_9d49_baaa_2cc4_e4d7766d4ef8["test_injected_arg_with_complex_type()"]
  8e7836ae_e72c_f670_72a5_4ca6d46e3555["test_tools.py"]
  98379abc_9d49_baaa_2cc4_e4d7766d4ef8 -->|defined in| 8e7836ae_e72c_f670_72a5_4ca6d46e3555
  2e3e4f6c_89c9_ecff_fc2e_2cff26c11792["injected_tool()"]
  98379abc_9d49_baaa_2cc4_e4d7766d4ef8 -->|calls| 2e3e4f6c_89c9_ecff_fc2e_2cff26c11792
  style 98379abc_9d49_baaa_2cc4_e4d7766d4ef8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_tools.py lines 2398–2410

def test_injected_arg_with_complex_type() -> None:
    """Test that an injected tool arg can be a complex type."""

    class Foo:
        def __init__(self) -> None:
            self.value = "bar"

    @tool
    def injected_tool(x: int, foo: Annotated[Foo, InjectedToolArg]) -> str:
        """Tool that has an injected tool arg."""
        return foo.value

    assert injected_tool.invoke({"x": 5, "foo": Foo()}) == "bar"

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free