-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Still experiencing "Unrecognized token 'data': was expecting..." when using stream(true)...code works fine when stream(false) is set. #83
Comments
Can you print your prompt out? I want to make sure you don't have to quote it.
|
Thanks for the reply. That does not change the issue. I can type in a string for the prompt as well, and the same result happens. |
Let me experiment. This from the code: I'm wondering if you need to define a get output stream? I don't know the exact syntax w/o testing it yet.
Because I wonder in your .collect it's not handling the DONE correctly? i.e.
|
Some previous discussion and ideas on the subject. |
|
The response for stream(true) utilizes the Server-Sent Events protocol, which is not currently supported by this project's retrofit2 API. Discussions on this issue can be found here square/retrofit#1029. Unfortunately, it does not seem as though this issue can be resolved in the near future as long as retrofit is in use. |
See #129 |
Utilize retrofit2.http.Streaming and retrofit2.Call<ResponseBody> in additional OpenAIApi methods to enable a streamable ResponseBody. Utilize retrofit2.Callback to get the streamable ResponseBody, parse Server Sent Events (SSE) and emit them using io.reactivex.FlowableEmitter. Enable: - Streaming of raw bytes - Streaming of Java objects - Shutdown of OkHttp ExecutorService Fixes: TheoKanning#51, TheoKanning#83, TheoKanning#182, TheoKanning#184
Utilize retrofit2.http.Streaming and retrofit2.Call<ResponseBody> in additional OpenAIApi methods to enable a streamable ResponseBody. Utilize retrofit2.Callback to get the streamable ResponseBody, parse Server Sent Events (SSE) and emit them using io.reactivex.FlowableEmitter. Enable: - Streaming of raw bytes - Streaming of Java objects - Shutdown of OkHttp ExecutorService Fixes: #51, #83, #182, #184
This is fixed in 0.12.0 👍 |
This issue was set to "Closed" (issue #52), but I am still having the same issue despite trying the recommended fix. I've been pulling my hair out with this one for three days. Please help?
Here is my code that gives the error in the logcat, "Unrecognized token 'data': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')":
The text was updated successfully, but these errors were encountered: