-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(stream-text)!: re-implement #44
Conversation
exoticknight
commented
Feb 15, 2025
- onChunk
- onStepFinish
- onFinish
- chunkStream
- stepStream
- textStream
let usage: undefined | Usage | ||
// state | ||
const steps: StreamTextStep[] = [] | ||
const stepOne = async (options: StreamTextOptions): RecursivePromise<void> => { |
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.
While having a closure wrapper here to manage the state implemented well and perfect, but IMO,
- https://github.com/moeru-ai/xsai/pull/44/files#diff-7636fbbf51755bf087c9dcf9f6610de6a2413d69ccf7e6bc91a96f9ad60b8031R138
- https://github.com/moeru-ai/xsai/pull/44/files#diff-7636fbbf51755bf087c9dcf9f6610de6a2413d69ccf7e6bc91a96f9ad60b8031R91
- https://github.com/moeru-ai/xsai/pull/44/files#diff-7636fbbf51755bf087c9dcf9f6610de6a2413d69ccf7e6bc91a96f9ad60b8031R241
- https://github.com/moeru-ai/xsai/pull/44/files#diff-7636fbbf51755bf087c9dcf9f6610de6a2413d69ccf7e6bc91a96f9ad60b8031R303
A lot of things are happening here, there is no comments or diagrams to explain the workflow, or could we have a split version of those functions for better readabilities? What do you think @kwaa ?
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.
A lot of things are happening here, there is no comments or diagrams to explain the workflow, or could we have a split version of those functions for better readabilities? What do you think @kwaa ?
I'm in favor of splitting functions.
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.
The processing of messages primarily follows the workflow of OpenAI's SDK. Multi-step conversations are implemented with reference to generateText. Each step represents a single dialogue flow, which may output multiple chunks during that step.
Co-authored-by: Neko <neko@ayaka.moe>
Co-authored-by: Neko <neko@ayaka.moe>
Co-authored-by: Neko <neko@ayaka.moe>
Co-authored-by: Neko <neko@ayaka.moe>