@ai-sdk/anthropic 3.0.9 → 3.0.10

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.
@@ -678,6 +678,7 @@ var anthropicMessagesChunkSchema = (0, import_provider_utils2.lazySchema)(
678
678
  }).nullish()
679
679
  }),
680
680
  usage: import_v42.z.looseObject({
681
+ input_tokens: import_v42.z.number().nullish(),
681
682
  output_tokens: import_v42.z.number(),
682
683
  cache_creation_input_tokens: import_v42.z.number().nullish()
683
684
  })
@@ -3666,6 +3667,9 @@ var AnthropicMessagesLanguageModel = class {
3666
3667
  return;
3667
3668
  }
3668
3669
  case "message_delta": {
3670
+ if (value.usage.input_tokens != null && usage.input_tokens !== value.usage.input_tokens) {
3671
+ usage.input_tokens = value.usage.input_tokens;
3672
+ }
3669
3673
  usage.output_tokens = value.usage.output_tokens;
3670
3674
  finishReason = {
3671
3675
  unified: mapAnthropicStopReason({