Code
cookbook/11_models/ibm/watsonx/structured_output.py
Usage
This example shows how to use structured output with IBM WatsonX. It defines a Pydantic modelMovieScript with various fields and their descriptions, then creates an agent using this model as the output_schema. The model’s output will be parsed into this structured format.