@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/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.28" : "0.0.0-test";
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: outputTokens,
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,