n3d1117 / chatgpt-telegram-bot

🤖 A Telegram bot that integrates with OpenAI's official ChatGPT APIs to provide answers, written in Python
GNU General Public License v2.0
3k stars 1.38k forks source link

tts time out #574

Open VectorZhao opened 4 months ago

VectorZhao commented 4 months ago

when i send /tts some wordsto bot, the bot answers timed out, and then seeds me the voice.

2024-05-15 05:38:55,297 - root - INFO - New speech generation request received from user @xxxxx (id: xxxxxxxxx)
2024-05-15 05:39:02,971 - root - ERROR - Timed out
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
      
d
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 373, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request
    raise exc from None
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request
    response = await connection.handle_async_request(
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request
    return await self._connection.handle_async_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 143, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 113, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 186, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 224, in _receive_event
    data = await self._network_stream.read(
  File "/usr/local/lib/python3.9/site-packages/httpcore/_backends/anyio.py", line 37, in read
    return b""
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.9/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ReadTimeout
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/telegram/request/_httpxrequest.py", line 276, in do_request
    res = await self._client.request(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1574, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1661, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1689, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1726, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1763, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 373, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ReadTimeout
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/app/bot/telegram_bot.py", line 311, in _generate
    await update.effective_message.reply_voice(
  File "/usr/local/lib/python3.9/site-packages/telegram/_message.py", line 2625, in reply_voice
    return await self.get_bot().send_voice(
  File "/usr/local/lib/python3.9/site-packages/telegram/ext/_extbot.py", line 3199, in send_voice
    return await super().send_voice(
  File "/usr/local/lib/python3.9/site-packages/telegram/_bot.py", line 2383, in send_voice
    return await self._send_message(
  File "/usr/local/lib/python3.9/site-packages/telegram/ext/_extbot.py", line 587, in _send_message
    result = await super()._send_message(
  File "/usr/local/lib/python3.9/site-packages/telegram/_bot.py", line 731, in _send_message
    result = await self._post(
  File "/usr/local/lib/python3.9/site-packages/telegram/_bot.py", line 615, in _post
    return await self._do_post(
  File "/usr/local/lib/python3.9/site-packages/telegram/ext/_extbot.py", line 349, in _do_post
    return await super()._do_post(
  File "/usr/local/lib/python3.9/site-packages/telegram/_bot.py", line 644, in _do_post
    result = await request.post(
  File "/usr/local/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 200, in post
    result = await self._request_wrapper(
  File "/usr/local/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 340, in _request_wrapper
    raise exc
  File "/usr/local/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 330, in _request_wrapper
    code, payload = await self.do_request(
  File "/usr/local/lib/python3.9/site-packages/telegram/request/_httpxrequest.py", line 293, in do_request
    raise TimedOut from err
telegram.error.TimedOut: Timed out