@ai-sdk/anthropic 2.1.0-beta.1 → 2.1.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/dist/index.d.mts +114 -10
- package/dist/index.d.ts +114 -10
- package/dist/index.js +677 -387
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +660 -370
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +131 -15
- package/dist/internal/index.d.ts +131 -15
- package/dist/internal/index.js +657 -375
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +642 -360
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,83 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 2.1.0-beta.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dedf206: feat(provider/anthropic): expose stop_sequence in provider metadata
|
|
8
|
+
|
|
9
|
+
## 2.1.0-beta.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 0adc679: feat(provider): shared spec v3
|
|
14
|
+
- Updated dependencies [0adc679]
|
|
15
|
+
- Updated dependencies [2b0caef]
|
|
16
|
+
- @ai-sdk/provider-utils@3.1.0-beta.6
|
|
17
|
+
- @ai-sdk/provider@2.1.0-beta.4
|
|
18
|
+
|
|
19
|
+
## 2.1.0-beta.8
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- a5a8db4: chore: add model ID for Sonnet 4.5
|
|
24
|
+
|
|
25
|
+
## 2.1.0-beta.7
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- e1e2821: fix(provider/anthropic): support null title in web fetch tool
|
|
30
|
+
|
|
31
|
+
## 2.1.0-beta.6
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- 8dac895: feat: `LanguageModelV3`
|
|
36
|
+
- 10c1322: fix: moved dependency `@ai-sdk/test-server` to devDependencies
|
|
37
|
+
- Updated dependencies [8dac895]
|
|
38
|
+
- @ai-sdk/provider-utils@3.1.0-beta.5
|
|
39
|
+
- @ai-sdk/provider@2.1.0-beta.3
|
|
40
|
+
|
|
41
|
+
## 2.1.0-beta.5
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- 11e4abe: feat(provider/anthropic): web search tool updates
|
|
46
|
+
- afb00e3: feat(provider/anthropic): add text_editor_20250728 tool support
|
|
47
|
+
|
|
48
|
+
Add text_editor_20250728 tool for Claude 4 models (Sonnet 4, Opus 4, Opus 4.1) with optional max_characters parameter and no undo_edit command support.
|
|
49
|
+
|
|
50
|
+
- f6603b7: fix(provider/anthropic): correct raw usage information
|
|
51
|
+
- fa35e95: feat(provider/anthropic): add web fetch tool
|
|
52
|
+
- c5440c5: chore(provider/anthropic): update anthropic model ids
|
|
53
|
+
|
|
54
|
+
## 2.1.0-beta.4
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- 4616b86: chore: update zod peer depenedency version
|
|
59
|
+
- Updated dependencies [4616b86]
|
|
60
|
+
- @ai-sdk/provider-utils@3.1.0-beta.4
|
|
61
|
+
|
|
62
|
+
## 2.1.0-beta.3
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- ed329cb: feat: `Provider-V3`
|
|
67
|
+
- Updated dependencies [ed329cb]
|
|
68
|
+
- Updated dependencies [522f6b8]
|
|
69
|
+
- @ai-sdk/provider@2.1.0-beta.2
|
|
70
|
+
- @ai-sdk/provider-utils@3.1.0-beta.3
|
|
71
|
+
|
|
72
|
+
## 2.1.0-beta.2
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- 1cad0ab: feat: add provider version to user-agent header
|
|
77
|
+
- Updated dependencies [0c4822d]
|
|
78
|
+
- @ai-sdk/provider@2.1.0-beta.1
|
|
79
|
+
- @ai-sdk/provider-utils@3.1.0-beta.2
|
|
80
|
+
|
|
3
81
|
## 2.1.0-beta.1
|
|
4
82
|
|
|
5
83
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
import {
|
|
2
|
+
import { ProviderV3, LanguageModelV3 } from '@ai-sdk/provider';
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
4
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
|
-
type AnthropicMessagesModelId = 'claude-
|
|
6
|
+
type AnthropicMessagesModelId = 'claude-sonnet-4-5' | 'claude-sonnet-4-5-20250929' | 'claude-opus-4-1' | 'claude-opus-4-0' | 'claude-sonnet-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-20250514' | 'claude-sonnet-4-20250514' | 'claude-3-7-sonnet-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-haiku-20240307' | (string & {});
|
|
7
7
|
declare const anthropicProviderOptions: z.ZodObject<{
|
|
8
8
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
9
9
|
thinking: z.ZodOptional<z.ZodObject<{
|
|
@@ -119,6 +119,8 @@ declare const anthropicTools: {
|
|
|
119
119
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
120
120
|
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
121
121
|
*
|
|
122
|
+
* Supported models: Claude Sonnet 3.5
|
|
123
|
+
*
|
|
122
124
|
* Tool name must be `str_replace_editor`.
|
|
123
125
|
*/
|
|
124
126
|
textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
@@ -135,6 +137,8 @@ declare const anthropicTools: {
|
|
|
135
137
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
136
138
|
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
137
139
|
*
|
|
140
|
+
* Supported models: Claude Sonnet 3.7
|
|
141
|
+
*
|
|
138
142
|
* Tool name must be `str_replace_editor`.
|
|
139
143
|
*/
|
|
140
144
|
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
@@ -154,6 +158,8 @@ declare const anthropicTools: {
|
|
|
154
158
|
* Note: This version does not support the "undo_edit" command.
|
|
155
159
|
*
|
|
156
160
|
* Tool name must be `str_replace_based_edit_tool`.
|
|
161
|
+
*
|
|
162
|
+
* @deprecated Use textEditor_20250728 instead
|
|
157
163
|
*/
|
|
158
164
|
textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
159
165
|
command: "view" | "create" | "str_replace" | "insert";
|
|
@@ -164,6 +170,102 @@ declare const anthropicTools: {
|
|
|
164
170
|
old_str?: string;
|
|
165
171
|
view_range?: number[];
|
|
166
172
|
}, {}>;
|
|
173
|
+
/**
|
|
174
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
175
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
176
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
177
|
+
*
|
|
178
|
+
* Note: This version does not support the "undo_edit" command and adds optional max_characters parameter.
|
|
179
|
+
*
|
|
180
|
+
* Supported models: Claude Sonnet 4, Opus 4, and Opus 4.1
|
|
181
|
+
*
|
|
182
|
+
* Tool name must be `str_replace_based_edit_tool`.
|
|
183
|
+
*
|
|
184
|
+
* @param maxCharacters - Optional maximum number of characters to view in the file
|
|
185
|
+
*/
|
|
186
|
+
textEditor_20250728: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
187
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
188
|
+
path: string;
|
|
189
|
+
file_text?: string;
|
|
190
|
+
insert_line?: number;
|
|
191
|
+
new_str?: string;
|
|
192
|
+
old_str?: string;
|
|
193
|
+
view_range?: number[];
|
|
194
|
+
}, {
|
|
195
|
+
maxCharacters?: number;
|
|
196
|
+
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
197
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
198
|
+
path: string;
|
|
199
|
+
file_text?: string;
|
|
200
|
+
insert_line?: number;
|
|
201
|
+
new_str?: string;
|
|
202
|
+
old_str?: string;
|
|
203
|
+
view_range?: number[];
|
|
204
|
+
}, unknown>;
|
|
205
|
+
/**
|
|
206
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
207
|
+
*
|
|
208
|
+
* Tool name must be `web_fetch`.
|
|
209
|
+
*
|
|
210
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
211
|
+
* @param allowedDomains - Only fetch from these domains
|
|
212
|
+
* @param blockedDomains - Never fetch from these domains
|
|
213
|
+
* @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
|
|
214
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
215
|
+
*/
|
|
216
|
+
webFetch_20250910: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
217
|
+
url: string;
|
|
218
|
+
}, {
|
|
219
|
+
type: "web_fetch_result";
|
|
220
|
+
url: string;
|
|
221
|
+
content: {
|
|
222
|
+
type: "document";
|
|
223
|
+
title: string;
|
|
224
|
+
citations?: {
|
|
225
|
+
enabled: boolean;
|
|
226
|
+
};
|
|
227
|
+
source: {
|
|
228
|
+
type: "base64";
|
|
229
|
+
mediaType: "application/pdf";
|
|
230
|
+
data: string;
|
|
231
|
+
} | {
|
|
232
|
+
type: "text";
|
|
233
|
+
mediaType: "text/plain";
|
|
234
|
+
data: string;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
retrievedAt: string | null;
|
|
238
|
+
}, {
|
|
239
|
+
maxUses?: number;
|
|
240
|
+
allowedDomains?: string[];
|
|
241
|
+
blockedDomains?: string[];
|
|
242
|
+
citations?: {
|
|
243
|
+
enabled: boolean;
|
|
244
|
+
};
|
|
245
|
+
maxContentTokens?: number;
|
|
246
|
+
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
247
|
+
url: string;
|
|
248
|
+
}, {
|
|
249
|
+
type: "web_fetch_result";
|
|
250
|
+
url: string;
|
|
251
|
+
content: {
|
|
252
|
+
type: "document";
|
|
253
|
+
title: string;
|
|
254
|
+
citations?: {
|
|
255
|
+
enabled: boolean;
|
|
256
|
+
};
|
|
257
|
+
source: {
|
|
258
|
+
type: "base64";
|
|
259
|
+
mediaType: "application/pdf";
|
|
260
|
+
data: string;
|
|
261
|
+
} | {
|
|
262
|
+
type: "text";
|
|
263
|
+
mediaType: "text/plain";
|
|
264
|
+
data: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
retrievedAt: string | null;
|
|
268
|
+
}>;
|
|
167
269
|
/**
|
|
168
270
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
169
271
|
*
|
|
@@ -177,11 +279,11 @@ declare const anthropicTools: {
|
|
|
177
279
|
webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
178
280
|
query: string;
|
|
179
281
|
}, {
|
|
282
|
+
type: "web_search_result";
|
|
180
283
|
url: string;
|
|
181
284
|
title: string;
|
|
182
285
|
pageAge: string | null;
|
|
183
286
|
encryptedContent: string;
|
|
184
|
-
type: string;
|
|
185
287
|
}[], {
|
|
186
288
|
maxUses?: number;
|
|
187
289
|
allowedDomains?: string[];
|
|
@@ -196,25 +298,25 @@ declare const anthropicTools: {
|
|
|
196
298
|
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
197
299
|
query: string;
|
|
198
300
|
}, {
|
|
301
|
+
type: "web_search_result";
|
|
199
302
|
url: string;
|
|
200
303
|
title: string;
|
|
201
304
|
pageAge: string | null;
|
|
202
305
|
encryptedContent: string;
|
|
203
|
-
type: string;
|
|
204
306
|
}[]>;
|
|
205
307
|
};
|
|
206
308
|
|
|
207
|
-
interface AnthropicProvider extends
|
|
309
|
+
interface AnthropicProvider extends ProviderV3 {
|
|
208
310
|
/**
|
|
209
311
|
Creates a model for text generation.
|
|
210
312
|
*/
|
|
211
|
-
(modelId: AnthropicMessagesModelId):
|
|
313
|
+
(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
212
314
|
/**
|
|
213
315
|
Creates a model for text generation.
|
|
214
316
|
*/
|
|
215
|
-
languageModel(modelId: AnthropicMessagesModelId):
|
|
216
|
-
chat(modelId: AnthropicMessagesModelId):
|
|
217
|
-
messages(modelId: AnthropicMessagesModelId):
|
|
317
|
+
languageModel(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
318
|
+
chat(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
319
|
+
messages(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
218
320
|
/**
|
|
219
321
|
Anthropic-specific computer use tool.
|
|
220
322
|
*/
|
|
@@ -251,4 +353,6 @@ Default Anthropic provider instance.
|
|
|
251
353
|
*/
|
|
252
354
|
declare const anthropic: AnthropicProvider;
|
|
253
355
|
|
|
254
|
-
|
|
356
|
+
declare const VERSION: string;
|
|
357
|
+
|
|
358
|
+
export { type AnthropicProvider, type AnthropicProviderOptions, type AnthropicProviderSettings, VERSION, anthropic, createAnthropic };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
import {
|
|
2
|
+
import { ProviderV3, LanguageModelV3 } from '@ai-sdk/provider';
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
4
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
|
-
type AnthropicMessagesModelId = 'claude-
|
|
6
|
+
type AnthropicMessagesModelId = 'claude-sonnet-4-5' | 'claude-sonnet-4-5-20250929' | 'claude-opus-4-1' | 'claude-opus-4-0' | 'claude-sonnet-4-0' | 'claude-opus-4-1-20250805' | 'claude-opus-4-20250514' | 'claude-sonnet-4-20250514' | 'claude-3-7-sonnet-latest' | 'claude-3-7-sonnet-20250219' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-haiku-20240307' | (string & {});
|
|
7
7
|
declare const anthropicProviderOptions: z.ZodObject<{
|
|
8
8
|
sendReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
9
9
|
thinking: z.ZodOptional<z.ZodObject<{
|
|
@@ -119,6 +119,8 @@ declare const anthropicTools: {
|
|
|
119
119
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
120
120
|
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
121
121
|
*
|
|
122
|
+
* Supported models: Claude Sonnet 3.5
|
|
123
|
+
*
|
|
122
124
|
* Tool name must be `str_replace_editor`.
|
|
123
125
|
*/
|
|
124
126
|
textEditor_20241022: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
@@ -135,6 +137,8 @@ declare const anthropicTools: {
|
|
|
135
137
|
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
136
138
|
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
137
139
|
*
|
|
140
|
+
* Supported models: Claude Sonnet 3.7
|
|
141
|
+
*
|
|
138
142
|
* Tool name must be `str_replace_editor`.
|
|
139
143
|
*/
|
|
140
144
|
textEditor_20250124: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
@@ -154,6 +158,8 @@ declare const anthropicTools: {
|
|
|
154
158
|
* Note: This version does not support the "undo_edit" command.
|
|
155
159
|
*
|
|
156
160
|
* Tool name must be `str_replace_based_edit_tool`.
|
|
161
|
+
*
|
|
162
|
+
* @deprecated Use textEditor_20250728 instead
|
|
157
163
|
*/
|
|
158
164
|
textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
159
165
|
command: "view" | "create" | "str_replace" | "insert";
|
|
@@ -164,6 +170,102 @@ declare const anthropicTools: {
|
|
|
164
170
|
old_str?: string;
|
|
165
171
|
view_range?: number[];
|
|
166
172
|
}, {}>;
|
|
173
|
+
/**
|
|
174
|
+
* Claude can use an Anthropic-defined text editor tool to view and modify text files,
|
|
175
|
+
* helping you debug, fix, and improve your code or other text documents. This allows Claude
|
|
176
|
+
* to directly interact with your files, providing hands-on assistance rather than just suggesting changes.
|
|
177
|
+
*
|
|
178
|
+
* Note: This version does not support the "undo_edit" command and adds optional max_characters parameter.
|
|
179
|
+
*
|
|
180
|
+
* Supported models: Claude Sonnet 4, Opus 4, and Opus 4.1
|
|
181
|
+
*
|
|
182
|
+
* Tool name must be `str_replace_based_edit_tool`.
|
|
183
|
+
*
|
|
184
|
+
* @param maxCharacters - Optional maximum number of characters to view in the file
|
|
185
|
+
*/
|
|
186
|
+
textEditor_20250728: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactory<{
|
|
187
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
188
|
+
path: string;
|
|
189
|
+
file_text?: string;
|
|
190
|
+
insert_line?: number;
|
|
191
|
+
new_str?: string;
|
|
192
|
+
old_str?: string;
|
|
193
|
+
view_range?: number[];
|
|
194
|
+
}, {
|
|
195
|
+
maxCharacters?: number;
|
|
196
|
+
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
197
|
+
command: "view" | "create" | "str_replace" | "insert";
|
|
198
|
+
path: string;
|
|
199
|
+
file_text?: string;
|
|
200
|
+
insert_line?: number;
|
|
201
|
+
new_str?: string;
|
|
202
|
+
old_str?: string;
|
|
203
|
+
view_range?: number[];
|
|
204
|
+
}, unknown>;
|
|
205
|
+
/**
|
|
206
|
+
* Creates a web fetch tool that gives Claude direct access to real-time web content.
|
|
207
|
+
*
|
|
208
|
+
* Tool name must be `web_fetch`.
|
|
209
|
+
*
|
|
210
|
+
* @param maxUses - The max_uses parameter limits the number of web fetches performed
|
|
211
|
+
* @param allowedDomains - Only fetch from these domains
|
|
212
|
+
* @param blockedDomains - Never fetch from these domains
|
|
213
|
+
* @param citations - Unlike web search where citations are always enabled, citations are optional for web fetch. Set "citations": {"enabled": true} to enable Claude to cite specific passages from fetched documents.
|
|
214
|
+
* @param maxContentTokens - The max_content_tokens parameter limits the amount of content that will be included in the context.
|
|
215
|
+
*/
|
|
216
|
+
webFetch_20250910: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
217
|
+
url: string;
|
|
218
|
+
}, {
|
|
219
|
+
type: "web_fetch_result";
|
|
220
|
+
url: string;
|
|
221
|
+
content: {
|
|
222
|
+
type: "document";
|
|
223
|
+
title: string;
|
|
224
|
+
citations?: {
|
|
225
|
+
enabled: boolean;
|
|
226
|
+
};
|
|
227
|
+
source: {
|
|
228
|
+
type: "base64";
|
|
229
|
+
mediaType: "application/pdf";
|
|
230
|
+
data: string;
|
|
231
|
+
} | {
|
|
232
|
+
type: "text";
|
|
233
|
+
mediaType: "text/plain";
|
|
234
|
+
data: string;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
retrievedAt: string | null;
|
|
238
|
+
}, {
|
|
239
|
+
maxUses?: number;
|
|
240
|
+
allowedDomains?: string[];
|
|
241
|
+
blockedDomains?: string[];
|
|
242
|
+
citations?: {
|
|
243
|
+
enabled: boolean;
|
|
244
|
+
};
|
|
245
|
+
maxContentTokens?: number;
|
|
246
|
+
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
247
|
+
url: string;
|
|
248
|
+
}, {
|
|
249
|
+
type: "web_fetch_result";
|
|
250
|
+
url: string;
|
|
251
|
+
content: {
|
|
252
|
+
type: "document";
|
|
253
|
+
title: string;
|
|
254
|
+
citations?: {
|
|
255
|
+
enabled: boolean;
|
|
256
|
+
};
|
|
257
|
+
source: {
|
|
258
|
+
type: "base64";
|
|
259
|
+
mediaType: "application/pdf";
|
|
260
|
+
data: string;
|
|
261
|
+
} | {
|
|
262
|
+
type: "text";
|
|
263
|
+
mediaType: "text/plain";
|
|
264
|
+
data: string;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
retrievedAt: string | null;
|
|
268
|
+
}>;
|
|
167
269
|
/**
|
|
168
270
|
* Creates a web search tool that gives Claude direct access to real-time web content.
|
|
169
271
|
*
|
|
@@ -177,11 +279,11 @@ declare const anthropicTools: {
|
|
|
177
279
|
webSearch_20250305: (args?: Parameters<_ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
|
|
178
280
|
query: string;
|
|
179
281
|
}, {
|
|
282
|
+
type: "web_search_result";
|
|
180
283
|
url: string;
|
|
181
284
|
title: string;
|
|
182
285
|
pageAge: string | null;
|
|
183
286
|
encryptedContent: string;
|
|
184
|
-
type: string;
|
|
185
287
|
}[], {
|
|
186
288
|
maxUses?: number;
|
|
187
289
|
allowedDomains?: string[];
|
|
@@ -196,25 +298,25 @@ declare const anthropicTools: {
|
|
|
196
298
|
}>>[0]) => _ai_sdk_provider_utils.Tool<{
|
|
197
299
|
query: string;
|
|
198
300
|
}, {
|
|
301
|
+
type: "web_search_result";
|
|
199
302
|
url: string;
|
|
200
303
|
title: string;
|
|
201
304
|
pageAge: string | null;
|
|
202
305
|
encryptedContent: string;
|
|
203
|
-
type: string;
|
|
204
306
|
}[]>;
|
|
205
307
|
};
|
|
206
308
|
|
|
207
|
-
interface AnthropicProvider extends
|
|
309
|
+
interface AnthropicProvider extends ProviderV3 {
|
|
208
310
|
/**
|
|
209
311
|
Creates a model for text generation.
|
|
210
312
|
*/
|
|
211
|
-
(modelId: AnthropicMessagesModelId):
|
|
313
|
+
(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
212
314
|
/**
|
|
213
315
|
Creates a model for text generation.
|
|
214
316
|
*/
|
|
215
|
-
languageModel(modelId: AnthropicMessagesModelId):
|
|
216
|
-
chat(modelId: AnthropicMessagesModelId):
|
|
217
|
-
messages(modelId: AnthropicMessagesModelId):
|
|
317
|
+
languageModel(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
318
|
+
chat(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
319
|
+
messages(modelId: AnthropicMessagesModelId): LanguageModelV3;
|
|
218
320
|
/**
|
|
219
321
|
Anthropic-specific computer use tool.
|
|
220
322
|
*/
|
|
@@ -251,4 +353,6 @@ Default Anthropic provider instance.
|
|
|
251
353
|
*/
|
|
252
354
|
declare const anthropic: AnthropicProvider;
|
|
253
355
|
|
|
254
|
-
|
|
356
|
+
declare const VERSION: string;
|
|
357
|
+
|
|
358
|
+
export { type AnthropicProvider, type AnthropicProviderOptions, type AnthropicProviderSettings, VERSION, anthropic, createAnthropic };
|