AI SDK UI
AI SDK UI is designed to help you build interactive chat, completion, and assistant applications with ease. It is framework-agnostic toolkit, streamlining the integration of advanced AI functionalities into your applications.
AI SDK UI contains the following hooks:
useChat
Use a hook to interact with language models in a chat interface.
useCompletion
Use a hook to interact with language models in a completion interface.
useObject
Use a hook for consuming a streamed JSON objects.
convertToModelMessages
Convert useChat messages to ModelMessages for AI functions.
appendResponseMessages
Append ModelMessage[] from an AI response to an existing array of UI messages.
appendClientMessage
Append a client message to an existing array of UI messages.
createDataStream
Create a data stream to stream additional data to the client.
createDataStreamResponse
Create a response object to stream additional data to the client.
pipeDataStreamToResponse
Pipe a data stream to a Node.js ServerResponse object.
streamData
Stream additional data to the client along with generations.
UI Framework Support
AI SDK UI supports the following frameworks: React, Svelte, and Vue.js. Here is a comparison of the supported functions across these frameworks:
Function | React | Svelte | Vue.js |
---|---|---|---|
useChat | Chat | ||
useCompletion | Completion | ||
useObject | StructuredObject |
Contributions are welcome to implement missing features for non-React frameworks.