Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

streaming function chatsStream stopped working #153

Closed
manurueda opened this issue Jan 31, 2024 · 1 comment
Closed

streaming function chatsStream stopped working #153

manurueda opened this issue Jan 31, 2024 · 1 comment

Comments

@manurueda
Copy link

Describe the bug
I have experienced problems when getting an streaming output since today Jan 31st 2023. My previous code was working smoothly, so I believe it could be an update on the output JSON that is creating this errors. Here are some logs I am getting when doing a simple query on streaming that was previously working:

[OpenAIManager:46 - streamChatGPT(text:onReceive:onError:)]  Error in chat stream: 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}))). Retry attempt: 0
[OpenAIManagerTests:36 - testStreamChatGPT()]  Delta Content: 
[OpenAIManagerTests:36 - testStreamChatGPT()]  Delta Content: Hello
[OpenAIManagerTests:36 - testStreamChatGPT()]  Delta Content: !
[OpenAIManager:46 - streamChatGPT(text:onReceive:onError:)]  Error in chat stream: 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}))). Retry attempt: 1
[OpenAIManagerTests:36 - testStreamChatGPT()]  Delta Content: 
[OpenAIManager:46 - streamChatGPT(text:onReceive:onError:)]  Error in chat stream: 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}))). Retry attempt: 2

To Reproduce
Do a basic chatsStream query.

Expected behavior
Consistent output, no errors like "The given data was not valid JSON."

@manurueda
Copy link
Author

I found a couple of pull requests regarding this issue: #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant