@ai-sdk/anthropic 3.0.28 → 3.0.29
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 +6 -0
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +10 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +10 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/anthropic-messages-api.ts +1 -0
- package/src/anthropic-messages-language-model.ts +11 -0
- package/src/convert-anthropic-messages-usage.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/anthropic",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.29",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/provider": "
|
|
40
|
-
"@ai-sdk/provider
|
|
39
|
+
"@ai-sdk/provider-utils": "4.0.10",
|
|
40
|
+
"@ai-sdk/provider": "3.0.5"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "20.17.24",
|
|
@@ -1165,6 +1165,7 @@ export const anthropicMessagesChunkSchema = lazySchema(() =>
|
|
|
1165
1165
|
input_tokens: z.number().nullish(),
|
|
1166
1166
|
output_tokens: z.number(),
|
|
1167
1167
|
cache_creation_input_tokens: z.number().nullish(),
|
|
1168
|
+
cache_read_input_tokens: z.number().nullish(),
|
|
1168
1169
|
}),
|
|
1169
1170
|
}),
|
|
1170
1171
|
z.object({
|
|
@@ -1947,6 +1947,17 @@ export class AnthropicMessagesLanguageModel implements LanguageModelV3 {
|
|
|
1947
1947
|
}
|
|
1948
1948
|
usage.output_tokens = value.usage.output_tokens;
|
|
1949
1949
|
|
|
1950
|
+
if (value.usage.cache_read_input_tokens != null) {
|
|
1951
|
+
usage.cache_read_input_tokens =
|
|
1952
|
+
value.usage.cache_read_input_tokens;
|
|
1953
|
+
}
|
|
1954
|
+
if (value.usage.cache_creation_input_tokens != null) {
|
|
1955
|
+
usage.cache_creation_input_tokens =
|
|
1956
|
+
value.usage.cache_creation_input_tokens;
|
|
1957
|
+
cacheCreationInputTokens =
|
|
1958
|
+
value.usage.cache_creation_input_tokens;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1950
1961
|
finishReason = {
|
|
1951
1962
|
unified: mapAnthropicStopReason({
|
|
1952
1963
|
finishReason: value.delta.stop_reason,
|