Skip to content

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.