Home / Function/ test_convert_union_type() — langchain Function Reference

test_convert_union_type() — langchain Function Reference

Architecture documentation for the test_convert_union_type() function in test_function_calling.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  6b5f76b8_5e47_fee2_1fd5_1cce7ba04fa7["test_convert_union_type()"]
  6f1e8e6f_d3f9_e590_b17e_1dc8afafdbe0["test_function_calling.py"]
  6b5f76b8_5e47_fee2_1fd5_1cce7ba04fa7 -->|defined in| 6f1e8e6f_d3f9_e590_b17e_1dc8afafdbe0
  style 6b5f76b8_5e47_fee2_1fd5_1cce7ba04fa7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/utils/test_function_calling.py lines 1048–1058

def test_convert_union_type() -> None:
    @tool
    def magic_function(value: int | str) -> str:
        """Compute a magic function."""
        _ = value
        return ""

    result = convert_to_openai_function(magic_function)
    assert result["parameters"]["properties"]["value"] == {
        "anyOf": [{"type": "integer"}, {"type": "string"}]
    }

Domain

Subdomains

Frequently Asked Questions

What does test_convert_union_type() do?
test_convert_union_type() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/utils/test_function_calling.py.
Where is test_convert_union_type() defined?
test_convert_union_type() is defined in libs/core/tests/unit_tests/utils/test_function_calling.py at line 1048.

Analyze Your Own Codebase

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

Try Supermodel Free