From 5115b32c496fef4eaaaa82984ef6b046898b27d9 Mon Sep 17 00:00:00 2001 From: "beetles-ai[bot]" <221859081+beetles-ai[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:06:33 +0000 Subject: [PATCH] Patch for controllers/chat.py --- controllers/chat.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/controllers/chat.py b/controllers/chat.py index 332e557..037107e 100644 --- a/controllers/chat.py +++ b/controllers/chat.py @@ -135,8 +135,12 @@ async def search_jobs( }} """ - response = await model.generate_content_async(prompt) - chat_response = response.text +try: +response = await model.generate_content_async(prompt) +chat_response = response.text +except Exception as e: +print(f"Error calling Gemini API: {e}") +raise HTTPException(status_code=500, detail="Failed to get response from chat API") # Extract the JSON part from the response try: