-
Notifications
You must be signed in to change notification settings - Fork 336
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 is broken #14
Comments
Hey, @randomsnowflake. |
I hope this will be implemented soon. Meanwhile, you can use this alternative (only for streaming - I'm using both clients in my app) https://github.com/nate-parrott/openai-streaming-completions-swift |
I already use it. I think it's also the only Swift OpenAI API with streaming support. However, have a look at my issue report here: Missing Model Parameters and No Error Message ... it's not as mature as I would like. Looking forward to MacPaw's implementation of streaming. |
I know that @rshimoda is on his way to adding streaming support here, so I believe it must be implemented shorty 👌 |
Hey there, I'll do my best to implement this soon 😉 |
@rshimoda Hi Sergi do you have a timeline for the implementation? Let me know if you need any help or have any WIP branch. |
I am exploring a solution right now - it looks like a bigger work than I expect, and it is more akin to a separate project than 'fixing' the streaming. We might need to rely on other |
Hey, @DJBen and everyone. It has several weak points, such as optional delta and message in ChatResult, but overal looks good to me. openAI.chats(query: .init(model: .gpt3_5Turbo, messages: [.init(role: .user, content: "Who is Taras Shevchenko?")], stream: true)) { result in
switch result {
case .success(let res):
//called multiple times
if let messageDelta = res.choices.first?.delta?.content {
print(messageDelta)
}
case .failure(let error):
print(error)
}
} Any feedback is very appreciated 🙏 |
Almost there: #57 🤞 |
Fixed by #57 |
Code
Exception
It works with
stream: false
The text was updated successfully, but these errors were encountered: