Edit code for success run
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user