@ai-sdk/anthropic 1.1.8 → 1.1.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 +17 -0
- package/dist/index.d.mts +51 -1
- package/dist/index.d.ts +51 -1
- package/dist/index.js +272 -109
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +275 -111
- package/dist/index.mjs.map +1 -1
- package/internal/dist/index.d.mts +51 -1
- package/internal/dist/index.d.ts +51 -1
- package/internal/dist/index.js +272 -109
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +275 -111
- package/internal/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 1.1.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ddf9740: feat (ai): add anthropic reasoning
|
|
8
|
+
- Updated dependencies [ddf9740]
|
|
9
|
+
- @ai-sdk/provider@1.0.9
|
|
10
|
+
- @ai-sdk/provider-utils@2.1.10
|
|
11
|
+
|
|
12
|
+
## 1.1.9
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [2761f06]
|
|
17
|
+
- @ai-sdk/provider@1.0.8
|
|
18
|
+
- @ai-sdk/provider-utils@2.1.9
|
|
19
|
+
|
|
3
20
|
## 1.1.8
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { ProviderV1, LanguageModelV1 } from '@ai-sdk/provider';
|
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
type AnthropicMessagesModelId = 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | (string & {});
|
|
5
|
+
type AnthropicMessagesModelId = 'claude-3-7-sonnet-20250219' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | (string & {});
|
|
6
6
|
interface AnthropicMessagesSettings {
|
|
7
7
|
/**
|
|
8
8
|
Enable Anthropic cache control. This will allow you to use provider-specific
|
|
@@ -196,10 +196,60 @@ declare function computerTool_20241022<RESULT>(options: {
|
|
|
196
196
|
execute: ExecuteFunction<z.infer<typeof Computer20241022Parameters>, RESULT>;
|
|
197
197
|
experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
|
|
198
198
|
};
|
|
199
|
+
/**
|
|
200
|
+
* Creates a tool for executing actions on a computer. Must have name "computer".
|
|
201
|
+
*
|
|
202
|
+
* Image results are supported.
|
|
203
|
+
*
|
|
204
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
205
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
206
|
+
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
207
|
+
* @param execute - The function to execute the tool. Optional.
|
|
208
|
+
*/
|
|
209
|
+
declare function computerTool_20250124<RESULT>(options: {
|
|
210
|
+
displayWidthPx: number;
|
|
211
|
+
displayHeightPx: number;
|
|
212
|
+
displayNumber?: number;
|
|
213
|
+
execute?: ExecuteFunction<{
|
|
214
|
+
/**
|
|
215
|
+
* The action to perform. The available actions are:
|
|
216
|
+
* - `key`: Press a key or key-combination on the keyboard.
|
|
217
|
+
* - This supports xdotool's `key` syntax.
|
|
218
|
+
* - Examples: "a", "Return", "alt+Tab", "ctrl+s", "Up", "KP_0" (for the numpad 0 key).
|
|
219
|
+
* - `type`: Type a string of text on the keyboard.
|
|
220
|
+
* - `cursor_position`: Get the current (x, y) pixel coordinate of the cursor on the screen.
|
|
221
|
+
* - `mouse_move`: Move the cursor to a specified (x, y) pixel coordinate on the screen.
|
|
222
|
+
* - `left_click`: Click the left mouse button.
|
|
223
|
+
* - `left_click_drag`: Click and drag the cursor to a specified (x, y) pixel coordinate on the screen.
|
|
224
|
+
* - `right_click`: Click the right mouse button.
|
|
225
|
+
* - `middle_click`: Click the middle mouse button.
|
|
226
|
+
* - `double_click`: Double-click the left mouse button.
|
|
227
|
+
* - `screenshot`: Take a screenshot of the screen.
|
|
228
|
+
*/
|
|
229
|
+
action: 'key' | 'type' | 'mouse_move' | 'left_click' | 'left_click_drag' | 'right_click' | 'middle_click' | 'double_click' | 'screenshot' | 'cursor_position';
|
|
230
|
+
/**
|
|
231
|
+
* (x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to move the mouse to. Required only by `action=mouse_move` and `action=left_click_drag`.
|
|
232
|
+
*/
|
|
233
|
+
coordinate?: number[];
|
|
234
|
+
/**
|
|
235
|
+
* Required only by `action=type` and `action=key`.
|
|
236
|
+
*/
|
|
237
|
+
text?: string;
|
|
238
|
+
}, RESULT>;
|
|
239
|
+
experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
|
|
240
|
+
}): {
|
|
241
|
+
type: 'provider-defined';
|
|
242
|
+
id: 'anthropic.computer_20250124';
|
|
243
|
+
args: {};
|
|
244
|
+
parameters: typeof Computer20241022Parameters;
|
|
245
|
+
execute: ExecuteFunction<z.infer<typeof Computer20241022Parameters>, RESULT>;
|
|
246
|
+
experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
|
|
247
|
+
};
|
|
199
248
|
declare const anthropicTools: {
|
|
200
249
|
bash_20241022: typeof bashTool_20241022;
|
|
201
250
|
textEditor_20241022: typeof textEditorTool_20241022;
|
|
202
251
|
computer_20241022: typeof computerTool_20241022;
|
|
252
|
+
computer_20250124: typeof computerTool_20250124;
|
|
203
253
|
};
|
|
204
254
|
|
|
205
255
|
interface AnthropicProvider extends ProviderV1 {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ProviderV1, LanguageModelV1 } from '@ai-sdk/provider';
|
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
type AnthropicMessagesModelId = 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | (string & {});
|
|
5
|
+
type AnthropicMessagesModelId = 'claude-3-7-sonnet-20250219' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | (string & {});
|
|
6
6
|
interface AnthropicMessagesSettings {
|
|
7
7
|
/**
|
|
8
8
|
Enable Anthropic cache control. This will allow you to use provider-specific
|
|
@@ -196,10 +196,60 @@ declare function computerTool_20241022<RESULT>(options: {
|
|
|
196
196
|
execute: ExecuteFunction<z.infer<typeof Computer20241022Parameters>, RESULT>;
|
|
197
197
|
experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
|
|
198
198
|
};
|
|
199
|
+
/**
|
|
200
|
+
* Creates a tool for executing actions on a computer. Must have name "computer".
|
|
201
|
+
*
|
|
202
|
+
* Image results are supported.
|
|
203
|
+
*
|
|
204
|
+
* @param displayWidthPx - The width of the display being controlled by the model in pixels.
|
|
205
|
+
* @param displayHeightPx - The height of the display being controlled by the model in pixels.
|
|
206
|
+
* @param displayNumber - The display number to control (only relevant for X11 environments). If specified, the tool will be provided a display number in the tool definition.
|
|
207
|
+
* @param execute - The function to execute the tool. Optional.
|
|
208
|
+
*/
|
|
209
|
+
declare function computerTool_20250124<RESULT>(options: {
|
|
210
|
+
displayWidthPx: number;
|
|
211
|
+
displayHeightPx: number;
|
|
212
|
+
displayNumber?: number;
|
|
213
|
+
execute?: ExecuteFunction<{
|
|
214
|
+
/**
|
|
215
|
+
* The action to perform. The available actions are:
|
|
216
|
+
* - `key`: Press a key or key-combination on the keyboard.
|
|
217
|
+
* - This supports xdotool's `key` syntax.
|
|
218
|
+
* - Examples: "a", "Return", "alt+Tab", "ctrl+s", "Up", "KP_0" (for the numpad 0 key).
|
|
219
|
+
* - `type`: Type a string of text on the keyboard.
|
|
220
|
+
* - `cursor_position`: Get the current (x, y) pixel coordinate of the cursor on the screen.
|
|
221
|
+
* - `mouse_move`: Move the cursor to a specified (x, y) pixel coordinate on the screen.
|
|
222
|
+
* - `left_click`: Click the left mouse button.
|
|
223
|
+
* - `left_click_drag`: Click and drag the cursor to a specified (x, y) pixel coordinate on the screen.
|
|
224
|
+
* - `right_click`: Click the right mouse button.
|
|
225
|
+
* - `middle_click`: Click the middle mouse button.
|
|
226
|
+
* - `double_click`: Double-click the left mouse button.
|
|
227
|
+
* - `screenshot`: Take a screenshot of the screen.
|
|
228
|
+
*/
|
|
229
|
+
action: 'key' | 'type' | 'mouse_move' | 'left_click' | 'left_click_drag' | 'right_click' | 'middle_click' | 'double_click' | 'screenshot' | 'cursor_position';
|
|
230
|
+
/**
|
|
231
|
+
* (x, y): The x (pixels from the left edge) and y (pixels from the top edge) coordinates to move the mouse to. Required only by `action=mouse_move` and `action=left_click_drag`.
|
|
232
|
+
*/
|
|
233
|
+
coordinate?: number[];
|
|
234
|
+
/**
|
|
235
|
+
* Required only by `action=type` and `action=key`.
|
|
236
|
+
*/
|
|
237
|
+
text?: string;
|
|
238
|
+
}, RESULT>;
|
|
239
|
+
experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
|
|
240
|
+
}): {
|
|
241
|
+
type: 'provider-defined';
|
|
242
|
+
id: 'anthropic.computer_20250124';
|
|
243
|
+
args: {};
|
|
244
|
+
parameters: typeof Computer20241022Parameters;
|
|
245
|
+
execute: ExecuteFunction<z.infer<typeof Computer20241022Parameters>, RESULT>;
|
|
246
|
+
experimental_toToolResultContent?: (result: RESULT) => ToolResultContent;
|
|
247
|
+
};
|
|
199
248
|
declare const anthropicTools: {
|
|
200
249
|
bash_20241022: typeof bashTool_20241022;
|
|
201
250
|
textEditor_20241022: typeof textEditorTool_20241022;
|
|
202
251
|
computer_20241022: typeof computerTool_20241022;
|
|
252
|
+
computer_20250124: typeof computerTool_20250124;
|
|
203
253
|
};
|
|
204
254
|
|
|
205
255
|
interface AnthropicProvider extends ProviderV1 {
|