Hands on with the Vercel AI SDK 3.1

  Рет қаралды 33,117

Vercel

Vercel

Күн бұрын

Пікірлер: 94
@DS-ow2ge
@DS-ow2ge 4 ай бұрын
Each new generative UI example from you guys is implemented in a different pattern. From manually intercepting response types to the latest streamui+tools. Does the team feel this present pattern is mature or are they unhappy with it and will be redoing it next month?
@fagnersales532
@fagnersales532 4 ай бұрын
Nice observation
@carloslfu
@carloslfu 4 ай бұрын
Yeah, but this is why it experimental. Use at your own risk!
@shuding
@shuding 4 ай бұрын
Hey, AI SDK maintainer here! I'm not sure what you're referring to regarding "intercepting response types", but `streamUI` is pretty stable. It's the same as the previous experimental `render` function, but with a more consistent name as other APIs like `streamText` and `streamObject`. Also worth mentioning that the Generative UI APIs are designed to be general enough and fit into any UI patterns and AI pipelines, which means that there isn't only one way to do Generative UI. For example, you can just use `streamUI` + tools to handle LLM + UI, or combine low-level utilities like `createStreamableUI`/`createStreamableValue` and your existing pipeline for flexibility. Happy to answer any questions!
@wshewm
@wshewm 4 ай бұрын
@@shuding What are your recommendations for maintaining type-safety in the application, especially surrounding the server actions and use of the `useActions` hook? Unless I'm missing something, it seems like the required use of the hook defeats one of the major benefits of server actions: end to end type safety. Is there maybe a lower-level approach that I could take to bypass the hook?
@itszachhan
@itszachhan 4 ай бұрын
​@@shuding Can you use libraries like shadcn and nextui for the streamed components? Last time I tried, it wasnt working
@MilindMishra
@MilindMishra 4 ай бұрын
Thanks for the walkthough! Looking fwd to build generative ui stuff :)
@whovivekshukla
@whovivekshukla 4 ай бұрын
I tried out their streaming ui a few months ago! that was pretty dope!
@syndg
@syndg 4 ай бұрын
Was just about to send you this video for our reference. Glad to see you already watched it!
@TomAsh519
@TomAsh519 4 ай бұрын
Could you please do a tutorial on the combined use of ai ask with long chain adapter that utilizes eg. simple RAG? From your documentation it is not clear how to implement it properly.
@jervx829
@jervx829 27 күн бұрын
U need vectors
@TheJuava
@TheJuava 4 ай бұрын
Great Overview! A Video incorporating RAG with Vercel AI SDK would be awesome!
@nicoalbanese10
@nicoalbanese10 3 ай бұрын
Thanks for the suggestion - this is on our list!
@0xOmzi
@0xOmzi 3 ай бұрын
Hyped! 🥳
@yaseerokino
@yaseerokino 4 ай бұрын
Vercel always coming through for developers
@michaelo4u
@michaelo4u 4 ай бұрын
Thanks! Great job simplifying it.
@ahmadbilalfarooqi
@ahmadbilalfarooqi 4 ай бұрын
great explain by AI SDK of Vercel its really helpful and easiest for building application with the use of predefined function and method
@TomAsh519
@TomAsh519 4 ай бұрын
it is me only or this tutorial and the repo does not work? I got Error: `useUIState` must be used inside an provider. to resolve it add import { AI } from "./action"; to root layout: export default function RootLayout({ children, }: Readonly) { return ( {children} ); }
@ShaneCrenshaw
@ShaneCrenshaw 3 ай бұрын
If you are calling getAiState or useUIState, it has to happen inside of So you could create a new component and do something like and inside of Chat, that's where you would use uiUIState
@wshewm
@wshewm 4 ай бұрын
This is cool and all, but it seems that around every corner in this SDK (especially with the rsc stuff) all the types are just 'any'. In my opinion, you can't really call your library "The AI Framework for TypeScript" and then not have strong types. This is especially annoying because in my eyes it defeats one of the major benefits of server actions: end-to-end type safety. Is there a way to bypass some of the abstractions, like the useActions hook?
@0xOmzi
@0xOmzi 4 ай бұрын
Thanks for this great video! Looking forward to trying my hands out on the latest release! Kudos to the Vercel AI team too!
@usagisan79
@usagisan79 4 ай бұрын
ilove ai sdk and kirimase both!
@asimalqasmi7316
@asimalqasmi7316 4 ай бұрын
Let me recall the kirimase dream I had
@BhagawanNityanandaOfGaneshpuri
@BhagawanNityanandaOfGaneshpuri 4 ай бұрын
Thank you guys!
@jrmumm
@jrmumm 3 ай бұрын
how does it stream a structured object? doesn't the stream come back as JSON? how can it parse it if it's not fully complete?
@fezkhanna6900
@fezkhanna6900 2 ай бұрын
fantastic!
@daniloitj
@daniloitj 3 ай бұрын
Very good explanation. If possible, could you connect streamUI with assistants? I also had a lot of difficulty separating the tools into other files.
@郭伽政
@郭伽政 2 ай бұрын
For example, a Ai has a getWeather tool The context of the conversation achieves the following effects: user: hello ai: Hello! How can I assist you today? user: How's the weather today? tool: getWeather("local") tool_result: {“weather”:"sunny","maxTemperature":35,"minTemperature":0} ai: The weather is good today, but the temperature difference is a bit large, so please keep warm. I hope that on the client page, users can see in sequence: Ai wants to use the getWeather tool, the call result of the getWeather tool, and Ai's answer based on the call result. How can I achieve this?
@simpingsyndrome
@simpingsyndrome 4 ай бұрын
will it work for React Native?, i wanna build my ai chatbot mobile app.
@jeanysergeimezarodriguez8629
@jeanysergeimezarodriguez8629 4 ай бұрын
i have the same question hehe
@jrmumm
@jrmumm 3 ай бұрын
when you stream an object, you get a partial. how do you get the final/full response (not partial)?
@xberna8156
@xberna8156 4 ай бұрын
I could not find an example in the Docs where the model can use Tools and return RSC while also being able to Stream a response when no Tool is used. All the example I could find use generateText() or streamUi() so the text response Is not a Stream. Should I use a combination of streamText() + Tools + createStreamableUi() to Stream text and have Tools that can return RSC?
@hakarsheikh7853
@hakarsheikh7853 4 ай бұрын
Great question im interested to know too
@nicoalbanese10
@nicoalbanese10 3 ай бұрын
Hey! With `streamUI`, if no tool is used, the text response is streamed via the component returned from the `text` function. Is that what you're looking to do?
@xberna8156
@xberna8156 3 ай бұрын
@@nicoalbanese10 Yes, that's correct. I would like to stream the text token by token when the model does not use a tool. Can I achieve that using streamUI?
@raphauy
@raphauy 4 ай бұрын
Awesome!
@Samuelsward96
@Samuelsward96 3 ай бұрын
Hey i'm struggling a bit with the useChat for multiple conversations. How can i keep multiple conversations active at once? Any tips?
@rhyscampbell4178
@rhyscampbell4178 3 ай бұрын
NICO!!!!!
@mymorningjacket_
@mymorningjacket_ 4 ай бұрын
Anyone have a great example on how to get the user's actual location here?
@nicoalbanese10
@nicoalbanese10 3 ай бұрын
You can run any asynchronous javascript code within a tools' execute function. So you would first want to find the exact location based on the search query (eg. openstreetmap). Then pass that to a weather api (eg. open-meteo) and return the resulting temperature 😊
@mymorningjacket_
@mymorningjacket_ 3 ай бұрын
@@nicoalbanese10 thanks for the suggestion, nico!
@andru5054
@andru5054 3 ай бұрын
Hey, awesome demo - thanks. We're using llamaindex in Python for our LLM backend that uses RAG. I want to use tools that pass react components to the frontend - how would I accomplish this? Thank you
@ShaneCrenshaw
@ShaneCrenshaw 3 ай бұрын
Is there an example with streamUI and error handling for things like finishReason and usage?
@GAllium14
@GAllium14 3 ай бұрын
Vercel ai sdk + RAG tutorial
@remiib18
@remiib18 4 ай бұрын
Is it still not possible to use both the regular tools to fetch data and the tools to return components ?
@yarapolana
@yarapolana 4 ай бұрын
I added $10 to test open ai and ai sdk and I had 100% of “unknown error” calls and $8 used?! What in the world it wasnt like this before. Loads of retries in the background (should be opted out from the start)
@RoccoGhielmini
@RoccoGhielmini 4 ай бұрын
I can't concentrate because they keep saying next
@nicoalbanese10
@nicoalbanese10 3 ай бұрын
Sorry about that, will work on it for the next one!
@journeyofc6200
@journeyofc6200 4 ай бұрын
dope!!
3 ай бұрын
Someone knows how to Improve the response using the API of openAI? Seems like the chat-gtp web app the results are a lot better. Using the API returns very similar responses, in this case, asking "tell me a joke" answer the same thing over and over again. Another great API btw
@Jake-bh1hm
@Jake-bh1hm 4 ай бұрын
is this compatible with sveltekit 5?
@mustofa_id
@mustofa_id 4 ай бұрын
yes
@maharshiguin7813
@maharshiguin7813 4 ай бұрын
New version of ai package has too much abstractions
@wshewm
@wshewm 4 ай бұрын
Agreed. It destroys the type-safety, especially with RSC and the useActions hook.
@LutherDePapier
@LutherDePapier 4 ай бұрын
Where's Lee?
@leerob
@leerob 4 ай бұрын
I'm here :)
@ShouryanNikam
@ShouryanNikam 4 ай бұрын
how do you make the code animations?
@dawidwraga
@dawidwraga 4 ай бұрын
I'm just gonna leave a comment here so I'm notified if someone responds 👀
@mishal_legit
@mishal_legit 4 ай бұрын
.
@ahmoin
@ahmoin 4 ай бұрын
/free
@rude_people_die_young
@rude_people_die_young 4 ай бұрын
Great use of zod ❤
@zivtamary
@zivtamary 4 ай бұрын
+1
@andreschou9560
@andreschou9560 4 ай бұрын
sick
@smitty7326
@smitty7326 3 ай бұрын
god i wish i knew about vercel ai like 6 months ago lol
@imDeeva
@imDeeva 2 ай бұрын
No need to add any openAi api key?
@FelixWaigner
@FelixWaigner 4 ай бұрын
When will i be able to use this with langchain?
@JeomonGeorge
@JeomonGeorge 3 ай бұрын
can I use ai vercel in vue.js
@aneesmanzoor7340
@aneesmanzoor7340 4 ай бұрын
how to create these coding videos with animations like this kindly create a video on that as well @vercel
@nenadbanjeglav2081
@nenadbanjeglav2081 4 ай бұрын
Can I use this in next.js out of the box?
@rutvijdoshi9664
@rutvijdoshi9664 3 ай бұрын
Can we fine tune this model ?
@JustOmmShah
@JustOmmShah 4 ай бұрын
Where do you keep the API Key?
@malaytiwari3207
@malaytiwari3207 3 ай бұрын
How do I pass the API key?
@Nick__X
@Nick__X Ай бұрын
Just add it to the env vars the lib will do the rest
@yogeshrathod953
@yogeshrathod953 4 ай бұрын
Can it work with ollama
@AtomicPixels
@AtomicPixels 4 ай бұрын
Ugh I hate using gpt. Why isn’t anyone doing Gemini especially since it’s in free beta
@CarlottaRiganti
@CarlottaRiganti 4 ай бұрын
But how do you npm?
@The_kids-c2j
@The_kids-c2j 4 ай бұрын
I made 8 subscribers 😊
@andriisukhariev
@andriisukhariev 4 ай бұрын
train without stops
@karamanabdullah
@karamanabdullah 4 ай бұрын
is it free?
@mohammednasser2159
@mohammednasser2159 4 ай бұрын
It's just a library, using it is free, however using the models, Like Gemini and GPT4o requires a token, which will almost always cost money
@karamanabdullah
@karamanabdullah 4 ай бұрын
@@mohammednasser2159 thank you
@leerob
@leerob 4 ай бұрын
@@mohammednasser2159 thank you! Yes exactly.
@sanukjoseph
@sanukjoseph 4 ай бұрын
🤩❣...
@jasonjefferson6596
@jasonjefferson6596 3 ай бұрын
Is this a real human or synthetic?
@slavalu74
@slavalu74 3 ай бұрын
looks like a bio robot for me
@slavalu74
@slavalu74 3 ай бұрын
As always by Next over engineered and over complicated. We just need 4 functions. streamUI, receiveUI, streamText, receiveText. Everything else much easier to do without your helper functions.
@Archibong.samuel
@Archibong.samuel 2 ай бұрын
I wish I could be part of nextjs team. This is insane 😩 why am I just seeing this? Thanks @team_nextjs
AI SDK 3.1 First Impressions
24:12
Ben Davis
Рет қаралды 7 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 213 М.
OYUNCAK MİKROFON İLE TRAFİK LAMBASINI DEĞİŞTİRDİ 😱
00:17
Melih Taşçı
Рет қаралды 9 МЛН
Build anything with v0 (3D games, interactive apps)
9:05
Vercel
Рет қаралды 90 М.
Bringing React Components to AI
12:41
Vercel
Рет қаралды 40 М.
Vercel v0 vs Claude Sonnet - Product Hunt
8:09
Product Hunt
Рет қаралды 3,2 М.
Building Generative UI with Next.js (Jared Palmer)
13:16
Vercel
Рет қаралды 11 М.
Cursor + V0: Can We Build An AI Next.js App in 8 Minutes?
8:40
Developers Digest
Рет қаралды 35 М.
JavaScript Visualized - Event Loop, Web APIs, (Micro)task Queue
12:35
GPT-4 Vision and Next.js Tutorial - Create Your Own AI Coding Bot
30:10
Chatbot from scratch with Next, AI SDK, OpenAI, and Shadcn/UI
36:08