Home / Function/ test_structured_output_old_model() — langchain Function Reference

test_structured_output_old_model() — langchain Function Reference

Architecture documentation for the test_structured_output_old_model() function in test_base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  67df4934_263f_b15d_520a_21ce10d2bee9["test_structured_output_old_model()"]
  48232d20_f8c1_b597_14fa_7dc407e9bfe5["test_base.py"]
  67df4934_263f_b15d_520a_21ce10d2bee9 -->|defined in| 48232d20_f8c1_b597_14fa_7dc407e9bfe5
  style 67df4934_263f_b15d_520a_21ce10d2bee9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/tests/unit_tests/chat_models/test_base.py lines 1341–1351

def test_structured_output_old_model() -> None:
    class Output(TypedDict):
        """output."""

        foo: str

    with pytest.warns(match="Cannot use method='json_schema'"):
        llm = ChatOpenAI(model="gpt-4").with_structured_output(Output)
    # assert tool calling was used instead of json_schema
    assert "tools" in llm.steps[0].kwargs  # type: ignore
    assert "response_format" not in llm.steps[0].kwargs  # type: ignore

Domain

Subdomains

Frequently Asked Questions

What does test_structured_output_old_model() do?
test_structured_output_old_model() is a function in the langchain codebase, defined in libs/partners/openai/tests/unit_tests/chat_models/test_base.py.
Where is test_structured_output_old_model() defined?
test_structured_output_old_model() is defined in libs/partners/openai/tests/unit_tests/chat_models/test_base.py at line 1341.

Analyze Your Own Codebase

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

Try Supermodel Free