Closed randomsnowflake closed 1 year ago
Thank you @randomsnowflake! It should work now, as I have been introducing some updates to avoid the issues that you are facing (more context). Now that I have better control over what is happening, this error should have disappeared with the new release 0.4.0
{"id":"chatcmpl-6zpBNtBaNTSRAen7AUt7bk1N0uDt8","object":"chat.completion.chunk","created":1680192773,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"?"},"index":0,"finish_reason":null}]}
{"id":"chatcmpl-6zpBNtBaNTSRAen7AUt7bk1N0uDt8","object":"chat.completion.chunk","created":1680192773,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{},"index":0,"finish_reason":"stop"}]}
[DONE]
Finished streaming messages
Please, if you find any other issues, I will be happy to fix them :)
Sample code (adapted from the example given):
While the code works and does stream all responses properly, it always fails with:
Wrapping the calls in
do {.. } catch DecodingError.dataCorrupted(let context)
works fine however, but should be handled by your framework.