useChat
A composable API provided by the Vercel AI SDK in its Vue adapter package, used to implement conversational AI interfaces within Vue components. It internally maintains reactive variables such as the message list and loading state.
Core Facts
@ai-sdk/provider-utils is responsible for the general-purpose utility functions in the AI SDK for interacting with model providers, including low-level logic such as streaming response parsing, tool call formatting, and error handling.
The core composables useChat and useCompletion in @ai-sdk/vue are designed following the React version's useChat hook to ensure cross-framework API consistency.
useChat is designed for multi-turn conversation scenarios and maintains a message history list, while useCompletion is suited for single-pass text completion scenarios; both expose an error state field.
Timeline (last 90 days)
Composables are the core organizing approach of the Vue 3 Composition API and are usually named starting with use, for example useChat.
Both useChat and useCompletion encapsulate the parsing and incremental rendering logic of SSE (Server-Sent Events) streams, so fixes to the stream parser or message state machine in the core ai package directly change the runtime behavior of these composables while their function signatures remain unchanged.
useChat manages multi-turn conversations, maintains the message list, sends requests, receives streaming responses chunk by chunk and triggers view updates, while exposing reactive state such as messages, input, handleSubmit, and isLoading.
useChat and useCompletion are composables (Composables) that the AI SDK provides for Vue, implemented on top of Vue 3's reactivity system.
AI application development in the Svelte ecosystem typically relies on utilities such as useChat provided by the AI SDK to manage conversation state and streaming rendering.
In patch versions the public signature of useChat usually remains stable; the upgrade risk mainly comes from changes in the core package's internal message chunk format or error object structure (such as field renaming causing the onError callback parameter shape to change).
The useChat Hook is responsible for maintaining the message list, initiating requests, and incrementally appending the streaming tokens returned by the server to the UI; internally it relies on the core package to complete SSE/Data Stream protocol parsing, chunk boundary handling, and tool-call argument stream assembly and result backfilling.
Patches to the ai core package typically involve fixes to low-level logic such as streaming response handling, tool-call parsing, and message serialization, and affect the runtime behavior of Hooks such as useChat and useCompletion on the React side.
@ai-sdk/vue 4.0.168 adds an experimental_queue capability to the useChat hook, for queuing messages sent by the user while a response is still in progress.
useChat is the core composable function that the AI SDK provides for frontend frameworks (in the form of a hook/composable in Vue); it internally maintains a reactive message array and sends user input over a streaming HTTP interface, parsing the returned token stream chunk by chunk and appending it to the message list.
37 more timeline events
All Facts (20)
@ai-sdk/provider-utils is responsible for the general-purpose utility functions in the AI SDK for interacting with model providers, including low-level logic such as streaming response parsing, tool call formatting, and error handling.
90%VerifiedThe core composables useChat and useCompletion in @ai-sdk/vue are designed following the React version's useChat hook to ensure cross-framework API consistency.
90%VerifieduseChat is designed for multi-turn conversation scenarios and maintains a message history list, while useCompletion is suited for single-pass text completion scenarios; both expose an error state field.
90%Verified@ai-sdk/vue provides composable functions such as useChat and useCompletion, enabling Vue developers to integrate AI capabilities at minimal cost.
90%Verified@ai-sdk/vue provides Composables for streaming response handling, chat state management, message queuing, and more.
85%Verified@ai-sdk/vue provides composable functions such as useChat and useCompletion for Vue development.
85%Verified@ai-sdk/vue encapsulates SDK capabilities as Composition API hooks that conform to Vue's usage conventions, providing hooks such as useChat and useCompletion.
80%Verified@ai-sdk/vue provides composable functions (Composables) such as useChat and useCompletion, which encapsulate connection management with the AI backend, streaming token reception, and message history maintenance.
80%Verified@ai-sdk/vue provides developers with capabilities such as streaming conversation, tool calling, and structured output in the form of composables (e.g., useChat, useCompletion).
75%VerifiedThe core capabilities of @ai-sdk/vue are exposed in the form of Vue Composables, such as hooks like useChat and useCompletion, which are functionally symmetric with @ai-sdk/react.
75%Verified@ai-sdk/react is the official adapter package for the React ecosystem, encapsulating Hooks such as useChat and useCompletion.
75%Verified@ai-sdk/vue provides composables such as useChat and useCompletion for integrating AI capabilities within the Vue ecosystem.
75%UnverifieduseChat and useCompletion are the two core composable APIs provided by @ai-sdk/vue.
70%UnverifiedBoth useChat and useCompletion implement streaming output based on the Web Streams API.
70%UnverifiedComposables are the core organizing approach of the Vue 3 Composition API and are usually named starting with use, for example useChat.
50%UnverifieduseChat manages multi-turn conversations, maintains the message list, sends requests, receives streaming responses chunk by chunk and triggers view updates, while exposing reactive state such as messages, input, handleSubmit, and isLoading.
50%UnverifieduseChat and useCompletion are composables (Composables) that the AI SDK provides for Vue, implemented on top of Vue 3's reactivity system.
50%UnverifiedBoth useChat and useCompletion encapsulate the parsing and incremental rendering logic of SSE (Server-Sent Events) streams, so fixes to the stream parser or message state machine in the core ai package directly change the runtime behavior of these composables while their function signatures remain unchanged.
50%UnverifiedAI application development in the Svelte ecosystem typically relies on utilities such as useChat provided by the AI SDK to manage conversation state and streaming rendering.
50%UnverifiedIn patch versions the public signature of useChat usually remains stable; the upgrade risk mainly comes from changes in the core package's internal message chunk format or error object structure (such as field renaming causing the onError callback parameter shape to change).
50%