iqfareez / flutter_chatgpt

Flutter + Chat UI + ChatGPT API
https://fl-chatgpt.web.app
MIT License
26 stars 20 forks source link

Create Stream on each message? #5

Open desmeit opened 10 months ago

desmeit commented 10 months ago

You are creating a new stream with a new event id with each message. So you have a new stream for every speech bubble? Is that the right way?

What if the user enters a new message while Chat GPT is responding. Then several listeners run simultaneously.

Wouldn't it be better to initialize the stream only once and then update it in some way?

iqfareez commented 4 months ago

I agree with you. Creating stream every time the user send a message is not the best practice.