Home / Function/ test__parse_arguments_from_tool_call_with_function_name_metadata() — langchain Function Reference

test__parse_arguments_from_tool_call_with_function_name_metadata() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  6facb279_fbd2_ab7b_0052_8a9928e3c452["test__parse_arguments_from_tool_call_with_function_name_metadata()"]
  9c4a2438_9884_cbb0_3cf5_de8827531653["test_chat_models.py"]
  6facb279_fbd2_ab7b_0052_8a9928e3c452 -->|defined in| 9c4a2438_9884_cbb0_3cf5_de8827531653
  style 6facb279_fbd2_ab7b_0052_8a9928e3c452 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/ollama/tests/unit_tests/test_chat_models.py lines 74–105

def test__parse_arguments_from_tool_call_with_function_name_metadata() -> None:
    """Test that functionName metadata is filtered out from tool arguments.

    Some models may include metadata like `functionName` in the arguments
    that just echoes the function name. This should be filtered out for
    no-argument tools to return an empty dictionary.
    """
    raw_tool_call_with_metadata = {
        "function": {
            "name": "magic_function_no_args",
            "arguments": {"functionName": "magic_function_no_args"},
        }
    }
    response = _parse_arguments_from_tool_call(raw_tool_call_with_metadata)
    assert response == {}

    # Arguments contain both real args and metadata
    raw_tool_call_mixed = {
        "function": {
            "name": "some_function",
            "arguments": {"functionName": "some_function", "real_arg": "value"},
        }
    }
    response_mixed = _parse_arguments_from_tool_call(raw_tool_call_mixed)
    assert response_mixed == {"real_arg": "value"}

    # functionName has different value (should be preserved)
    raw_tool_call_different = {
        "function": {"name": "function_a", "arguments": {"functionName": "function_b"}}
    }
    response_different = _parse_arguments_from_tool_call(raw_tool_call_different)
    assert response_different == {"functionName": "function_b"}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free