Home / Function/ with_structured_output() — langchain Function Reference

with_structured_output() — langchain Function Reference

Architecture documentation for the with_structured_output() function in test_structured.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c507b77c_8634_9a86_eb08_148f791ea1cf["with_structured_output()"]
  65808f41_7b4d_dc6a_1b52_8f80bda79b57["FakeStructuredChatModel"]
  c507b77c_8634_9a86_eb08_148f791ea1cf -->|defined in| 65808f41_7b4d_dc6a_1b52_8f80bda79b57
  style c507b77c_8634_9a86_eb08_148f791ea1cf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/prompts/test_structured.py lines 31–34

    def with_structured_output(
        self, schema: dict | type[BaseModel], **kwargs: Any
    ) -> Runnable:
        return RunnableLambda(partial(_fake_runnable, schema=schema, **kwargs))

Domain

Subdomains

Frequently Asked Questions

What does with_structured_output() do?
with_structured_output() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/prompts/test_structured.py.
Where is with_structured_output() defined?
with_structured_output() is defined in libs/core/tests/unit_tests/prompts/test_structured.py at line 31.

Analyze Your Own Codebase

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

Try Supermodel Free