Edit code for success run

This commit is contained in:
2026-04-12 21:58:40 +03:00
parent 128cc70ab9
commit 0a89bf5105
8 changed files with 111 additions and 101 deletions

View File

@@ -79,21 +79,21 @@ def ask_agent_stream(text: str, conv: "Conversation | None" = None, agent_id: st
log.exception("Gateway недоступен")
msg = "Не могу связаться с сервером, попробуй ещё раз."
print(f"⚠️ {msg}")
#play_error_sound()
play_error_sound()
speak(msg, agent_id)
return msg
except requests.Timeout:
log.exception("Gateway таймаут")
msg = "Сервер не ответил вовремя, попробуй ещё раз."
print(f"⚠️ {msg}")
#play_error_sound()
play_error_sound()
speak(msg, agent_id)
return msg
except requests.HTTPError:
log.exception(f"Gateway HTTP ошибка {resp.status_code}")
msg = "Ошибка сервера, попробуй ещё раз."
print(f"⚠️ Gateway {resp.status_code}: {resp.text}")
#play_error_sound()
play_error_sound()
speak(msg, agent_id)
return msg