bitswired / fuseai

Self-Hosted and Open-Source web app to interact with OpenAI APIs. Currently supports ChatGPT, but DALLE and Whisper support is coming.
290 stars 44 forks source link

No response after longer interactions #13

Closed ufulu closed 1 year ago

ufulu commented 1 year ago

I don’t know if this is a bug or an issue on openai’s api side. After longer constant conversations going back and forth suddenly no responses come back. As soon as I open a new chat I am good to go again and can continue interacting with the api until it stops again. Can you give me a hint as to how I might be able to debug this and shed some more light onto this issue?

Alternatively some error messages in the UI might be helpful for the user to understand what’s going on.

ufulu commented 1 year ago

I will run with yarn dev tomorrow and see if I can find something.

minisaurus commented 1 year ago

I've noticed this too. It stops responding after about 12-15 responses.

ufulu commented 1 year ago

tRPC failed on chat.addToChat: Request failed with status code 400

shows up when this behaviour occurs.

jimzer commented 1 year ago

Hey guys :) Thanks for reporting the issue.

The problem is that we have a maximum of ~4000 tokens for the context, and for now, the app is sending the entire chat as a context. I need to implement a "forgetting" behavior.

However, I don't know the best way to do it.

Should we only keep the most recent context?

jimzer commented 1 year ago

I close this issue since #15 fixed it for now.

@ufulu You can look at the changes and open a new issue if you prefer another behavior for forgetting the history.