AI SDK by Vercel
useAssistant Hook Integration
Overview
Integration with the Vercel AI SDK UI's useAssistant
hook.
This allows interaction with the OpenAI Assistants API.
Getting Started
Setup a backend route under /api/assistant
/app/api/assistant/route.ts
Define a MyRuntimeProvider
component
@/app/MyRuntimeProvider.tsx
Wrap your app in MyRuntimeProvider
@/app/layout.tsx
Accessing AI SDK Messages
You can use getExternalStoreMessages
utility to convert ThreadMessage
s back to Message
s from AI SDK.