Examples
This part of the documentation provides a few cookbooks that you can browse to get acquainted with the library and get some inspiration about what you could do with structured generation. Remember that you can easily change the model that is being used!
- Classification: Classify customer requests.
- Named Entity Extraction: Extract information from pizza orders.
- Dating Profile: Build dating profiles from descriptions using prompt templating and JSON-structured generation.
- Chain Of Density: Summarize documents using chain of density prompting and JSON-structured generation.
- Playing Chess: Make Phi-3 Mini play chess against itself using regex-structured generation.
- SimToM: Improve LLMs' Theory of Mind capabilities with perspective-taking prompting and JSON-structured generation.
- Q&A with Citations: Answer questions and provide citations using JSON-structured generation.
- Knowledge Graph Generation: Generate a Knowledge Graph from unstructured text using JSON-structured generation.
- Chain Of Thought (CoT): Generate a series of intermediate reasoning steps using regex-structured generation.
- ReAct Agent: Build an agent with open weights models using regex-structured generation.
- Earnings reports to CSV: Extract data from earnings reports to CSV using regex-structured generation.
- Vision-Language Models: Use Outlines with vision-language models for tasks like image captioning and visual reasoning.
- Receipt Digitization: Extract information from a picture of a receipt using structured generation.
- Structured Generation from PDFs: Use Outlines with vision-language models to read PDFs and produce structured output.