SwiftOpenAI icon indicating copy to clipboard operation
SwiftOpenAI copied to clipboard

Decoding Data Corrupted on `CreateChatCompletionsStream`

Open jmanalang3 opened this issue 1 year ago • 0 comments

I got error on createChatCompletionsStream.

Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected character ':' after top-level value around line 1, column 16." UserInfo={NSDebugDescription=Unexpected character ':' after top-level value around line 1, column 16., NSJSONSerializationErrorIndex=15})))

Sample data response it seem the data is invalid

data: {"id":"chatcmpl-9lxsJJyn7dKbdXR6ZL0gKjmjata8b","object":"chat.completion.chunk","created":1721218603,"model":"gpt-3.5-turbo-0125","system_f

jmanalang3 avatar Jul 17 '24 10:07 jmanalang3