taspol commited on
Commit
af1098a
·
1 Parent(s): b11ea23

feat: add cold debugging

Browse files
Files changed (1) hide show
  1. utils/llm_caller.py +9 -16
utils/llm_caller.py CHANGED
@@ -12,6 +12,7 @@ from interface import DayTimeline, TimelineEntry, Spot, Budget, Permits, Safety,
12
  from interface import Preparation, PreparationItem
13
  from class_mod.rest_qdrant import RestQdrantClient
14
  import json
 
15
 
16
  load_dotenv()
17
  SYSTEM_PROMPT = """You are a helpful travel assistant. Use the provided context to answer the user's question about travel destinations and places.
@@ -321,22 +322,14 @@ class LLMCaller:
321
  activities=0.0,
322
  total=0.0
323
  )
324
-
325
- return PlanResponse(
326
- tripOverview=f"Error generating trip plan: {str(e)}",
327
- query_params=plan_request,
328
- retrieved_data=[],
329
- trip_plan=TripPlan(
330
- title="Error occurred",
331
- date="",
332
- timeline=[],
333
- spots=[],
334
- budget=fallback_budget,
335
- permits=None,
336
- safety=None
337
- ),
338
- preparation=None, # Add this line
339
- meta={"status": "error", "error": str(e)}
340
  )
 
341
 
342
 
 
12
  from interface import Preparation, PreparationItem
13
  from class_mod.rest_qdrant import RestQdrantClient
14
  import json
15
+ from fastapi import HTTPException
16
 
17
  load_dotenv()
18
  SYSTEM_PROMPT = """You are a helpful travel assistant. Use the provided context to answer the user's question about travel destinations and places.
 
322
  activities=0.0,
323
  total=0.0
324
  )
325
+ raise HTTPException(
326
+ status_code=500,
327
+ detail={
328
+ "error": "Internal server error",
329
+ "message": str(e),
330
+ "details": "An unexpected error occurred while processing the request."
331
+ }
 
 
 
 
 
 
 
 
 
332
  )
333
+
334
 
335