-
Notifications
You must be signed in to change notification settings - Fork 304
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
Add streaming session and ability to use streaming #57
Conversation
public let index: Int | ||
public let message: Chat | ||
public let finishReason: String | ||
public let message: Chat? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to mix the complete and partial results, can you comment in what condition these properties are nil
?
I have moderate preference in separating a complete Choice
from a PartialChoice
, provided that they have major differences, despite the official OpenAI API mix them together.
// Choice stays the same
public struct PartialChoice: Codable, Equatable {
struct Delta: Codable, Equatable {
public let content: String?
public let role: Chat.Role?
}
public let index: Int
public let delta: Delta
}
As a result, the result can contain enum of either Choice
or PartialChoice
What do you think? Appreciated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've decided to keep ChatResult
to not break backward compatibility and created "ChatStreamingResult" along with a separate function for streaming. I found this solution more straightforward and clean. What do you think about this?
Since we are using two separate functions for the |
I added streaming in the demo app #59 |
Adopt streaming in Demo app
It looks like everything is working as expected 🤞 |
Hi @Krivoblotsky do you know when this can be merged? |
Hi, @DJBen |
Update documentation on streaming
Update documentation
Hey, @DJBen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG!
What
Why
#14
Affected Areas
Completions, Chats