Home / Function/ test_convert_to_anthropic_tool() — langchain Function Reference

test_convert_to_anthropic_tool() — langchain Function Reference

Architecture documentation for the test_convert_to_anthropic_tool() function in test_chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  9d3280b9_aec3_d96e_5154_bdf0f8078e48["test_convert_to_anthropic_tool()"]
  18428dc5_a41b_90c6_88ad_615296ee3311["test_chat_models.py"]
  9d3280b9_aec3_d96e_5154_bdf0f8078e48 -->|defined in| 18428dc5_a41b_90c6_88ad_615296ee3311
  style 9d3280b9_aec3_d96e_5154_bdf0f8078e48 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/tests/unit_tests/test_chat_models.py lines 501–527

def test_convert_to_anthropic_tool(
    pydantic: type[BaseModel],
    function: Callable,
    dummy_tool: BaseTool,
    json_schema: dict,
    openai_function: dict,
) -> None:
    expected = {
        "name": "dummy_function",
        "description": "Dummy function.",
        "input_schema": {
            "type": "object",
            "properties": {
                "arg1": {"description": "foo", "type": "integer"},
                "arg2": {
                    "description": "one of 'bar', 'baz'",
                    "enum": ["bar", "baz"],
                    "type": "string",
                },
            },
            "required": ["arg1", "arg2"],
        },
    }

    for fn in (pydantic, function, dummy_tool, json_schema, expected, openai_function):
        actual = convert_to_anthropic_tool(fn)
        assert actual == expected

Domain

Subdomains

Frequently Asked Questions

What does test_convert_to_anthropic_tool() do?
test_convert_to_anthropic_tool() is a function in the langchain codebase, defined in libs/partners/anthropic/tests/unit_tests/test_chat_models.py.
Where is test_convert_to_anthropic_tool() defined?
test_convert_to_anthropic_tool() is defined in libs/partners/anthropic/tests/unit_tests/test_chat_models.py at line 501.

Analyze Your Own Codebase

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

Try Supermodel Free