LangChain · Lesson 36 of 120
Structured Output Quiz
Test yourself.
⏱ 2 min read▶ Video at 39:05🎓 Free
Let's review structured output. Pause after each question, and answer before I do.
From the video: Structured Output Quiz- Structured output quiz
- Pause and think
- Then check
Which method makes a model return instances of a Pydantic class? With structured output.
Quick check
Returns Pydantic objects:
How do you limit a field to a fixed set of labels? With a Literal type.
Quick check
Fixed labels:
An email may not contain an order number. How should that field be declared? As optional.
Quick check
Might be missing:
Which option returns the raw reply along with the parsed object? Include raw.
Quick check
Raw reply too:
Excellent. Next, a new section on tools, the way models take action.
Key takeaways- with_structured_output
- Literal labels
- Optional fields