Report in frontend the specific server error
After playing with the cat for a while, looks like the context memory gets full. The frontend message is
"Something went wrong while sending your message. Please try refreshing the page"
but the backend log reports
openai.error.InvalidRequestError: This model's maximum context length is 4097 tokens. However, your messages resulted in 12341 tokens. Please reduce the length of the messages.
I am not in the code yet enough to propose a pull but from the user perspective my suggestion are
- To make the frontend message more explicit (e.g, The context memory exceeded its maximum size, please remove something) and then the user shall do it in some way, e.g. via the endpoint mentioned here .
- To inform the user that the memory is exceeded and then automatically remove the oldest memories and reiterate the query. The criterion to remove memories could also be flexible, e.g. remove the oldest, remove the ones closer to a given token.
Thank you for signaling @mallibus ! We planned to contain prompt size by using summarization (issue #16). Hopefully memories management will be customizable via plugin, so you can do what you want.
I'm leaving this issue open and editing the title for your second point, better error information.
Fixed, now core gives error name and description also via websocket
Admin shows this info already