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

docs: document useChat() from Vercel AI SDK #250

Merged
merged 8 commits into from
Aug 31, 2024
Merged

Conversation

ra-jeev
Copy link
Contributor

@ra-jeev ra-jeev commented Aug 30, 2024

Utility composable for handling Workers AI LLM responses from api endpoints.

Supports streaming/non-streaming responses from a single generator function.

Typical usage:

const response = useAIChat('/api/chat', model, params)();

for await (const chunk of response) {
  // Do something with the response chunks
  // Single chunk for non-streaming case      
}

Copy link

pkg-pr-new bot commented Aug 30, 2024

commit: fc83b41

pnpm add https://pkg.pr.new/nuxt-hub/core/@nuxthub/core@250

Open in Stackblitz

@ra-jeev ra-jeev marked this pull request as ready for review August 30, 2024 15:36
@ra-jeev
Copy link
Contributor Author

ra-jeev commented Aug 30, 2024

@atinux please review the new composable. Instead of having two separate functions for streaming/non-streaming cases, merged into one.

Have also changed the playground AI UI & api endpoint little bit to test the composable.

Thanks,
Rajeev

@atinux atinux changed the title useAIChat composable for LLM responses docs: document useChat() from Vercel AI SDK Aug 31, 2024
@atinux atinux merged commit cca4c4b into nuxt-hub:main Aug 31, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants