Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Development

tanstack-ai-vue-skilld

Vue hooks for TanStack AI. ALWAYS use when writing code importing \"@tanstack/ai-vue\". Consult for debugging, best practices, or modifying @tanstack/ai-vue, tanstack/ai-vue, tanstack ai-vue, tanstack ai vue, ai.

skilld-dev · AI review on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add skilld-dev/vue-ecosystem-skills --skill tanstack-ai-vue-skilld

About this skill


name: tanstack-ai-vue-skilld description: "Vue hooks for TanStack AI. ALWAYS use when writing code importing "@tanstack/ai-vue". Consult for debugging, best practices, or modifying @tanstack/ai-vue, tanstack/ai-vue, tanstack ai-vue, tanstack ai vue, ai." metadata: version: 0.7.0 generated_at: 2026-04-25 references_synced_at: 2026-04-25

TanStack/ai @tanstack/ai-vue@0.7.0

Tags: latest: 0.7.0

References: Docs

API Changes

This section documents version-specific API changes for @tanstack/ai-vue v0.6.1 (current v0.x series). This library is pre-1.0 — all v0.x releases are in scope.

  • BREAKING: Monolithic adapter factories removed — openai(), anthropic(), etc. replaced by activity-specific functions: openaiText('gpt-5.2'), openaiSummarize('gpt-5-mini'), openaiImage('dall-e-3'), etc. Model name is now passed to the adapter factory, not to chat(). source

  • BREAKING: model parameter removed from chat() — model is now embedded in the adapter argument (e.g., adapter: openaiText('gpt-5.2') instead of adapter: openai(), model: 'gpt-4'). Passing model at the call site is silently ignored. source

  • BREAKING: Nested options object flattened — chat({ options: { temperature, maxTokens, topP } }) must be changed to chat({ temperature, maxTokens, topP }). Nested options are silently discarded. source

  • BREAKING: providerOptions renamed to modelOptions — chat({ providerOptions: { ... } }) must be updated to chat({ modelOptions: { ... } }). Silently ignored if not updated. source

  • BREAKING: toResponseStream renamed to toServerSentEventsStream and now returns ReadableStream instead of Response — must manually create new Response(stream, { headers }). AbortController is now a separate parameter: toServerSentEventsStream(stream, abortController). source

  • BREAKING: embedding() function removed — embeddings support eliminated entirely. Use provider SDKs directly or vector DB native embedding APIs. source

  • BREAKING: chat({ as: 'promise' }) replaced by separate chatCompletion() function — as option removed from chat(). chat({ as: 'stream' }) is now just chat(). chat({ as: 'response' }) is now chat() + toServerSentEventsStream(). source

  • NEW: useChat returns status reactive ref — tracks lifecycle as 'ready' | 'submitted' | 'streaming' | 'error'. Previously there was no generation lifecycle state. source

  • NEW: sendMessage() accepts MultimodalContent object — sendMessage({ content: [{ type: 'text', content: '...' }, { type: 'image', source: { type: 'url', value: '...' } }] }) enables image/audio/video/document content alongside text. Added in v0.5.0. source

  • NEW: agentLoopStrategy parameter replaces bare maxIterations: number — use agentLoopStrategy: maxIterations(5), untilFinishReason(['stop']), or combineStrategies([...]). Old maxIterations number is converted automatically but deprecated. source

  • NEW: toolDefinition({ name, description, inputSchema, outputSchema?, needsApproval? }) — creates isomorphic tool definitions. Call .server(fn) for server-side execution or .client(fn) for client-side execution. Replaces ad-hoc tool objects. source

  • NEW: @tanstack/ai-client package — ChatClient class provides framework-agnostic headless chat state management with sendMessage(), reload(), stop(), clear(), addToolResult(), addToolApprovalResponse() methods. source

  • NEW: Connection adapter factories — fetchServerSentEvents(url, options?), fetchHttpStream(url, options?), stream(fn) from @tanstack/ai-client. Pass to useChat({ connection: fetchServerSentEvents('/api/chat') }) instead of url: '/api/chat'. source

  • NEW: extendAdapter(factory, customModels) + createModel(name, modalities) — adds custom/fine-tuned model names to existing adapter factories with full type inference. Avoids as const casts. source

Also changed: clientTools(...tools) NEW (typed tool array, discriminated union narrowing) · createChatClientOptions(options) NEW · InferChatMessages<T> NEW · toServerSentEventsResponse(stream, init?) NEW (returns Response) · toHttpStream(stream) NEW · toHttpResponse(stream) NEW · assertMessages({ adapter }, messages) NEW (type-level assertion) · ThinkingStreamChunk NEW (chunk type for model reasoning)

Best Practices

  • useChat returns DeepReadonly<ShallowRef<T>> refs — never reassign messages directly; use setMessages() for manual updates. Changing connection or body options recreates the underlying ChatClient, requiring a component remount or a key prop change to take effect

  • Use status (added v0.4.0) instead of isLoading for granular lifecycle control — status.value tracks 'ready' | 'submitted' | 'streaming' | 'error', enabling distinct UI states for submission vs. active streaming source

  • Pass client tool arrays through clientTools() instead of as const — eliminates the need for const assertion while enabling full discriminated union narrowing on part.name, part.input, and part.output in message iteration source

  • Wrap useChat options with createChatClientOptions() and derive message types usin

Read the complete source ↗