@ai-sdk/anthropic 2.0.0-beta.1 → 2.0.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 CHANGED
@@ -1,5 +1,76 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 2.0.0-beta.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 269683f: Add raw Anthropic usage information to provider metadata
8
+ - Updated dependencies [e7fcc86]
9
+ - @ai-sdk/provider-utils@3.0.0-beta.7
10
+
11
+ ## 2.0.0-beta.9
12
+
13
+ ### Patch Changes
14
+
15
+ - 4f26d59: feat(provider/anthropic): add disable parallel tool use option
16
+ - a753b3a: feat (provider/anthropic): cache control for tools
17
+ - Updated dependencies [ac34802]
18
+ - @ai-sdk/provider-utils@3.0.0-beta.6
19
+
20
+ ## 2.0.0-beta.8
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [57edfcb]
25
+ - Updated dependencies [383cbfa]
26
+ - @ai-sdk/provider-utils@3.0.0-beta.5
27
+
28
+ ## 2.0.0-beta.7
29
+
30
+ ### Patch Changes
31
+
32
+ - 205077b: fix: improve Zod compatibility
33
+ - Updated dependencies [205077b]
34
+ - @ai-sdk/provider-utils@3.0.0-beta.4
35
+
36
+ ## 2.0.0-beta.6
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [05d2819]
41
+ - @ai-sdk/provider-utils@3.0.0-beta.3
42
+
43
+ ## 2.0.0-beta.5
44
+
45
+ ### Patch Changes
46
+
47
+ - b9ddcdd: feat(anthropic): add text_editor_20250429 tool for Claude 4 models
48
+
49
+ ## 2.0.0-beta.4
50
+
51
+ ### Patch Changes
52
+
53
+ - fdff8a4: fix(provider/anthropic): correct Claude 4 model ID format
54
+ - 84577c8: fix (providers/anthropic): remove fine grained tool streaming beta
55
+
56
+ ## 2.0.0-beta.3
57
+
58
+ ### Patch Changes
59
+
60
+ - a85c85f: fix (provider/anthropic): streaming json output
61
+ - d1a034f: feature: using Zod 4 for internal stuff
62
+ - 0b678b2: feat (provider/anthropic): enable streaming tool calls
63
+ - Updated dependencies [0571b98]
64
+ - Updated dependencies [39a4fab]
65
+ - Updated dependencies [d1a034f]
66
+ - @ai-sdk/provider-utils@3.0.0-beta.2
67
+
68
+ ## 2.0.0-beta.2
69
+
70
+ ### Patch Changes
71
+
72
+ - d601ed9: fix (provider/anthropic): send tool call id in tool-input-start chunk
73
+
3
74
  ## 2.0.0-beta.1
4
75
 
5
76
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,34 +1,17 @@
1
- import { z } from 'zod';
1
+ import { z } from 'zod/v4';
2
2
  import { ProviderV2, LanguageModelV2 } 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-4-opus-20250514' | 'claude-4-sonnet-20250514' | '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
+ type AnthropicMessagesModelId = 'claude-opus-4-20250514' | 'claude-sonnet-4-20250514' | '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 & {});
7
7
  declare const anthropicProviderOptions: z.ZodObject<{
8
8
  sendReasoning: z.ZodOptional<z.ZodBoolean>;
9
9
  thinking: z.ZodOptional<z.ZodObject<{
10
- type: z.ZodUnion<[z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>;
10
+ type: z.ZodUnion<readonly [z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>;
11
11
  budgetTokens: z.ZodOptional<z.ZodNumber>;
12
- }, "strip", z.ZodTypeAny, {
13
- type: "enabled" | "disabled";
14
- budgetTokens?: number | undefined;
15
- }, {
16
- type: "enabled" | "disabled";
17
- budgetTokens?: number | undefined;
18
- }>>;
19
- }, "strip", z.ZodTypeAny, {
20
- sendReasoning?: boolean | undefined;
21
- thinking?: {
22
- type: "enabled" | "disabled";
23
- budgetTokens?: number | undefined;
24
- } | undefined;
25
- }, {
26
- sendReasoning?: boolean | undefined;
27
- thinking?: {
28
- type: "enabled" | "disabled";
29
- budgetTokens?: number | undefined;
30
- } | undefined;
31
- }>;
12
+ }, z.core.$strip>>;
13
+ disableParallelToolUse: z.ZodOptional<z.ZodBoolean>;
14
+ }, z.core.$strip>;
32
15
  type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
33
16
 
34
17
  declare const anthropicTools: {
@@ -78,6 +61,19 @@ declare const anthropicTools: {
78
61
  old_str?: string;
79
62
  view_range?: number[];
80
63
  }, {}>;
64
+ /**
65
+ * Creates a tool for editing text. Must have name "str_replace_based_edit_tool".
66
+ * Note: This version does not support the "undo_edit" command.
67
+ */
68
+ textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
69
+ command: "view" | "create" | "str_replace" | "insert";
70
+ path: string;
71
+ file_text?: string;
72
+ insert_line?: number;
73
+ new_str?: string;
74
+ old_str?: string;
75
+ view_range?: number[];
76
+ }, {}>;
81
77
  /**
82
78
  * Creates a tool for executing actions on a computer. Must have name "computer".
83
79
  *
package/dist/index.d.ts CHANGED
@@ -1,34 +1,17 @@
1
- import { z } from 'zod';
1
+ import { z } from 'zod/v4';
2
2
  import { ProviderV2, LanguageModelV2 } 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-4-opus-20250514' | 'claude-4-sonnet-20250514' | '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
+ type AnthropicMessagesModelId = 'claude-opus-4-20250514' | 'claude-sonnet-4-20250514' | '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 & {});
7
7
  declare const anthropicProviderOptions: z.ZodObject<{
8
8
  sendReasoning: z.ZodOptional<z.ZodBoolean>;
9
9
  thinking: z.ZodOptional<z.ZodObject<{
10
- type: z.ZodUnion<[z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>;
10
+ type: z.ZodUnion<readonly [z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>;
11
11
  budgetTokens: z.ZodOptional<z.ZodNumber>;
12
- }, "strip", z.ZodTypeAny, {
13
- type: "enabled" | "disabled";
14
- budgetTokens?: number | undefined;
15
- }, {
16
- type: "enabled" | "disabled";
17
- budgetTokens?: number | undefined;
18
- }>>;
19
- }, "strip", z.ZodTypeAny, {
20
- sendReasoning?: boolean | undefined;
21
- thinking?: {
22
- type: "enabled" | "disabled";
23
- budgetTokens?: number | undefined;
24
- } | undefined;
25
- }, {
26
- sendReasoning?: boolean | undefined;
27
- thinking?: {
28
- type: "enabled" | "disabled";
29
- budgetTokens?: number | undefined;
30
- } | undefined;
31
- }>;
12
+ }, z.core.$strip>>;
13
+ disableParallelToolUse: z.ZodOptional<z.ZodBoolean>;
14
+ }, z.core.$strip>;
32
15
  type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
33
16
 
34
17
  declare const anthropicTools: {
@@ -78,6 +61,19 @@ declare const anthropicTools: {
78
61
  old_str?: string;
79
62
  view_range?: number[];
80
63
  }, {}>;
64
+ /**
65
+ * Creates a tool for editing text. Must have name "str_replace_based_edit_tool".
66
+ * Note: This version does not support the "undo_edit" command.
67
+ */
68
+ textEditor_20250429: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{
69
+ command: "view" | "create" | "str_replace" | "insert";
70
+ path: string;
71
+ file_text?: string;
72
+ insert_line?: number;
73
+ new_str?: string;
74
+ old_str?: string;
75
+ view_range?: number[];
76
+ }, {}>;
81
77
  /**
82
78
  * Creates a tool for executing actions on a computer. Must have name "computer".
83
79
  *