@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/internal/index.js
CHANGED
|
@@ -680,7 +680,8 @@ var anthropicMessagesChunkSchema = (0, import_provider_utils2.lazySchema)(
|
|
|
680
680
|
usage: import_v42.z.looseObject({
|
|
681
681
|
input_tokens: import_v42.z.number().nullish(),
|
|
682
682
|
output_tokens: import_v42.z.number(),
|
|
683
|
-
cache_creation_input_tokens: import_v42.z.number().nullish()
|
|
683
|
+
cache_creation_input_tokens: import_v42.z.number().nullish(),
|
|
684
|
+
cache_read_input_tokens: import_v42.z.number().nullish()
|
|
684
685
|
})
|
|
685
686
|
}),
|
|
686
687
|
import_v42.z.object({
|
|
@@ -1340,7 +1341,7 @@ function convertAnthropicMessagesUsage(usage) {
|
|
|
1340
1341
|
},
|
|
1341
1342
|
outputTokens: {
|
|
1342
1343
|
total: outputTokens,
|
|
1343
|
-
text:
|
|
1344
|
+
text: void 0,
|
|
1344
1345
|
reasoning: void 0
|
|
1345
1346
|
},
|
|
1346
1347
|
raw: usage
|
|
@@ -3795,6 +3796,13 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
3795
3796
|
usage.input_tokens = value.usage.input_tokens;
|
|
3796
3797
|
}
|
|
3797
3798
|
usage.output_tokens = value.usage.output_tokens;
|
|
3799
|
+
if (value.usage.cache_read_input_tokens != null) {
|
|
3800
|
+
usage.cache_read_input_tokens = value.usage.cache_read_input_tokens;
|
|
3801
|
+
}
|
|
3802
|
+
if (value.usage.cache_creation_input_tokens != null) {
|
|
3803
|
+
usage.cache_creation_input_tokens = value.usage.cache_creation_input_tokens;
|
|
3804
|
+
cacheCreationInputTokens = value.usage.cache_creation_input_tokens;
|
|
3805
|
+
}
|
|
3798
3806
|
finishReason = {
|
|
3799
3807
|
unified: mapAnthropicStopReason({
|
|
3800
3808
|
finishReason: value.delta.stop_reason,
|