Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9c68bcc
feat(ai-openrouter): upgrade openrouter SDK to 0.12.14, add builtin s…
tombeckenham Apr 17, 2026
2d1fd08
docs: add agent-skills guide and SEO frontmatter (#464)
AlemTuzlak Apr 17, 2026
609567b
ci: Version Packages (#455)
github-actions[bot] Apr 18, 2026
7d79347
docs: regenerate API documentation (#470)
github-actions[bot] Apr 19, 2026
b8dbb2d
fix(ai-ollama): forward systemPrompts to Ollama API (#389)
Spiralis Apr 19, 2026
0020150
chore: sync model metadata from OpenRouter (#461)
github-actions[bot] Apr 19, 2026
c992ce0
ci: Version Packages (#471)
github-actions[bot] Apr 19, 2026
b7effe0
chore: sync model metadata from OpenRouter (#472)
github-actions[bot] Apr 20, 2026
243ae32
ci: Version Packages (#473)
github-actions[bot] Apr 20, 2026
91ec205
feat: AG-UI core interop - spec-compliant event types (#411)
AlemTuzlak Apr 20, 2026
12d43e5
chore: add retroactive changesets for PR #411 (AG-UI core interop) (#…
AlemTuzlak Apr 20, 2026
1d6f3be
fix(ai-client): add @standard-schema/spec to devDependencies (#428)
AlemTuzlak Apr 20, 2026
7e02c60
chore: downgrade @tanstack/ai AG-UI interop changeset to minor (#476)
AlemTuzlak Apr 20, 2026
4214392
ci: Version Packages (#475)
github-actions[bot] Apr 20, 2026
6f21061
docs: regenerate API documentation (#479)
github-actions[bot] Apr 20, 2026
3681c9e
Create migration guide from AI SDK to TanStack (#179)
tannerlinsley Apr 20, 2026
633a3d9
fix(ai): nullable wrap for optional nested objects/arrays in strict s…
tombeckenham Apr 21, 2026
14830d6
chore: sync model metadata from OpenRouter (#488)
github-actions[bot] Apr 21, 2026
d02950a
ci: Version Packages (#489)
github-actions[bot] Apr 21, 2026
e32583e
feat: Provider tools on /tools subpath with per-model type gating (#466)
AlemTuzlak Apr 21, 2026
3dcc474
ci: Version Packages (#491)
github-actions[bot] Apr 21, 2026
b033ef1
docs: regenerate API documentation (#492)
github-actions[bot] Apr 22, 2026
19d09f5
docs: regenerate API documentation (#490)
github-actions[bot] Apr 22, 2026
c1fd96f
feat(ai): debug logging system across all activities and adapters (#467)
AlemTuzlak Apr 22, 2026
2d21ac2
ci: Version Packages (#493)
github-actions[bot] Apr 22, 2026
e33ee09
docs: regenerate API documentation (#494)
github-actions[bot] Apr 23, 2026
54523f5
feat: audio media support β€” fal audio/speech/STT adapters, Gemini Lyr…
tombeckenham Apr 23, 2026
dc71c72
feat(examples): add AI-powered search example (#114)
denis-shvets Apr 23, 2026
008f015
fix(ai-client): prevent drainPostStreamActions re-entrancy race condi…
AlemTuzlak Apr 24, 2026
af9eb7b
Audit remediation: tests, isolate hardening, framework fixes, error h…
AlemTuzlak Apr 24, 2026
2e4c942
feat(ai-grok): audio, speech, and realtime adapters + example wiring …
tombeckenham Apr 24, 2026
af19dcc
ci: Version Packages (#498)
github-actions[bot] Apr 24, 2026
ff33855
docs: regenerate API documentation (#507)
github-actions[bot] Apr 24, 2026
7dc2c0f
feat(ai-client): support TanStack Start server functions in stream() …
claude Apr 26, 2026
61cd08e
docs(ts-react-chat): add server function chat example
claude Apr 26, 2026
c4961b1
docs(ai-client): reframe stream() server-function description
tombeckenham Apr 27, 2026
64bd41d
Merge remote-tracking branch 'upstream/main' into claude/add-usechat-…
tombeckenham Apr 27, 2026
fdbd45a
ci: apply automated fixes
autofix-ci[bot] Apr 27, 2026
ca99cc9
fix: revert ai-fal package to upstream state
tombeckenham Apr 27, 2026
e0d0b9c
fix(ai-client): use EventType enum in server-function stream tests
tombeckenham Apr 27, 2026
67458d8
fix(ai-client): drop unsafe casts, surface SSE parse errors, forward …
tombeckenham Apr 27, 2026
297085f
fix(ai-client): filter SSE non-payload fields and drop unterminated t…
tombeckenham Apr 27, 2026
cb39b84
feat(ai-client,ai): narrow stream() callback to UIMessage[] and accep…
tombeckenham Apr 28, 2026
e773e88
revert(ai): drop chat() messages type widening from this PR
tombeckenham Apr 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 0 additions & 10 deletions .changeset/fix-null-tool-input-normalization.md

This file was deleted.

25 changes: 25 additions & 0 deletions .changeset/stream-adapter-server-functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
'@tanstack/ai-client': minor
---

feat(ai-client): support TanStack Start server functions in `stream()` connection adapter

The `stream()` factory now accepts any of three return shapes, so a TanStack Start server function can be wired directly into `useChat`:

- `AsyncIterable<StreamChunk>` β€” direct in-process stream (existing behavior)
- `Promise<AsyncIterable<StreamChunk>>` β€” server function returning the chat stream
- `Promise<Response>` β€” server function returning `toServerSentEventsResponse(stream)`

`rpcStream()` likewise accepts a `Promise<AsyncIterable<StreamChunk>>`.

```ts
const chatFn = createServerFn({ method: 'POST' })
.inputValidator((data: { messages: Array<UIMessage> }) => data)
.handler(({ data }) =>
toServerSentEventsResponse(chat({ adapter, messages: data.messages })),
)

useChat({ connection: stream((messages) => chatFn({ data: { messages } })) })
```

The `stream()` callback's `messages` parameter is now typed as `Array<UIMessage>` (was `Array<UIMessage> | Array<ModelMessage>`) β€” matching what `useChat`/`ChatClient` actually sends. A runtime assertion guards against misuse. Existing callbacks typed against the union remain assignable (wider declared input satisfies narrower expected input).
5 changes: 0 additions & 5 deletions .changeset/sync-models.md

This file was deleted.

204 changes: 204 additions & 0 deletions docs/adapters/anthropic.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
title: Anthropic
id: anthropic-adapter
order: 2
description: "Use Anthropic Claude models with TanStack AI β€” Claude Sonnet 4.5, Claude Opus, and more via the @tanstack/ai-anthropic adapter."
keywords:
- tanstack ai
- anthropic
- claude
- claude sonnet 4.5
- claude opus
- adapter
- llm
---

The Anthropic adapter provides access to Claude models, including Claude Sonnet 4.5, Claude Opus 4.5, and more.
Expand Down Expand Up @@ -228,3 +237,198 @@ Creates an Anthropic summarization adapter with an explicit API key.
- [Getting Started](../getting-started/quick-start) - Learn the basics
- [Tools Guide](../tools/tools) - Learn about tools
- [Other Adapters](./openai) - Explore other providers

## Provider Tools

Anthropic exposes several native tools beyond user-defined function calls.
Import them from `@tanstack/ai-anthropic/tools` and pass them into
`chat({ tools: [...] })`.

> For the full concept, a comparison matrix, and type-gating details, see
> [Provider Tools](../tools/provider-tools.md).

### `webSearchTool`

Enables Claude to run Anthropic's native web search with inline citations.
Scope the search with `allowed_domains` or `blocked_domains` (mutually
exclusive); set `max_uses` to cap per-turn cost.

```typescript
import { chat } from "@tanstack/ai";
import { anthropicText } from "@tanstack/ai-anthropic";
import { webSearchTool } from "@tanstack/ai-anthropic/tools";

const stream = chat({
adapter: anthropicText("claude-opus-4-6"),
messages: [{ role: "user", content: "What's new in AI this week?" }],
tools: [
webSearchTool({
name: "web_search",
type: "web_search_20250305",
max_uses: 2,
}),
],
});
```

**Supported models:** every current Claude model. `claude-3-haiku` supports
only `web_search` (not `web_fetch`). See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).

### `webFetchTool`

Lets Claude fetch the contents of a URL directly, useful when you want the
model to read a specific page rather than run a search. Takes no required
arguments β€” pass an optional config object to override defaults.

```typescript
import { chat } from "@tanstack/ai";
import { anthropicText } from "@tanstack/ai-anthropic";
import { webFetchTool } from "@tanstack/ai-anthropic/tools";

const stream = chat({
adapter: anthropicText("claude-sonnet-4-5"),
messages: [{ role: "user", content: "Summarise https://example.com" }],
tools: [webFetchTool()],
});
```

**Supported models:** Claude Sonnet 4.x and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).

### `codeExecutionTool`

Gives Claude a sandboxed code-execution environment so it can run Python
snippets, analyse data, and return results inline. Choose the version string
that matches your desired API revision.

```typescript
import { chat } from "@tanstack/ai";
import { anthropicText } from "@tanstack/ai-anthropic";
import { codeExecutionTool } from "@tanstack/ai-anthropic/tools";

const stream = chat({
adapter: anthropicText("claude-sonnet-4-5"),
messages: [{ role: "user", content: "Plot a histogram of [1,2,2,3,3,3]" }],
tools: [
codeExecutionTool({ name: "code_execution", type: "code_execution_20250825" }),
],
});
```

**Supported models:** Claude Sonnet 4.x and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).

### `computerUseTool`

Allows Claude to observe a virtual desktop (screenshots) and interact with it
via keyboard and mouse events. Provide the screen resolution so Claude can
calculate accurate coordinates.

```typescript
import { chat } from "@tanstack/ai";
import { anthropicText } from "@tanstack/ai-anthropic";
import { computerUseTool } from "@tanstack/ai-anthropic/tools";

const stream = chat({
adapter: anthropicText("claude-sonnet-4-5"),
messages: [{ role: "user", content: "Open the browser and go to example.com" }],
tools: [
computerUseTool({
type: "computer_20250124",
name: "computer",
display_width_px: 1024,
display_height_px: 768,
}),
],
});
```

**Supported models:** Claude Sonnet 3.5 and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).

### `bashTool`

Provides Claude with a persistent bash shell session, letting it run arbitrary
commands, install packages, or manipulate files on the host. Choose the type
string that matches your API revision.

```typescript
import { chat } from "@tanstack/ai";
import { anthropicText } from "@tanstack/ai-anthropic";
import { bashTool } from "@tanstack/ai-anthropic/tools";

const stream = chat({
adapter: anthropicText("claude-sonnet-4-5"),
messages: [{ role: "user", content: "List all TypeScript files in src/" }],
tools: [bashTool({ name: "bash", type: "bash_20250124" })],
});
```

**Supported models:** Claude Sonnet 3.5 and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).

### `textEditorTool`

Gives Claude a structured text-editor interface for viewing and modifying files
using `str_replace`, `create`, `view`, and `undo_edit` commands. Choose the
type string for the API revision you target.

```typescript
import { chat } from "@tanstack/ai";
import { anthropicText } from "@tanstack/ai-anthropic";
import { textEditorTool } from "@tanstack/ai-anthropic/tools";

const stream = chat({
adapter: anthropicText("claude-sonnet-4-5"),
messages: [{ role: "user", content: "Fix the bug in src/index.ts" }],
tools: [
textEditorTool({ type: "text_editor_20250124", name: "str_replace_editor" }),
],
});
```

**Supported models:** Claude Sonnet 3.5 and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).

### `memoryTool`

Enables Claude to store and retrieve information across conversation turns
using Anthropic's managed memory service. Call with no arguments to use
default configuration.

```typescript
import { chat } from "@tanstack/ai";
import { anthropicText } from "@tanstack/ai-anthropic";
import { memoryTool } from "@tanstack/ai-anthropic/tools";

const stream = chat({
adapter: anthropicText("claude-sonnet-4-5"),
messages: [{ role: "user", content: "Remember that I prefer metric units" }],
tools: [memoryTool()],
});
```

**Supported models:** Claude Sonnet 4.x and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).

### `customTool`

Creates a tool with an inline JSON Schema input definition instead of going
through `toolDefinition()`. Useful when you need fine-grained control over the
schema shape or want to add `cache_control`. Unlike branded provider tools,
`customTool` returns a plain `Tool` and is accepted by any chat model.

```typescript
import { chat } from "@tanstack/ai";
import { anthropicText } from "@tanstack/ai-anthropic";
import { customTool } from "@tanstack/ai-anthropic/tools";
import { z } from "zod";

const stream = chat({
adapter: anthropicText("claude-sonnet-4-5"),
messages: [{ role: "user", content: "Look up user 42" }],
tools: [
customTool(
"lookup_user",
"Look up a user by ID and return their profile",
z.object({ userId: z.number() }),
),
],
});
```

**Supported models:** all current Claude models. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).
9 changes: 9 additions & 0 deletions docs/adapters/elevenlabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
title: ElevenLabs
id: elevenlabs-adapter
order: 9
description: "Build realtime voice-to-voice conversational AI with ElevenLabs agents in TanStack AI via the @tanstack/ai-elevenlabs adapter."
keywords:
- tanstack ai
- elevenlabs
- realtime voice ai
- conversational ai
- voice chat
- voice agents
- adapter
---

The ElevenLabs adapter provides realtime conversational voice AI for TanStack AI. Unlike text-focused adapters, the ElevenLabs adapter is **voice-focused** -- it integrates with TanStack AI's realtime system to enable voice-to-voice conversations. It does not support `chat()`, `embedding()`, or `summarize()`.
Expand Down
Loading
Loading