Skip to content

feat: enrich Gemini with Florence facts and canonical damage labels#62

Open
madhavcodez wants to merge 1 commit intomainfrom
feat/chat-disaster-knowledge
Open

feat: enrich Gemini with Florence facts and canonical damage labels#62
madhavcodez wants to merge 1 commit intomainfrom
feat/chat-disaster-knowledge

Conversation

@madhavcodez
Copy link
Copy Markdown
Contributor

What this does

Makes the Gemini-powered chat actually know things about Hurricane Florence and reliably do what users ask.

Three related changes:

  1. Florence knowledge — added 8 grounded facts (category, landfall date/place, deaths, damage, rainfall, structures damaged, storm surge, dataset scope) to the system prompt so questions like "what category was it?" return accurate answers instead of a refusal or a hallucination.
  2. Canonical damage labels — the filter tool now accepts both the canonical names Gemini learns from the prompt (no-damage, minor-damage, major-damage, destroyed, unknown) and the short aliases the frontend filter expects (none, minor, severe, destroyed, unknown). A small normalization map keeps both vocabularies consistent without breaking the frontend contract.
  3. No more sterile empty replies — when Gemini returns a tool call with no text summary (an empirical flash-lite behavior), we synthesize a plain-English sentence from the action so the user always sees something meaningful like "Moving the map to that location." instead of "I processed your request but couldn't generate a text response."

Pinned to gemini-2.5-flash-lite because the full flash model intermittently returns 503 UNAVAILABLE under load — the lite model handles our tool-calling loop reliably.

How to verify

  • "What category was Hurricane Florence?" → Category 4, weakened to Cat 1 at landfall
  • "Take me to a destroyed building" → map flies to real coordinates, reply is a natural sentence
  • "Show only severely damaged buildings" → filter applied
  • "What's the weather in Paris?" → scope refusal

Addresses UTDisaster/frontend#48

Expand the system prompt with eight grounded facts about Hurricane
Florence so factual queries return accurate answers instead of a
refusal or hallucination. Widen the scope gate to admit disaster
information and hurricane facts.

Accept both canonical damage strings (no-damage, minor-damage,
major-damage, destroyed, unknown) and the short aliases the frontend
filter expects (none, minor, severe, destroyed, unknown) in
set_classification_filter; a normalization map keeps Gemini's
vocabulary consistent with the system prompt without breaking the
UI contract.

Pin to gemini-2.5-flash-lite for reliable tool-calling; the full
flash model intermittently returns 503 UNAVAILABLE under load.
Synthesize a natural-language reply from the action metadata when
Gemini returns tool calls with no text, replacing the sterile
fallback message.

Addresses UTDisaster/frontend#48
@madhavcodez madhavcodez self-assigned this Apr 14, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
backend Ready Ready Preview, Comment Apr 14, 2026 3:57pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant