You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm getting a Stream Error when trying to stream chat response: Stream Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected end of file" UserInfo={NSDebugDescription=Unexpected end of file})))
Sometimes it works for a few words and then fails, sometimes it fails directly.
To Reproduce
Steps to reproduce the behavior:
Install OpenAI for Swift, latest version: 0.2.5 and init with token.
Write a query with GPT4: let query = ChatQuery(model: .gpt4_1106_preview, messages: …)
Run chatsStream(): for try await res in req.openAI.openAI.chatsStream(query: query) { … )
Try to run it and see the error listed above
Expected behavior
I'd expect it not to error.
Screenshots
n.a.
Smartphone (please complete the following information):
Device: iPhone 15
OS: iOS 17.3
Additional context
n.a.
The text was updated successfully, but these errors were encountered:
I've tested a few more models and it also fails on gpt3_5Turbo_1106, gpt3_5Turbo_16k. I've tried a few times on gpt3_5Turbo - which seems to have worked always. Possibly OpenAI sends some empty/non-json messages with newer models and the library is not prepared for that.
Describe the bug
I'm getting a Stream Error when trying to stream chat response:
Stream Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data was not valid JSON.", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 "Unexpected end of file" UserInfo={NSDebugDescription=Unexpected end of file})))
Sometimes it works for a few words and then fails, sometimes it fails directly.
To Reproduce
Steps to reproduce the behavior:
let query = ChatQuery(model: .gpt4_1106_preview, messages: …)
for try await res in req.openAI.openAI.chatsStream(query: query) { … )
Expected behavior
I'd expect it not to error.
Screenshots
n.a.
Smartphone (please complete the following information):
Additional context
n.a.
The text was updated successfully, but these errors were encountered: