@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.
@@ -667,7 +667,8 @@ var anthropicMessagesChunkSchema = lazySchema2(
667
667
  usage: z2.looseObject({
668
668
  input_tokens: z2.number().nullish(),
669
669
  output_tokens: z2.number(),
670
- cache_creation_input_tokens: z2.number().nullish()
670
+ cache_creation_input_tokens: z2.number().nullish(),
671
+ cache_read_input_tokens: z2.number().nullish()
671
672
  })
672
673
  }),
673
674
  z2.object({
@@ -1337,7 +1338,7 @@ function convertAnthropicMessagesUsage(usage) {
1337
1338
  },
1338
1339
  outputTokens: {
1339
1340
  total: outputTokens,
1340
- text: outputTokens,
1341
+ text: void 0,
1341
1342
  reasoning: void 0
1342
1343
  },
1343
1344
  raw: usage
@@ -3811,6 +3812,13 @@ var AnthropicMessagesLanguageModel = class {
3811
3812
  usage.input_tokens = value.usage.input_tokens;
3812
3813
  }
3813
3814
  usage.output_tokens = value.usage.output_tokens;
3815
+ if (value.usage.cache_read_input_tokens != null) {
3816
+ usage.cache_read_input_tokens = value.usage.cache_read_input_tokens;
3817
+ }
3818
+ if (value.usage.cache_creation_input_tokens != null) {
3819
+ usage.cache_creation_input_tokens = value.usage.cache_creation_input_tokens;
3820
+ cacheCreationInputTokens = value.usage.cache_creation_input_tokens;
3821
+ }
3814
3822
  finishReason = {
3815
3823
  unified: mapAnthropicStopReason({
3816
3824
  finishReason: value.delta.stop_reason,