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

Why not a single client side library rather than a separate for nuxt/react/svelte etc #3121

Open
lgrammel opened this issue Sep 26, 2024 Discussed in #3120 · 0 comments
Open
Assignees
Labels
ai/ui enhancement New feature or request

Comments

@lgrammel
Copy link
Collaborator

Discussed in #3120

Originally posted by cosbgn September 26, 2024
OpenAI has this very nice client side abstraction which works with events like this:

const runner = ChatCompletionStreamingRunner.fromReadableStream( response.body )
runner.on('message', (message) => {
    messages.value.push(message)
})
runner.on('functionCall', (fn) => {
})
// etc

It would be very nice if the AI-SDK would have something similar which would work on any framework.

This way all updates would be immediately available for react, vue and all at the same time and would simplify a ton development.

For the end user is then super simple to use their own useChat system to manage messages. Optionally you could still have your own useChat implementation for different frameworks, but users could still access all features using the core vanilla js client side library.

@lgrammel lgrammel added enhancement New feature or request ai/ui labels Sep 26, 2024
@lgrammel lgrammel self-assigned this Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai/ui enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant