-
Notifications
You must be signed in to change notification settings - Fork 1.2k
when i use version 0.11 , i get Unrecognized token 'data': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false') #184
Comments
Confirmed.
|
I met the same problem and asked for help |
The above problem is also encountered. When stream=true is not used, there is no such problem |
yes |
It looks like the stream includes data and data: DONE, so the jackson parser is trying to parse a partial result. |
Because stream is set to true, I haven't found a way to handle the sse message returned by stream. I don't know if it is not supported |
just for fun, I set it to false and the call succeeded, so I don't think it's a problem w/ the actual value, just how it's handled in the response. I wonder if the way to fix it is just to add a BufferedReader in CompletionResult and depending on the stream boolean, CompletionRequest either return the List of choices of the BodyHandlers.ofInputStream() in the HttpResponse.
Then if you were expecting a stream, you just read from the stream. |
Any progress on this issue? I am facing thew exact same problem. Thx. Franz |
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
0.12.0 is live with streaming support 👍 |
I got an error like "Unrecognized token 'data': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')",When I use the stream property of the CompletionRequest object. I My guess is that the openAi service was developed in python. Service support is 'true' instead of true.
I want you to take care of it
The text was updated successfully, but these errors were encountered: