structured_output.py
Run the Example
1
Set up your virtual environment
2
Install dependencies
3
Export environment variables
4
Use a structured-output model
Add
import os, then replace Together(id="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo") with Together(id=os.environ["TOGETHER_STRUCTURED_MODEL_ID"]) in the saved file.5
Run the example
Save the code above as
structured_output.py, then run: