@ai-sdk/anthropic 3.0.28 → 3.0.30
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 +12 -0
- package/README.md +8 -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 +1 -1
- 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/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "@ai-sdk/provider-utils";
|
|
13
13
|
|
|
14
14
|
// src/version.ts
|
|
15
|
-
var VERSION = true ? "3.0.
|
|
15
|
+
var VERSION = true ? "3.0.30" : "0.0.0-test";
|
|
16
16
|
|
|
17
17
|
// src/anthropic-messages-language-model.ts
|
|
18
18
|
import {
|
|
@@ -683,7 +683,8 @@ var anthropicMessagesChunkSchema = lazySchema2(
|
|
|
683
683
|
usage: z2.looseObject({
|
|
684
684
|
input_tokens: z2.number().nullish(),
|
|
685
685
|
output_tokens: z2.number(),
|
|
686
|
-
cache_creation_input_tokens: z2.number().nullish()
|
|
686
|
+
cache_creation_input_tokens: z2.number().nullish(),
|
|
687
|
+
cache_read_input_tokens: z2.number().nullish()
|
|
687
688
|
})
|
|
688
689
|
}),
|
|
689
690
|
z2.object({
|
|
@@ -1353,7 +1354,7 @@ function convertAnthropicMessagesUsage(usage) {
|
|
|
1353
1354
|
},
|
|
1354
1355
|
outputTokens: {
|
|
1355
1356
|
total: outputTokens,
|
|
1356
|
-
text:
|
|
1357
|
+
text: void 0,
|
|
1357
1358
|
reasoning: void 0
|
|
1358
1359
|
},
|
|
1359
1360
|
raw: usage
|
|
@@ -3827,6 +3828,13 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3827
3828
|
usage.input_tokens = value.usage.input_tokens;
|
|
3828
3829
|
}
|
|
3829
3830
|
usage.output_tokens = value.usage.output_tokens;
|
|
3831
|
+
if (value.usage.cache_read_input_tokens != null) {
|
|
3832
|
+
usage.cache_read_input_tokens = value.usage.cache_read_input_tokens;
|
|
3833
|
+
}
|
|
3834
|
+
if (value.usage.cache_creation_input_tokens != null) {
|
|
3835
|
+
usage.cache_creation_input_tokens = value.usage.cache_creation_input_tokens;
|
|
3836
|
+
cacheCreationInputTokens = value.usage.cache_creation_input_tokens;
|
|
3837
|
+
}
|
|
3830
3838
|
finishReason = {
|
|
3831
3839
|
unified: mapAnthropicStopReason({
|
|
3832
3840
|
finishReason: value.delta.stop_reason,
|