Who it is forA developer scraping announcements with incomplete information.
The problemModels invent missing fields unless you give them a way to decline.
The outcomeEither a complete EventInfo object or an explicit I don't know.
What you need first
- 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
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
Prompt for your agent
Using dottxt-ai/outlines, build an EventResponse union schema and run it over <my event descriptions>, reporting which ones returned I don't know.
Caveat. The fallback only helps if your prompt makes clear that missing details should produce it.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for dottxt-ai/outlines and "Extract event details, with a safe fallback"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer