kiwi/app/models
pyr0ball b4624fba84 feat(ask): add POST /recipes/ask endpoint for natural-language recipe search
Free tier: keyword extraction + FTS ingredient search + title probe search.
Paid tier / BYOK: same search, then LLM synthesis of a conversational answer
(8s timeout so an unresponsive model degrades gracefully to recipe list only).

- AskRequest / AskRecipeHit / AskResponse schemas in recipe.py
- _extract_ask_keywords(): tokenize question, strip stopwords
- _ask_in_thread(): two-pronged search (ingredient FTS + title LIKE)
  merges by ID, computes pantry match_pct when pantry_items provided
- Endpoint registered before /{recipe_id} to avoid integer coercion on /ask
- LLM synthesis gated to paid/premium/ultra only (not "local" dev tier)

Closes #134 (backend)
2026-05-11 13:07:53 -07:00
..
domain chore: initial commit — kiwi Phase 2 complete 2026-03-30 22:20:48 -07:00
schemas feat(ask): add POST /recipes/ask endpoint for natural-language recipe search 2026-05-11 13:07:53 -07:00
__init__.py chore: initial commit — kiwi Phase 2 complete 2026-03-30 22:20:48 -07:00