Skip to content

Commit ad3646e

Browse files
authored
Merge branch 'main' into main
2 parents 56da4e6 + 3dcc474 commit ad3646e

452 files changed

Lines changed: 27648 additions & 12924 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/fix-null-tool-input-normalization.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

.changeset/sync-models.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/adapters/anthropic.md

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
title: Anthropic
33
id: anthropic-adapter
44
order: 2
5+
description: "Use Anthropic Claude models with TanStack AI — Claude Sonnet 4.5, Claude Opus, and more via the @tanstack/ai-anthropic adapter."
6+
keywords:
7+
- tanstack ai
8+
- anthropic
9+
- claude
10+
- claude sonnet 4.5
11+
- claude opus
12+
- adapter
13+
- llm
514
---
615

716
The Anthropic adapter provides access to Claude models, including Claude Sonnet 4.5, Claude Opus 4.5, and more.
@@ -228,3 +237,198 @@ Creates an Anthropic summarization adapter with an explicit API key.
228237
- [Getting Started](../getting-started/quick-start) - Learn the basics
229238
- [Tools Guide](../tools/tools) - Learn about tools
230239
- [Other Adapters](./openai) - Explore other providers
240+
241+
## Provider Tools
242+
243+
Anthropic exposes several native tools beyond user-defined function calls.
244+
Import them from `@tanstack/ai-anthropic/tools` and pass them into
245+
`chat({ tools: [...] })`.
246+
247+
> For the full concept, a comparison matrix, and type-gating details, see
248+
> [Provider Tools](../tools/provider-tools.md).
249+
250+
### `webSearchTool`
251+
252+
Enables Claude to run Anthropic's native web search with inline citations.
253+
Scope the search with `allowed_domains` or `blocked_domains` (mutually
254+
exclusive); set `max_uses` to cap per-turn cost.
255+
256+
```typescript
257+
import { chat } from "@tanstack/ai";
258+
import { anthropicText } from "@tanstack/ai-anthropic";
259+
import { webSearchTool } from "@tanstack/ai-anthropic/tools";
260+
261+
const stream = chat({
262+
adapter: anthropicText("claude-opus-4-6"),
263+
messages: [{ role: "user", content: "What's new in AI this week?" }],
264+
tools: [
265+
webSearchTool({
266+
name: "web_search",
267+
type: "web_search_20250305",
268+
max_uses: 2,
269+
}),
270+
],
271+
});
272+
```
273+
274+
**Supported models:** every current Claude model. `claude-3-haiku` supports
275+
only `web_search` (not `web_fetch`). See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).
276+
277+
### `webFetchTool`
278+
279+
Lets Claude fetch the contents of a URL directly, useful when you want the
280+
model to read a specific page rather than run a search. Takes no required
281+
arguments — pass an optional config object to override defaults.
282+
283+
```typescript
284+
import { chat } from "@tanstack/ai";
285+
import { anthropicText } from "@tanstack/ai-anthropic";
286+
import { webFetchTool } from "@tanstack/ai-anthropic/tools";
287+
288+
const stream = chat({
289+
adapter: anthropicText("claude-sonnet-4-5"),
290+
messages: [{ role: "user", content: "Summarise https://example.com" }],
291+
tools: [webFetchTool()],
292+
});
293+
```
294+
295+
**Supported models:** Claude Sonnet 4.x and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).
296+
297+
### `codeExecutionTool`
298+
299+
Gives Claude a sandboxed code-execution environment so it can run Python
300+
snippets, analyse data, and return results inline. Choose the version string
301+
that matches your desired API revision.
302+
303+
```typescript
304+
import { chat } from "@tanstack/ai";
305+
import { anthropicText } from "@tanstack/ai-anthropic";
306+
import { codeExecutionTool } from "@tanstack/ai-anthropic/tools";
307+
308+
const stream = chat({
309+
adapter: anthropicText("claude-sonnet-4-5"),
310+
messages: [{ role: "user", content: "Plot a histogram of [1,2,2,3,3,3]" }],
311+
tools: [
312+
codeExecutionTool({ name: "code_execution", type: "code_execution_20250825" }),
313+
],
314+
});
315+
```
316+
317+
**Supported models:** Claude Sonnet 4.x and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).
318+
319+
### `computerUseTool`
320+
321+
Allows Claude to observe a virtual desktop (screenshots) and interact with it
322+
via keyboard and mouse events. Provide the screen resolution so Claude can
323+
calculate accurate coordinates.
324+
325+
```typescript
326+
import { chat } from "@tanstack/ai";
327+
import { anthropicText } from "@tanstack/ai-anthropic";
328+
import { computerUseTool } from "@tanstack/ai-anthropic/tools";
329+
330+
const stream = chat({
331+
adapter: anthropicText("claude-sonnet-4-5"),
332+
messages: [{ role: "user", content: "Open the browser and go to example.com" }],
333+
tools: [
334+
computerUseTool({
335+
type: "computer_20250124",
336+
name: "computer",
337+
display_width_px: 1024,
338+
display_height_px: 768,
339+
}),
340+
],
341+
});
342+
```
343+
344+
**Supported models:** Claude Sonnet 3.5 and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).
345+
346+
### `bashTool`
347+
348+
Provides Claude with a persistent bash shell session, letting it run arbitrary
349+
commands, install packages, or manipulate files on the host. Choose the type
350+
string that matches your API revision.
351+
352+
```typescript
353+
import { chat } from "@tanstack/ai";
354+
import { anthropicText } from "@tanstack/ai-anthropic";
355+
import { bashTool } from "@tanstack/ai-anthropic/tools";
356+
357+
const stream = chat({
358+
adapter: anthropicText("claude-sonnet-4-5"),
359+
messages: [{ role: "user", content: "List all TypeScript files in src/" }],
360+
tools: [bashTool({ name: "bash", type: "bash_20250124" })],
361+
});
362+
```
363+
364+
**Supported models:** Claude Sonnet 3.5 and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).
365+
366+
### `textEditorTool`
367+
368+
Gives Claude a structured text-editor interface for viewing and modifying files
369+
using `str_replace`, `create`, `view`, and `undo_edit` commands. Choose the
370+
type string for the API revision you target.
371+
372+
```typescript
373+
import { chat } from "@tanstack/ai";
374+
import { anthropicText } from "@tanstack/ai-anthropic";
375+
import { textEditorTool } from "@tanstack/ai-anthropic/tools";
376+
377+
const stream = chat({
378+
adapter: anthropicText("claude-sonnet-4-5"),
379+
messages: [{ role: "user", content: "Fix the bug in src/index.ts" }],
380+
tools: [
381+
textEditorTool({ type: "text_editor_20250124", name: "str_replace_editor" }),
382+
],
383+
});
384+
```
385+
386+
**Supported models:** Claude Sonnet 3.5 and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).
387+
388+
### `memoryTool`
389+
390+
Enables Claude to store and retrieve information across conversation turns
391+
using Anthropic's managed memory service. Call with no arguments to use
392+
default configuration.
393+
394+
```typescript
395+
import { chat } from "@tanstack/ai";
396+
import { anthropicText } from "@tanstack/ai-anthropic";
397+
import { memoryTool } from "@tanstack/ai-anthropic/tools";
398+
399+
const stream = chat({
400+
adapter: anthropicText("claude-sonnet-4-5"),
401+
messages: [{ role: "user", content: "Remember that I prefer metric units" }],
402+
tools: [memoryTool()],
403+
});
404+
```
405+
406+
**Supported models:** Claude Sonnet 4.x and above. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).
407+
408+
### `customTool`
409+
410+
Creates a tool with an inline JSON Schema input definition instead of going
411+
through `toolDefinition()`. Useful when you need fine-grained control over the
412+
schema shape or want to add `cache_control`. Unlike branded provider tools,
413+
`customTool` returns a plain `Tool` and is accepted by any chat model.
414+
415+
```typescript
416+
import { chat } from "@tanstack/ai";
417+
import { anthropicText } from "@tanstack/ai-anthropic";
418+
import { customTool } from "@tanstack/ai-anthropic/tools";
419+
import { z } from "zod";
420+
421+
const stream = chat({
422+
adapter: anthropicText("claude-sonnet-4-5"),
423+
messages: [{ role: "user", content: "Look up user 42" }],
424+
tools: [
425+
customTool(
426+
"lookup_user",
427+
"Look up a user by ID and return their profile",
428+
z.object({ userId: z.number() }),
429+
),
430+
],
431+
});
432+
```
433+
434+
**Supported models:** all current Claude models. See [Provider Tools](../tools/provider-tools.md#which-models-support-which-tools).

docs/adapters/elevenlabs.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
title: ElevenLabs
33
id: elevenlabs-adapter
44
order: 9
5+
description: "Build realtime voice-to-voice conversational AI with ElevenLabs agents in TanStack AI via the @tanstack/ai-elevenlabs adapter."
6+
keywords:
7+
- tanstack ai
8+
- elevenlabs
9+
- realtime voice ai
10+
- conversational ai
11+
- voice chat
12+
- voice agents
13+
- adapter
514
---
615

716
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()`.

docs/adapters/fal.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
---
22
title: fal.ai
33
id: fal-adapter
4+
description: "Generate images and videos with 600+ models on fal.ai using TanStack AI — Nano Banana Pro, FLUX, and more via the @tanstack/ai-fal adapter."
5+
keywords:
6+
- tanstack ai
7+
- fal.ai
8+
- fal
9+
- image generation
10+
- video generation
11+
- flux
12+
- nano banana
13+
- adapter
414
---
515

616
The fal.ai adapter provides access to 600+ models on the fal.ai platform for image generation and video generation. Unlike text-focused adapters, the fal adapter is **media-focused** — it supports `generateImage()` and `generateVideo()` but does not support `chat()` or tools. Audio and speech support are coming soon.

0 commit comments

Comments
 (0)