-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: update nuxt example for proper streaming support #295
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
Conversation
|
Hi @Hebilicious thanks for following this up 🚀 I think we can avoid this workaround and instead hotfix upstream (unenv, h3, nitro) to promote a proper working example. I am currently working on some fixes. |
@pi0 i'll tag this as draft in the meantime. Do we have 3 separate tracking issues (unenv/h3/nitro) opened ? Edit: The alias issue has been fixed with the latest unenv version. |
Checking on this, what is status of streaming w/nuxt? |
@jaredpalmer It is ready on edge release channels ready to release ~tomorrow on nuxt 3.7 👍🏼 @Hebilicious Would you please update PR with edge to verify? |
891f020
to
90c6def
Compare
@pi0
{
"url": "/api/chat",
"statusCode": 405,
"statusMessage": "HTTP method is not allowed.",
"message": "HTTP method is not allowed.",
"stack": ""
} |
Here's a separated repo with the deployed example : https://github.com/Hebilicious/nuxt-openai-vercel-edge-demo Deployed here : - The code works the same on all platforms and on dev. Note: The code doesn't work without resolutions/overrides. "resolutions": {
"h3": "1.8.0-rc.2",
"nitropack": "2.5.2"
} |
80acfbd
to
7e5790f
Compare
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.
Thanks for working on this dear @Hebilicious ❤️
I think it looks good to me. I have tested with your external repo and it works all fine (made few quick changes would be nice consider some from https://github.com/pi0/nuxt-openai-demo/tree/main)
Also if Vercel team is okay, it would probably be a good idea to merge PR as is with edge dependencies since is better than current example anyway and we will make sure to come with another PR as soon as stable nuxt/nitro with streaming support released 👍🏼
088da3b
to
f6c4e3f
Compare
discovered in #295, using `useSWRV` to track a loading state means we actually get a fetch to the loading API key. We can just use a vue `ref` to handle this state, however.
We hope to have a new version of Nuxt + Nitro released in next couple of days. It might be worth deferring merge of this PR until that point. |
Agreed let's wait to merge and announce by time of release! We can also remove nitro/h3 explicitly pins by next edge release of Nuxt (pending CI) |
Marking this as a draft so it doesn't get accidentally merged. Please ping me here / on Slack when it's ready to go 🚀 |
Good news! h3 1.8 is released and immediately available for all Nuxt users. Just make sure to renew lock file and |
feat: update nuxt example for proper streaming support chore: remove settings.json chore: typos fix: unenv hotfix refactor: properly type messages feat: update to latest versions chore: regenerate lockfile for nuxt chore: remove api key chore: remove .vercel feat: try edge workarounds chore: update to nightly feat: working implementation feat: improve implementation chore: remove nuxt resolution chore: use h3 and nitropack edge chore: lockfile
Co-authored-by: Daniel Roe <daniel@roe.dev>
a2b2f9a
to
d3194b8
Compare
Updated the deps and the lockfile, this should be good to go 🚀 |
Thanks so much @Hebilicious, @pi0, and @danielroe! 🚀 |
discovered in vercel/ai#295, using `useSWRV` to track a loading state means we actually get a fetch to the loading API key. We can just use a vue `ref` to handle this state, however.
discovered in vercel/ai#295, using `useSWRV` to track a loading state means we actually get a fetch to the loading API key. We can just use a vue `ref` to handle this state, however.
Resolves #196
Deployed here => https://nuxt-openai-vercel-hebilicious.vercel.app/
cc @danielroe