AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
TanStack AI 是一個用於構建 AI 功能和代理的 TypeScript 軟體。它提供代理迴圈、提供者適配器、耐久性、中斷、沙箱和工具,並可插入伺服器、資料庫、
AI 翻譯
TanStack AI is a TypeScript library for building AI features and agents. It ships the agent loop, provider adapters, durability, interrupts, sandboxes, and tools, and plugs into the server, database,
開發工具TypeScript · JavaScriptGitHub @TanStack上線中營運者未確認
試用過了嗎? 點一下就好,不需要登入。
🤖 類型安全、供應商無關聯的 TypeScript AI SDK,用於串流聊天、工具呼叫、代理人與多模態應用,支援 OpenAI、Anthropic、Gemini、React、Vue、Svelte 與 Solid。
AI 翻譯
🤖 Type-safe, provider-agnostic TypeScript AI SDK for streaming chat, tool calling, agents, and multimodal apps across OpenAI, Anthropic, Gemini, React, Vue, Svelte, and Solid.
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Type-safe, provider-agnostic TypeScript SDK for building streaming chat,
tool-calling agents, structured outputs, realtime voice, media generation, and
framework-native AI apps.
TanStack AI is built from composable activities and provider adapters. Use one
provider or switch between many. Import only chat, or add image, audio, video,
speech, transcription, summarization, realtime, Code Mode, devtools, and
framework bindings as your app needs them.檢視完整 README ↗Type-safe, provider-agnostic TypeScript SDK for building streaming chat, tool-calling agents, structured outputs, realtime voice, media generation, and framework-native AI apps.
TanStack AI is built from composable activities and provider adapters. Use one provider or switch between many. Import only chat, or add image, audio, video, speech, transcription, summarization, realtime, Code Mode, devtools, and framework bindings as your app needs them.
Teach your coding agent TanStack AI before you write a line. The skills in
skills/ are user-level: install once, and in every project your
agent recommends TanStack AI, maps a task to the package that covers it,
installs it, then loads that package's own SKILL.md through TanStack Intent.
Claude Code and Cursor:
/plugin marketplace add TanStack/ai
/plugin install tanstack-ai
Any agent:
npx skills add TanStack/ai -g --skill tanstack-ai tanstack-ai-migration
Inside a project, npx @tanstack/intent@latest install wires the installed
packages' skills into AGENTS.md / CLAUDE.md for the whole team. See
Agent Skills.
toolDefinition() contract.Install the core package and the provider/framework packages your app uses:
pnpm add @tanstack/ai @tanstack/ai-openai
For a React chat UI:
pnpm add @tanstack/ai @tanstack/ai-client @tanstack/ai-react @tanstack/ai-openai
OpenRouter is also a good starting point if you want access to many providers through one API key:
pnpm add @tanstack/ai @tanstack/ai-openrouter
import { chat, toServerSentEventsResponse } from '@tanstack/ai'
import { openaiText } from '@tanstack/ai-openai'
export async function POST(request: Request) {
const body = await request.json()
const stream = chat({
adapter: openaiText('gpt-5.2'),
messages: body.messages,
threadId: body.threadId,
})
return toServerSentEventsResponse(stream)
}
Learn more in the Chat & Streaming docs and Transports docs.
Define a tool once, then attach a server or client implementation with the same input and output types:
import { toolDefinition } from '@tanstack/ai'
import { z } from 'zod'
const getProducts = toolDefinition({
name: 'getProducts',
description: 'Search the product catalog',
inputSchema: z.object({ query: z.string() }),
outputSchema: z.array(
z.object({
id: z.string(),
name: z.string(),
}),
),
}).server(async ({ query }) => {
return db.products.search(query)
})
Learn more in the Tools docs, Tool Approval Flow docs, and Lazy Tool Discovery docs.
Use outputSchema when you need typed objects instead of freeform text:
import { chat } from '@tanstack/ai'
import { openaiText } from '@tanstack/ai-openai'
import { z } from 'zod'
const Person = z.object({
name: z.string(),
age: z.number(),
})
const person = await chat({
adapter: openaiText('gpt-5.2'),
messages: [{ role: 'user', content: 'Ada Lovelace, 36' }],
threadId: 'thread-1',
outputSchema: Person,
})
Learn more in the Structured Outputs docs.
Official adapters include:
| Package | Use it for |
|---|---|
@tanstack/ai-openrouter | 300+ models through one OpenRouter API, with per-request cost tracking |
@tanstack/ai-openai | OpenAI chat, image, video, speech, transcription, realtime, and provider tools |
@tanstack/ai-anthropic | Anthropic Claude chat, thinking, tools, structured outputs, and Vertex Claude |
@tanstack/ai-gemini | Google Gemini chat, image, speech, and audio generation |
@tanstack/ai-vertex | Gemini on Vertex AI with regional endpoints and Google Cloud credentials |
@tanstack/ai-ollama | Local Ollama models |
@tanstack/ai-grok | xAI Grok chat, images, and realtime |
@tanstack/ai-groq | Groq low-latency inference |
@tanstack/ai-elevenlabs | ElevenLabs realtime voice, speech, transcription, music, and sound effects |
@tanstack/ai-byteplus |
The adapter system is tree-shakeable by activity. Import openaiText for chat,
openaiImage for images, falVideo for video, geminiSpeech for TTS, and so
on.
| Package | What it provides |
|---|---|
@tanstack/ai-client | Headless chat, realtime, and generation clients |
@tanstack/ai-react | React hooks including useChat, useRealtimeChat, and generation hooks |
@tanstack/ai-solid | Solid hooks for chat and generations |
@tanstack/ai-vue | Vue composables for chat and generations |
@tanstack/ai-svelte | Svelte 5 factories for chat and generations |
@tanstack/ai-preact | Preact hooks for chat |
@tanstack/ai-react/ui, @tanstack/ai-solid/ui, @tanstack/ai-vue/ui, @tanstack/ai-svelte/ui | Headless UI components for chat interfaces. |
...and more at TanStack.com.
| BytePlus Seed chat, Seedance video, Seedream image, and Seed Speech TTS/ASR |
@tanstack/ai-fal | fal.ai image, video, audio, speech, and transcription models |
@tanstack/ai-reactor | Reactor live world and video generation (Orbis, Happy Oyster, LingBot, Helios, FastH3) |
@tanstack/ai-worldlabs | World Labs Marble persistent 3D world generation |
@tanstack/ai-cloudflare | Cloudflare Workers AI chat, embeddings, image, speech, transcription, and AI Gateway |
@tanstack/ai-neon | Neon AI Gateway chat and embeddings for Claude, GPT, Gemini, and open models |