Spaces:
Paused
Paused
Update chat_handler.py
Browse files- chat_handler.py +3 -3
chat_handler.py
CHANGED
|
@@ -331,8 +331,8 @@ async def _execute_api_call(session: Session, intent_config) -> str:
|
|
| 331 |
|
| 332 |
log(f"📡 Calling API: {api_name}")
|
| 333 |
|
| 334 |
-
# Execute API call
|
| 335 |
-
response = execute_api(api_config, session
|
| 336 |
api_json = response.json()
|
| 337 |
|
| 338 |
# Humanize response
|
|
@@ -349,7 +349,7 @@ async def _execute_api_call(session: Session, intent_config) -> str:
|
|
| 349 |
session.reset_flow()
|
| 350 |
return f"İşlem tamamlandı: {api_json}"
|
| 351 |
|
| 352 |
-
except
|
| 353 |
session.reset_flow()
|
| 354 |
return intent_config.get("fallback_timeout_prompt", "İşlem zaman aşımına uğradı.")
|
| 355 |
except Exception as e:
|
|
|
|
| 331 |
|
| 332 |
log(f"📡 Calling API: {api_name}")
|
| 333 |
|
| 334 |
+
# Execute API call with session
|
| 335 |
+
response = execute_api(api_config, session) # Pass session instead of just variables
|
| 336 |
api_json = response.json()
|
| 337 |
|
| 338 |
# Humanize response
|
|
|
|
| 349 |
session.reset_flow()
|
| 350 |
return f"İşlem tamamlandı: {api_json}"
|
| 351 |
|
| 352 |
+
except requests.exceptions.Timeout:
|
| 353 |
session.reset_flow()
|
| 354 |
return intent_config.get("fallback_timeout_prompt", "İşlem zaman aşımına uğradı.")
|
| 355 |
except Exception as e:
|