Closed linqingfan closed 7 months ago
Hey @linqingfan. Hope your issue got resolved. For reference, I recommend looking at the connect part of the documentation for more information.
I have managed to make flask openai example to work but I don't know why there is always error after some medsag5 have been streamed. Also the streamed text seems to repeat itself...
The double stream behaviour does seem to be a bug, let me see what I can do to fix it.
In regards to the error you are referencing, I don't seem to be getting it on my end. Could you let me know what setup code you are using for Deep Chat and what the error is to help me get a better idea about it. Also, I am using the example UI project to connect to the example server right out of the box, it might be worth to check it out.
Never mind, I now started to get the error too. I'll look into this now.
Ok, it appears that OpenAI's streaming functionality can now sometimes return an incomplete JSON at the start or at the end which is what was causing the errors to be thrown. On the other hand it is now returning multiple choices per chunk which was causing the same message being returned multiple times as the strategy to aggregate text had to be changed.
For Python specifically - I had to also increase thechunk_size
to 2048
as longer messages weren't fully read. You can raise this value to higher if you have longer messages.
Please check out the new code in this file.
Thanks!
Hi, after using the new file, it works without repetition and no error. Thanks
I just started looking at deep.dev and I m looking at the following example:
Assuming i have set the request url, but how do I get the response message from URL request?