vercel / ai-chatbot

A full-featured, hackable Next.js AI chatbot built by Vercel
https://chat.vercel.ai
Other
6.52k stars 2.05k forks source link

Refreshed Template! #438

Open jeremyphilemon opened 1 week ago

jeremyphilemon commented 1 week ago

Hey everyone!

We've made significant changes to the Next.js Chatbot template. By building v0 over the past year, we spent a lot of time pushing the limits of delivering the best chat experience for the web. The AI SDK abstracts some of these best practices and commonly used patterns like middleware, multi-step tool calls, attachments, telemetry, provider registry, etc. into a toolkit that you can use to quickly and reliably integrate AI into your applications.

This refresh materializes our learnings into a production-ready template that developers can get started with. In addition, we've resolved many common issues reported in the tracker by fixing bugs that were impacting functionality and usage.

Your feedback has been invaluable in shaping this refresh, and we look forward to your continued input as we evolve the template further!

athrael-soju commented 1 week ago

I'll be damned. You guys finally did it and it's the best one yet! Simple, no fluff, react 19, next 15 + blob/pg. I'd have loved to see some tanstack/react-query in there, but I know I'm getting greedy now. I'll add that myself ;)

Kudos @jeremyphilemon

chuckstock commented 5 days ago

was there reasons to move away from actions to api fetch calls?

nilsmassing commented 4 days ago

The file upload does not seem to work or am i missing something?

zzh8829 commented 4 days ago

It seems like i cannot login anymore Application error: a client-side exception has occurred (see the browser console for more information). POST https://chat.vercel.ai/login 429 (Too Many Requests)

something wrong with rate limiter?

athrael-soju commented 4 days ago

The file upload does not seem to work or am i missing something?

It will only work for images

jeremyphilemon commented 4 days ago

@chuckstock there are server actions still present in the template (see auth functions); but you're observation is right, some of them have been converted to route handlers so they can be used with swr.

@zzh8829 looks like the rate limiter is working as intended, but the error could've been a toast instead of throwing a client-side exception – will have a fix in!

@nilsmassing can you share more information about what you tried so I can debug? would like to know if you have the postgres and blob setup, whether you're seeing this during local dev or prod, etc.

nilsmassing commented 3 days ago

@jeremyphilemon I tried using pdf files. Didn't know it only works with images, but that's cool with me.

FYI: I used this template to make a feedback bot that answers questions for students regarding corporate controlling courses and I wanted the bot to be able to read the course script and answer accordingly. I got it to work by coding a getAssistant tool instead of getWeather to make a call to the OpenAI Assistants AI in case of questions regarding the pdf file.

I'm really thankful and impressed by the work you put into this. The app looks and feels flawless! Big Thank you 😊

jeremyphilemon commented 2 days ago

@nilsmassing you can try the gemini chatbot if you'd like to use files other than images – it should support pdfs!

also glad to hear that the template makes it easy to build on top of, like you've mentioned with your use case :)

hieutrluu commented 3 hours ago

@chuckstock there are server actions still present in the template (see auth functions); but you're observation is right, some of them have been converted to route handlers so they can be used with swr.

@zzh8829 looks like the rate limiter is working as intended, but the error could've been a toast instead of throwing a client-side exception – will have a fix in!

@nilsmassing can you share more information about what you tried so I can debug? would like to know if you have the postgres and blob setup, whether you're seeing this during local dev or prod, etc.

Hi @jeremyphilemon, thank you and the team for the great work. I am stilled curious about the migration from AI RSC to route handling considering that the nextjs and vercel team is pushing so much for the server action. Is there any specific benefit that we have from having using AI use client fetching library like SWR ?

hieutrluu commented 3 hours ago

oh, I have found the explanation here: https://github.com/vercel/ai-chatbot/issues/438#issuecomment-2423551206 thank you and the team again