Setup
Install and import the necessary validators from Guardrails hub:For structured JSON output
Define the prompt and output schema
Create the Guard object
Example: No streaming
By default, thestream parameter is set to False:
Example: With streaming
To enable streaming for structured data, setstream=True: