Comments (12)
Done! Merging now, thanks for testing
from chatgpt-telegram-bot.
Good catch @AlexHTW, I got a fix and i'll push it tomorrow
from chatgpt-telegram-bot.
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.
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.
@AlexHTW this should be fixed with #76. Can you confirm this?
from chatgpt-telegram-bot.
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.
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.
@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.
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.
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.
Actually just pushed it now @AlexHTW, could you do a git pull and test it? bc6a4e4
from chatgpt-telegram-bot.
Awesome. Tested it, works great :) Thank you
from chatgpt-telegram-bot.
Related Issues (20)
- Transcription of a video room
- Server disconnected without sending a response
- cant deploy on heroku HOT 2
- feature needed steam mode on receiving text
- request: add perplexity api
- Предложение
- gpt-4-vision-preview is deprecated HOT 4
- Plots in answers
- TOKEN_PRICE should be replaced with INPUT_TOKENS_PRICE and OUTPUT_TOKENS_PRICE
- max_tokens_default TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
- Unknown encoding gpt-3.5-turbo. Plugins found: ['tiktoken_ext.openai_public'] HOT 1
- Wrong conversation summary size vs MAX_TOKENS HOT 1
- /reset not working HOT 1
- Feature request: file upload
- count_tokens_vision() is not implemented for model gpt-4o. HOT 1
- proxy credentials HOT 1
- List index out of range
- gpt-4o-mini HOT 6
- - root - WARNING - User is not allowed to use the bot HOT 3
- help error 403 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-telegram-bot.