@ai-sdk/anthropic 3.0.0-beta.97 → 3.0.0
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 +167 -0
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +13 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +13 -0
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,172 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dee8b05: ai SDK 6 beta
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 78928cb: release: start 5.1 beta
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 0c3b58b: fix(provider): add specificationVersion to ProviderV3
|
|
16
|
+
- 0adc679: feat(provider): shared spec v3
|
|
17
|
+
- 50b70d6: feat(anthropic): add programmatic tool calling
|
|
18
|
+
- b8ea36e: feat(provider/anthropic): Anthropic-native structured outputs
|
|
19
|
+
- ed537e1: Add support for pdf file in tool result in anthropic
|
|
20
|
+
- 2109385: 'fix(anthropic): Opus 4.5 `maxOutputTokens` bump `32000` -> `64000`'
|
|
21
|
+
- 7c4328e: Adds url-based pdf and image support for anthropic tool results
|
|
22
|
+
- 8d9e8ad: chore(provider): remove generics from EmbeddingModelV3
|
|
23
|
+
|
|
24
|
+
Before
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
model.textEmbeddingModel('my-model-id');
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
After
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
model.embeddingModel('my-model-id');
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- f33a018: chore: add model ID for Haiku 4.5
|
|
37
|
+
- b2dbfbf: add context_management for anthropic
|
|
38
|
+
- dce03c4: feat: tool input examples
|
|
39
|
+
- 2625a04: feat(openai); update spec for mcp approval
|
|
40
|
+
- 11e4abe: feat(provider/anthropic): web search tool updates
|
|
41
|
+
- f13958c: chore(antropic): allow custom names for provider-defined tools
|
|
42
|
+
- afb00e3: feat(provider/anthropic): add text_editor_20250728 tool support
|
|
43
|
+
|
|
44
|
+
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.
|
|
45
|
+
|
|
46
|
+
- 95f65c2: chore: use import \* from zod/v4
|
|
47
|
+
- 954c356: feat(openai): allow custom names for provider-defined tools
|
|
48
|
+
- 9e35785: fix(anthropic): send {} as tool input when streaming tool calls without arguments
|
|
49
|
+
- 544d4e8: chore(specification): rename v3 provider defined tool to provider tool
|
|
50
|
+
- a5f77a6: fix(anthropic): remove outdated tool name docs
|
|
51
|
+
- ca07285: feat(anthropic): add prompt caching validation
|
|
52
|
+
- a5a8db4: chore: add model ID for Sonnet 4.5
|
|
53
|
+
- 1742445: Support for custom provider name in google and anthropic providers
|
|
54
|
+
- e8109d3: feat: tool execution approval
|
|
55
|
+
- 87db851: fix(vertex/anthropic): passing beta header only for structured outputs
|
|
56
|
+
- f6603b7: fix(provider/anthropic): correct raw usage information
|
|
57
|
+
- ed329cb: feat: `Provider-V3`
|
|
58
|
+
- 3bd2689: feat: extended token usage
|
|
59
|
+
- 1cad0ab: feat: add provider version to user-agent header
|
|
60
|
+
- 2049c5b: Fix handling of error in web fetch tool in anthropic
|
|
61
|
+
- 4c5a6be: feat(provider/anthropic): default and limit maxTokens based on model
|
|
62
|
+
- 9e1e758: fix(anthropic): use default thinking budget when unspecified
|
|
63
|
+
- 589a4ee: fix(anthropic): simplify pulling first chunk
|
|
64
|
+
- 8dac895: feat: `LanguageModelV3`
|
|
65
|
+
- 6f845b4: Add support for 2025-08-25 code execution tool
|
|
66
|
+
- 9354297: feat(provider/anthropic): add support for Agent Skills
|
|
67
|
+
- 03849b0: throw 500 error when the first stream chunk is an error
|
|
68
|
+
- 0ae783e: feat(anthropic): add the new tool search tools
|
|
69
|
+
- 457318b: chore(provider,ai): switch to SharedV3Warning and unified warnings
|
|
70
|
+
- eb56fc6: fix(anthropic): pull first chunk without async IIFE
|
|
71
|
+
- fa35e95: feat(provider/anthropic): add web fetch tool
|
|
72
|
+
- 80894b3: add return `file_id` property for anthropic code-execution-20250825 to download output files.
|
|
73
|
+
- 366f50b: chore(provider): add deprecated textEmbeddingModel and textEmbedding aliases
|
|
74
|
+
- 81d4308: feat(provider/anthropic): mcp connector support
|
|
75
|
+
- 6fc35cb: Retain user-supplied betas.
|
|
76
|
+
- f4db7b5: feat(provider/anthropic): expose container from response in provider metadata
|
|
77
|
+
- 6c38080: fix(anthropic): support pdf responses in web_fetch_tool_result schema validation
|
|
78
|
+
- 4616b86: chore: update zod peer depenedency version
|
|
79
|
+
- dedf206: feat(provider/anthropic): expose stop_sequence in provider metadata
|
|
80
|
+
- 983e394: chore(provider/anthropic): add missing provider options jsdoc
|
|
81
|
+
- 0e38a79: support ANTHROPIC_BASE_URL
|
|
82
|
+
- cf4e2a9: Add support for tool calling with structured output
|
|
83
|
+
- f4e4a95: feat(provider/anthropic): enable fine grained tool streaming by default
|
|
84
|
+
- 21f378c: fix(provider/anthropic): do not limit maxTokens when model id is unknown
|
|
85
|
+
- c5440c5: chore(provider/anthropic): update anthropic model ids
|
|
86
|
+
- 1d15673: fix(provider/anthropic): clamp temperature to valid 0-1 range with warnings
|
|
87
|
+
- 9cff587: chore(provider/anthropic): lazy schema loading
|
|
88
|
+
- d129d89: chore(anthropic): remove unnecessary doc
|
|
89
|
+
- 3794514: feat: flexible tool output content support
|
|
90
|
+
- e1e2821: fix(provider/anthropic): support null title in web fetch tool
|
|
91
|
+
- cbf52cd: feat: expose raw finish reason
|
|
92
|
+
- 10c1322: fix: moved dependency `@ai-sdk/test-server` to devDependencies
|
|
93
|
+
- d08308b: feat(provider/anthropic): memory tool
|
|
94
|
+
- 05d5b9a: fix(anthropic): make title field nullable in web_fetch and web_search tool output schemas
|
|
95
|
+
- 1bd7d32: feat: tool-specific strict mode
|
|
96
|
+
- 83aaad8: Opus 4.5 and `effort` provider option
|
|
97
|
+
- Updated dependencies [0c3b58b]
|
|
98
|
+
- Updated dependencies [0adc679]
|
|
99
|
+
- Updated dependencies [50b70d6]
|
|
100
|
+
- Updated dependencies [d1bdadb]
|
|
101
|
+
- Updated dependencies [dee8b05]
|
|
102
|
+
- Updated dependencies [046aa3b]
|
|
103
|
+
- Updated dependencies [8d9e8ad]
|
|
104
|
+
- Updated dependencies [78928cb]
|
|
105
|
+
- Updated dependencies [dce03c4]
|
|
106
|
+
- Updated dependencies [2625a04]
|
|
107
|
+
- Updated dependencies [37c58a0]
|
|
108
|
+
- Updated dependencies [3b1d015]
|
|
109
|
+
- Updated dependencies [2b0caef]
|
|
110
|
+
- Updated dependencies [95f65c2]
|
|
111
|
+
- Updated dependencies [016b111]
|
|
112
|
+
- Updated dependencies [58920e0]
|
|
113
|
+
- Updated dependencies [954c356]
|
|
114
|
+
- Updated dependencies [544d4e8]
|
|
115
|
+
- Updated dependencies [0c4822d]
|
|
116
|
+
- Updated dependencies [521c537]
|
|
117
|
+
- Updated dependencies [4c44a5b]
|
|
118
|
+
- Updated dependencies [e8109d3]
|
|
119
|
+
- Updated dependencies [03849b0]
|
|
120
|
+
- Updated dependencies [ed329cb]
|
|
121
|
+
- Updated dependencies [e06565c]
|
|
122
|
+
- Updated dependencies [32d8dbb]
|
|
123
|
+
- Updated dependencies [53f3368]
|
|
124
|
+
- Updated dependencies [d116b4b]
|
|
125
|
+
- Updated dependencies [3bd2689]
|
|
126
|
+
- Updated dependencies [293a6b7]
|
|
127
|
+
- Updated dependencies [703459a]
|
|
128
|
+
- Updated dependencies [bb36798]
|
|
129
|
+
- Updated dependencies [83e5744]
|
|
130
|
+
- Updated dependencies [7e32fea]
|
|
131
|
+
- Updated dependencies [3ed5519]
|
|
132
|
+
- Updated dependencies [8dac895]
|
|
133
|
+
- Updated dependencies [a755db5]
|
|
134
|
+
- Updated dependencies [cbb1d35]
|
|
135
|
+
- Updated dependencies [475189e]
|
|
136
|
+
- Updated dependencies [457318b]
|
|
137
|
+
- Updated dependencies [b681d7d]
|
|
138
|
+
- Updated dependencies [db913bd]
|
|
139
|
+
- Updated dependencies [9061dc0]
|
|
140
|
+
- Updated dependencies [32223c8]
|
|
141
|
+
- Updated dependencies [c1efac4]
|
|
142
|
+
- Updated dependencies [366f50b]
|
|
143
|
+
- Updated dependencies [4616b86]
|
|
144
|
+
- Updated dependencies [81d4308]
|
|
145
|
+
- Updated dependencies [9549c9e]
|
|
146
|
+
- Updated dependencies [af3780b]
|
|
147
|
+
- Updated dependencies [4f16c37]
|
|
148
|
+
- Updated dependencies [81e29ab]
|
|
149
|
+
- Updated dependencies [522f6b8]
|
|
150
|
+
- Updated dependencies [6306603]
|
|
151
|
+
- Updated dependencies [fca786b]
|
|
152
|
+
- Updated dependencies [763d04a]
|
|
153
|
+
- Updated dependencies [10d819b]
|
|
154
|
+
- Updated dependencies [3794514]
|
|
155
|
+
- Updated dependencies [cbf52cd]
|
|
156
|
+
- Updated dependencies [e9e157f]
|
|
157
|
+
- Updated dependencies [960ec8f]
|
|
158
|
+
- Updated dependencies [1bd7d32]
|
|
159
|
+
- Updated dependencies [f0b2157]
|
|
160
|
+
- Updated dependencies [95f65c2]
|
|
161
|
+
- @ai-sdk/provider@3.0.0
|
|
162
|
+
- @ai-sdk/provider-utils@4.0.0
|
|
163
|
+
|
|
164
|
+
## 3.0.0-beta.98
|
|
165
|
+
|
|
166
|
+
### Patch Changes
|
|
167
|
+
|
|
168
|
+
- 2049c5b: Fix handling of error in web fetch tool in anthropic
|
|
169
|
+
|
|
3
170
|
## 3.0.0-beta.97
|
|
4
171
|
|
|
5
172
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
|
|
|
32
32
|
var import_provider_utils22 = require("@ai-sdk/provider-utils");
|
|
33
33
|
|
|
34
34
|
// src/version.ts
|
|
35
|
-
var VERSION = true ? "3.0.0
|
|
35
|
+
var VERSION = true ? "3.0.0" : "0.0.0-test";
|
|
36
36
|
|
|
37
37
|
// src/anthropic-messages-language-model.ts
|
|
38
38
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -2106,6 +2106,19 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
2106
2106
|
}
|
|
2107
2107
|
if (providerToolName === "web_fetch") {
|
|
2108
2108
|
const output = part.output;
|
|
2109
|
+
if (output.type === "error-json") {
|
|
2110
|
+
const errorValue = JSON.parse(output.value);
|
|
2111
|
+
anthropicContent.push({
|
|
2112
|
+
type: "web_fetch_tool_result",
|
|
2113
|
+
tool_use_id: part.toolCallId,
|
|
2114
|
+
content: {
|
|
2115
|
+
type: "web_fetch_tool_result_error",
|
|
2116
|
+
error_code: errorValue.errorCode
|
|
2117
|
+
},
|
|
2118
|
+
cache_control: cacheControl
|
|
2119
|
+
});
|
|
2120
|
+
break;
|
|
2121
|
+
}
|
|
2109
2122
|
if (output.type !== "json") {
|
|
2110
2123
|
warnings.push({
|
|
2111
2124
|
type: "other",
|