{
 "schema_version": 1,
 "generated": "2026-11-09",
 "id": "dottxt-ai-outlines--extract-event-details-with-a-fallback-in-outlines",
 "repo": "dottxt-ai/outlines",
 "repo_url": "https://github.com/dottxt-ai/outlines",
 "repo_slug": "dottxt-ai-outlines",
 "title": "Extract event details, with a safe fallback",
 "page_title": "How to extract event details, with a safe fallback with Outlines",
 "summary": "Use a union type so the model returns structured event info or the literal I don't know when data is missing.",
 "who": "A developer scraping announcements with incomplete information.",
 "problem": "Models invent missing fields unless you give them a way to decline.",
 "outcome": "Either a complete EventInfo object or an explicit I don't know.",
 "steps": [
  "Install the library with `pip install outlines`",
  "Connect a model with Outlines.from_transformers as in the quickstart",
  "Define EventInfo with name, date, location, event_type, topics and registration_required, and an EventType enum",
  "Declare EventResponse as a Union of EventInfo and Literal for I don't know and pass it as the output type"
 ],
 "agent_prompt": "Using dottxt-ai/outlines, build an EventResponse union schema and run it over <my event descriptions>, reporting which ones returned I don't know.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Intermediate",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "The fallback only helps if your prompt makes clear that missing details should produce it.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python with pip; install with `pip install outlines`",
  "A model backend, such as a Hugging Face transformers model, as in the README quickstart",
  "Pydantic for typed schemas"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/dottxt-ai-outlines/extract-event-details-with-a-fallback-in-outlines/",
 "md": "https://dedupedai.com/use-cases/dottxt-ai-outlines/extract-event-details-with-a-fallback-in-outlines/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/dottxt-ai-outlines--extract-event-details-with-a-fallback-in-outlines.json",
 "api_version": "v1"
}
