Giter VIP home page Giter VIP logo

Comments (12)

n3d1117 avatar n3d1117 commented on May 16, 2024 2

Done! Merging now, thanks for testing

from chatgpt-telegram-bot.

n3d1117 avatar n3d1117 commented on May 16, 2024 1

Good catch @AlexHTW, I got a fix and i'll push it tomorrow

from chatgpt-telegram-bot.

n3d1117 avatar n3d1117 commented on May 16, 2024

Hi @AlexHTW, is this a Telegram or a ChatGPT limitation?

I don't have much time, but I added to the README in case someone wants to give it a try!

from chatgpt-telegram-bot.

AlexHTW avatar AlexHTW commented on May 16, 2024

Hey, it's a Telegram limitation. We would just need to split the response into multiple messages if response is larger than the Telegram limit. Thanks for adding it, maybe I can figure it out and contribute.

from chatgpt-telegram-bot.

n3d1117 avatar n3d1117 commented on May 16, 2024

@AlexHTW this should be fixed with #76. Can you confirm this?

from chatgpt-telegram-bot.

AlexHTW avatar AlexHTW commented on May 16, 2024

Hey @n3d1117, thanks.
Yeah I managed to get split messages for a 30 minute voice message and also from prompting for very long answers. So I would say everything works as intended.

I tested with 50-60 minute podcast mp3s and couldn't get a transcript, unfortunately also no log message. Maybe it's an API limit or something about the files itself. Don't think it has to do with this PR though, so I would say ship it ๐Ÿš€

from chatgpt-telegram-bot.

AlexHTW avatar AlexHTW commented on May 16, 2024

I noticed I don't receive a "new transcribe request received" info log when sending the bot podcast mp3s.
On the main branch I get the info log.
53min example file: https://content.blubrry.com/takeituneasy/lex_ai_noam_chomsky_2.mp3

from chatgpt-telegram-bot.

n3d1117 avatar n3d1117 commented on May 16, 2024

@AlexHTW you're right. Bots can download files of up to 20MB in size (source) and the .mp3 you linked is 38,1MB.

There was actually an exception raised in the context.bot.get_file which wasn't handled. Should be improved now with f7bb416.

BTW I tried compressing your mp3 using an online tool, the download then worked but I got:

openai.error.APIError: Maximum content size limit (26214400) exceeded (50819087 bytes read) {
  "error": {
    "message": "Maximum content size limit (26214400) exceeded (50819087 bytes read)",
    "type": "server_error",
    "param": null,
    "code": null
  }
} 413

suggesting there's a limit (~26MB?) for Whisper requests too. I think you're better off splitting your audio into multiple files

from chatgpt-telegram-bot.

AlexHTW avatar AlexHTW commented on May 16, 2024

Thanks for the investigation! I was not aware of those limits.

I looked up the limitations in the Whisper docs, you are correct:

File uploads are currently limited to 25 MB and the following input file types are supported: mp3, mp4, mpeg, mpga, m4a, wav, and webm

The user feedback for files too large is important, thanks. I would suggest also telling the user the actual limit of 20MB when the file is too large.

from chatgpt-telegram-bot.

AlexHTW avatar AlexHTW commented on May 16, 2024

Hey, it looks like the streaming update broke the handling for long messages in chat responses.
After the telegram message limit is reached I get another message "Failed to get response: Message_too_long".

chatgpt-telegram-bot_1  | Traceback (most recent call last):
chatgpt-telegram-bot_1  |   File "/app/bot/telegram_bot.py", line 370, in prompt
chatgpt-telegram-bot_1  |     await context.bot.edit_message_text(content, chat_id=sent_message.chat_id,
chatgpt-telegram-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/ext/_extbot.py", line 1453, in edit_message_text
chatgpt-telegram-bot_1  |     return await super().edit_message_text(
chatgpt-telegram-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/_bot.py", line 331, in decorator
chatgpt-telegram-bot_1  |     result = await func(*args, **kwargs)  # skipcq: PYL-E1102
chatgpt-telegram-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/_bot.py", line 3230, in edit_message_text
chatgpt-telegram-bot_1  |     return await self._send_message(
chatgpt-telegram-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/ext/_extbot.py", line 488, in _send_message
chatgpt-telegram-bot_1  |     result = await super()._send_message(
chatgpt-telegram-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/_bot.py", line 512, in _send_message
chatgpt-telegram-bot_1  |     result = await self._post(
chatgpt-telegram-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/_bot.py", line 419, in _post
chatgpt-telegram-bot_1  |     return await self._do_post(
chatgpt-telegram-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/ext/_extbot.py", line 306, in _do_post
chatgpt-telegram-bot_1  |     return await super()._do_post(
chatgpt-telegram-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/_bot.py", line 450, in _do_post
chatgpt-telegram-bot_1  |     return await request.post(
chatgpt-telegram-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 165, in post
chatgpt-telegram-bot_1  |     result = await self._request_wrapper(
chatgpt-telegram-bot_1  |   File "/usr/local/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 328, in _request_wrapper
chatgpt-telegram-bot_1  |     raise BadRequest(message)
chatgpt-telegram-bot_1  | telegram.error.BadRequest: Message_too_long

example prompt: list all presidents of the United States with a short biography and list of their major achievements.

from chatgpt-telegram-bot.

n3d1117 avatar n3d1117 commented on May 16, 2024

Actually just pushed it now @AlexHTW, could you do a git pull and test it? bc6a4e4

from chatgpt-telegram-bot.

AlexHTW avatar AlexHTW commented on May 16, 2024

Awesome. Tested it, works great :) Thank you

from chatgpt-telegram-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.