debugging for trips assistant

This commit is contained in:
Logan
2026-06-21 14:31:26 -04:00
parent af4079d648
commit 522748f07a
+6 -1
View File
@@ -84,6 +84,11 @@ async def _places_search(query: str, near: str) -> list[dict]:
params={"query": f"{query} {near}".strip(), "key": settings.google_maps_api_key},
)
data = r.json()
status = data.get("status")
results = data.get("results", [])
logger.info(f"Places search '{query} {near}': status={status}, count={len(results)}")
if status not in ("OK", "ZERO_RESULTS"):
logger.warning(f"Places API error: {status}{data.get('error_message', '')}")
return [
{
"name": p.get("name"),
@@ -92,7 +97,7 @@ async def _places_search(query: str, near: str) -> list[dict]:
"maps_link": f"https://www.google.com/maps/place/?q=place_id:{p.get('place_id')}",
"rating": p.get("rating"),
}
for p in data.get("results", [])[:5]
for p in results[:5]
]
except Exception as e:
logger.error(f"Places search in assistant failed: {e}")