Aniket2006 commited on
Commit
a7903f2
·
1 Parent(s): 9d8c05a

Lower confidence thresholds for satellite data fetch and reasoning

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -304,10 +304,13 @@ async def chat(request: ChatRequest):
304
  logger.info(f"Intent: {intent['primary_intent']} ({intent['confidence']})")
305
 
306
  # Fetch satellite data for technical queries (vegetation, water, nutrient intents)
307
- satellite_intents = ["vegetation_health", "water_stress", "nutrient_status", "pest_disease", "forecast_query"]
 
 
 
308
  if (intent["primary_intent"] in satellite_intents and
309
  context.get("coordinates") and
310
- intent["confidence"] > 0.5):
311
 
312
  logger.info("Fetching satellite data from HF Space APIs...")
313
  try:
@@ -324,7 +327,7 @@ async def chat(request: ChatRequest):
324
 
325
  # Determine if we need full reasoning or simple response
326
  use_full_reasoning = (
327
- intent["confidence"] > 0.6 and
328
  context and
329
  intent["primary_intent"] not in ["general_query"]
330
  )
 
304
  logger.info(f"Intent: {intent['primary_intent']} ({intent['confidence']})")
305
 
306
  # Fetch satellite data for technical queries (vegetation, water, nutrient intents)
307
+ satellite_intents = [
308
+ "vegetation_health", "water_stress", "nutrient_status",
309
+ "pest_disease", "forecast_query", "zone_specific", "action_recommendation"
310
+ ]
311
  if (intent["primary_intent"] in satellite_intents and
312
  context.get("coordinates") and
313
+ intent["confidence"] >= 0.3): # Lowered threshold to 0.3
314
 
315
  logger.info("Fetching satellite data from HF Space APIs...")
316
  try:
 
327
 
328
  # Determine if we need full reasoning or simple response
329
  use_full_reasoning = (
330
+ intent["confidence"] >= 0.4 and # Lowered from 0.6
331
  context and
332
  intent["primary_intent"] not in ["general_query"]
333
  )