Home / Function/ test_function_optional_param() — langchain Function Reference

test_function_optional_param() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/utils/test_function_calling.py lines 680–691

def test_function_optional_param() -> None:
    @tool
    def func5(
        a: str | None,
        b: str,
        c: list[str | None] | None,
    ) -> None:
        """A test function."""

    func = convert_to_openai_function(func5)
    req = func["parameters"]["required"]
    assert set(req) == {"b"}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free