Ai apiQuestion answer mode
Using `inkeep-qa` models with the Vercel AI SDK
Using useChat and a route
useChat
is cross-platform hook that helps you create a conversational experience with the Vercel AI SDK with React, Svelte, Vue, and Solid frontends.
To use useChat, first create an API route using Next.js. Here's where we'll call Inkeep.
API Route
Client
Using Server Actions (AI SDK Actions)
streamUI
is another way to use the Vercel AI SDK, but with React Server Components. This lets you stream entire UI components, not just the text that is then parsed and rendered on the client.
This example illustrates how to render assistant messages and a "sources" list provided by the provideLinks
tool.