@ai-sdk/anthropic 3.0.0-beta.93 → 3.0.0-beta.94

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,13 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.0-beta.94
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9549c9e]
8
+ - @ai-sdk/provider@3.0.0-beta.29
9
+ - @ai-sdk/provider-utils@4.0.0-beta.56
10
+
3
11
  ## 3.0.0-beta.93
4
12
 
5
13
  ### 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.0-beta.93" : "0.0.0-test";
35
+ var VERSION = true ? "3.0.0-beta.94" : "0.0.0-test";
36
36
 
37
37
  // src/anthropic-messages-language-model.ts
38
38
  var import_provider3 = require("@ai-sdk/provider");
@@ -57,29 +57,6 @@ var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorRe
57
57
  errorToMessage: (data) => data.error.message
58
58
  });
59
59
 
60
- // src/convert-anthropic-messages-usage.ts
61
- function convertAnthropicMessagesUsage(usage) {
62
- var _a, _b;
63
- const inputTokens = usage.input_tokens;
64
- const outputTokens = usage.output_tokens;
65
- const cacheCreationTokens = (_a = usage.cache_creation_input_tokens) != null ? _a : 0;
66
- const cacheReadTokens = (_b = usage.cache_read_input_tokens) != null ? _b : 0;
67
- return {
68
- inputTokens: {
69
- total: inputTokens + cacheCreationTokens + cacheReadTokens,
70
- noCache: inputTokens,
71
- cacheRead: cacheReadTokens,
72
- cacheWrite: cacheCreationTokens
73
- },
74
- outputTokens: {
75
- total: outputTokens,
76
- text: void 0,
77
- reasoning: void 0
78
- },
79
- raw: usage
80
- };
81
- }
82
-
83
60
  // src/anthropic-messages-api.ts
84
61
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
85
62
  var import_v42 = require("zod/v4");
@@ -1339,6 +1316,29 @@ async function prepareTools({
1339
1316
  }
1340
1317
  }
1341
1318
 
1319
+ // src/convert-anthropic-messages-usage.ts
1320
+ function convertAnthropicMessagesUsage(usage) {
1321
+ var _a, _b;
1322
+ const inputTokens = usage.input_tokens;
1323
+ const outputTokens = usage.output_tokens;
1324
+ const cacheCreationTokens = (_a = usage.cache_creation_input_tokens) != null ? _a : 0;
1325
+ const cacheReadTokens = (_b = usage.cache_read_input_tokens) != null ? _b : 0;
1326
+ return {
1327
+ inputTokens: {
1328
+ total: inputTokens + cacheCreationTokens + cacheReadTokens,
1329
+ noCache: inputTokens,
1330
+ cacheRead: cacheReadTokens,
1331
+ cacheWrite: cacheCreationTokens
1332
+ },
1333
+ outputTokens: {
1334
+ total: outputTokens,
1335
+ text: void 0,
1336
+ reasoning: void 0
1337
+ },
1338
+ raw: usage
1339
+ };
1340
+ }
1341
+
1342
1342
  // src/convert-to-anthropic-messages-prompt.ts
1343
1343
  var import_provider2 = require("@ai-sdk/provider");
1344
1344
  var import_provider_utils11 = require("@ai-sdk/provider-utils");