seratch/ChatGPT-in-Slack

Response can't be longer than 4000 characters?

Closed this issue · 3 comments

Hey there
Does someone else have the issue that when posting a message with >4000 characters they get 'msg_too_long'? I don't understand it since Slack says they support up to 40'000 characters: https://api.slack.com/changelog/2018-04-truncating-really-long-messages

Any idea what's going on?

Hi @BigBerny, the 40K truncation is an old requirement and the platform now has a smaller limit for the text data. If your app generates 4K text, indeed posting the message could result in the error. Adding something extra (e.g., your response must not exceed 3,000 characters) to the system prompt may help us avoid hitting the error, but I haven't verified if such an approach really works out with OpenAI LLM.

But on https://api.slack.com/methods/chat.update it says it will truncate very long messages, so I don't understand why it's not doing in that case. Any idea?
CleanShot 2024-10-01 at 17 02 18

The platform has been changing over time. It used to allow 40K a while ago but it may not be the case anymore. I believe that official document needs to be updated, so will escalate the issue. Since this is not an issue tracker for general questions/discussions about the platform, let me close this now. Thanks for sharing this!