I noticed that the Lesson 3 example on “Structured Output with Pydantic Models” defines Pydantic schemas, but the agent output itself does not appear to be constrained or validated against those schemas.
For example, the code defines:
class TravelRecommendations(BaseModel):
...
but "structured_agent.run()" is called without an explicit response/output model, so the returned result may still be free-form text depending on the framework behavior.
Similarly, the "get_destination_details" tool currently returns unstructured strings rather than typed objects, which may make the example feel less aligned with the concept of end-to-end structured outputs.
I understand this may be intentional for simplicity in a beginner tutorial, but adding either:
- explicit schema enforcement/validation, or
- a short clarification explaining that the example is simplified
could help avoid confusion for learners trying to understand what “structured output” means in production agent systems.
I noticed that the Lesson 3 example on “Structured Output with Pydantic Models” defines Pydantic schemas, but the agent output itself does not appear to be constrained or validated against those schemas.
For example, the code defines:
class TravelRecommendations(BaseModel):
...
but "structured_agent.run()" is called without an explicit response/output model, so the returned result may still be free-form text depending on the framework behavior.
Similarly, the "get_destination_details" tool currently returns unstructured strings rather than typed objects, which may make the example feel less aligned with the concept of end-to-end structured outputs.
I understand this may be intentional for simplicity in a beginner tutorial, but adding either:
could help avoid confusion for learners trying to understand what “structured output” means in production agent systems.