test_with_structured_output() — langchain Function Reference
Architecture documentation for the test_with_structured_output() function in test_base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 3fbbcc9f_87ea_a4f8_b052_d840d29525fd["test_with_structured_output()"] 48232d20_f8c1_b597_14fa_7dc407e9bfe5["test_base.py"] 3fbbcc9f_87ea_a4f8_b052_d840d29525fd -->|defined in| 48232d20_f8c1_b597_14fa_7dc407e9bfe5 style 3fbbcc9f_87ea_a4f8_b052_d840d29525fd fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/openai/tests/unit_tests/chat_models/test_base.py lines 924–936
def test_with_structured_output(
schema: type | dict[str, Any] | None,
method: Literal["function_calling", "json_mode", "json_schema"],
include_raw: bool,
strict: bool | None,
) -> None:
"""Test passing in manually construct tool call message."""
if method == "json_mode":
strict = None
llm = ChatOpenAI(model="gpt-3.5-turbo-0125", temperature=0)
llm.with_structured_output(
schema, method=method, strict=strict, include_raw=include_raw
)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_with_structured_output() do?
test_with_structured_output() is a function in the langchain codebase, defined in libs/partners/openai/tests/unit_tests/chat_models/test_base.py.
Where is test_with_structured_output() defined?
test_with_structured_output() is defined in libs/partners/openai/tests/unit_tests/chat_models/test_base.py at line 924.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free