Skip to content

Commit bfe2631

Browse files
ci: apply automated fixes
1 parent 61ed7bb commit bfe2631

1 file changed

Lines changed: 22 additions & 14 deletions

File tree

src/blog/type-safe-provider-tools-tanstack-ai.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ A "provider tool" is a native capability the provider hosts for you. Anthropic w
2020

2121
Here's the catch: support is per model, not per provider.
2222

23-
| Model | Provider tools supported |
24-
|---|---|
25-
| `claude-3-haiku` | `web_search` only |
26-
| `claude-3-5-haiku` | web tools only (`web_search`, `web_fetch`) |
27-
| `claude-opus-4-6` | full superset (web, code execution, computer use, bash, editor, memory) |
28-
| `gpt-3.5-turbo` | none |
29-
| `gpt-5` family | full superset |
30-
| `gemini-3-pro` | full superset |
31-
| `gemini-lite` | narrower subset |
23+
| Model | Provider tools supported |
24+
| ------------------ | ----------------------------------------------------------------------- |
25+
| `claude-3-haiku` | `web_search` only |
26+
| `claude-3-5-haiku` | web tools only (`web_search`, `web_fetch`) |
27+
| `claude-opus-4-6` | full superset (web, code execution, computer use, bash, editor, memory) |
28+
| `gpt-3.5-turbo` | none |
29+
| `gpt-5` family | full superset |
30+
| `gemini-3-pro` | full superset |
31+
| `gemini-lite` | narrower subset |
3232

3333
If you pass `computerUseTool` to `claude-3-haiku`, the provider either rejects the request, or more commonly, the model ignores the tool and generates a confident-sounding response anyway. No stack trace. No warning. Nothing for your tests to catch, because the response shape is valid, just wrong.
3434

@@ -46,7 +46,9 @@ import { computerUseTool } from '@tanstack/ai-anthropic/tools'
4646
const stream = chat({
4747
adapter: anthropicText('claude-3-haiku'),
4848
tools: [
49-
computerUseTool({ /* ... */ }),
49+
computerUseTool({
50+
/* ... */
51+
}),
5052
],
5153
})
5254
```
@@ -63,7 +65,9 @@ Same code, now:
6365
const stream = chat({
6466
adapter: anthropicText('claude-3-haiku'),
6567
tools: [
66-
computerUseTool({ /* ... */ }),
68+
computerUseTool({
69+
/* ... */
70+
}),
6771
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
6872
// Type 'AnthropicComputerUseTool' is not assignable to type
6973
// 'Tool & { "~toolKind"?: never } | ProviderTool<string, "web_search">'.
@@ -83,13 +87,17 @@ Gating only makes sense for provider-hosted tools, because only those have per-m
8387
import { toolDefinition } from '@tanstack/ai'
8488
import { webSearchTool } from '@tanstack/ai-anthropic/tools'
8589

86-
const myTool = toolDefinition({ /* ... */ })
90+
const myTool = toolDefinition({
91+
/* ... */
92+
})
8793

8894
chat({
8995
adapter: anthropicText('claude-3-haiku'),
9096
tools: [
91-
myTool, // fine, always
92-
webSearchTool({ /* ... */ }), // fine, haiku-3 supports it
97+
myTool, // fine, always
98+
webSearchTool({
99+
/* ... */
100+
}), // fine, haiku-3 supports it
93101
],
94102
})
95103
```

0 commit comments

Comments
 (0)