@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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 02d9b68: fix `input_tokens` compatibility
8
+
3
9
  ## 3.0.9
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
32
32
  var import_provider_utils22 = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "3.0.9" : "0.0.0-test";
35
+ var VERSION = true ? "3.0.10" : "0.0.0-test";
36
36
 
37
37
  // src/anthropic-messages-language-model.ts
38
38
  var import_provider3 = require("@ai-sdk/provider");
@@ -686,6 +686,7 @@ var anthropicMessagesChunkSchema = (0, import_provider_utils2.lazySchema)(
686
686
  }).nullish()
687
687
  }),
688
688
  usage: import_v42.z.looseObject({
689
+ input_tokens: import_v42.z.number().nullish(),
689
690
  output_tokens: import_v42.z.number(),
690
691
  cache_creation_input_tokens: import_v42.z.number().nullish()
691
692
  })
@@ -3674,6 +3675,9 @@ var AnthropicMessagesLanguageModel = class {
3674
3675
  return;
3675
3676
  }
3676
3677
  case "message_delta": {
3678
+ if (value.usage.input_tokens != null && usage.input_tokens !== value.usage.input_tokens) {
3679
+ usage.input_tokens = value.usage.input_tokens;
3680
+ }
3677
3681
  usage.output_tokens = value.usage.output_tokens;
3678
3682
  finishReason = {
3679
3683
  unified: mapAnthropicStopReason({