-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad Request: message text is empty #14
Comments
Which deployment method did you use? And could you paste your configuration (remember to hide the API keys) here? |
i have the same question ,here is my config
and docker compose file blow
If its Necessary,logs:
|
Same problem |
@Evergreentreejxc Did you face the issue every time you send a message to the bot? |
@unixzii yes |
Could you try calling OpenAI API directly to see if you can get the correct responses? |
I also encountered this problem, and the API works normally in other programs. |
same as me |
🙈I just compiled a version myself to run directly, but I encountered the same issue. |
@Voldeemort Did you see "Thinking..." prompt replied after sending a message to the bot, or did the bot literally not respond at all? |
I saw thinking content |
Yes, I saw the 'Thinking...' prompt |
It seems that Telegram APIs are working, but something is going wrong with OpenAI responses (or parsing of them). Would you mind trying the latest prebuilt binaries? |
Is it the 0.1.1 version from 21 hours prior to the build? |
Yes, technically it should have nothing to do with this issue, but it's still worth a try. |
I still got this error when I used the 0.1.1 version you built on my Mac: 2023-03-24T12:50:18.944Z INFO telegpt_core::app > Initializing bot... |
Got no ideas on this. 😅 But I still think it's probably a network problem, I need some network packet captures for further diagnostics. |
You can add |
maybe i can show you my server username and password, i get the same problem running the program on both debian and macos, as did the other person... hmmm... |
I will suggest you not to share your server credentials with others, as the necessary logs are enough for our discussion. |
TRACE want > poll_want: taker wants! |
@unixzii Hi,i found something interesting, So i thought that's something wrong with telegram api,or the way you guys call the interface. |
Sorry for the inconvenience, but I cannot reproduce your issue on my machines (both Linux and macOS). If it's possible, you can add some logs at async fn actually_handle_chat_message(...) {
// ...
let result = stream_model_result(
&bot,
&chat_id,
&sent_progress_msg,
progress_bar,
msgs,
openai_client,
&config,
)
.await;
// Add log message here:
println!("OpenAI response: {:#?}", result);
// ...
} So you can see what OpenAI actually returns. |
This question is strange, I have tried https://github.com/m1guelpf/chatgpt-telegram and it works fine. |
Thank you for your reply, I will try again. |
Hi,unixzii,The following logs have been printed, please have a look |
By the way, I have tried creating a new bot, but the same problem persists. From the feedback in the logs, it seems that OpenAI is returning a blank message to me. |
Hi, @unixzii ,I think I have found a problem after capturing packets, and the following is the corresponding JSON data of the OpenAI API endpoint, "https://api.openai.com/v1/chat/completions"
After discovering this issue, I tried modifying 4096 to 2048 in |
You can refer to it.
|
Hi @Voldeemort, sorry for the late reply. I appreciate your investigation, that's very helpful. The default max token is 4096, however, you can change it in the configuration file. Don't know why the input prompt exceeded the limitation. That's a very strange behavior. |
Thanks for that discover @Voldeemort! Maybe it's a restriction with my OpenAI account site that |
app_1 | 2023-03-22T01:27:41.154Z ERROR telegpt_core::modules::chat > Failed to handle chat message: A Telegram's error: Bad Request: message text is empty
The text was updated successfully, but these errors were encountered: