@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.
@@ -36,29 +36,6 @@ var anthropicFailedResponseHandler = createJsonErrorResponseHandler({
36
36
  errorToMessage: (data) => data.error.message
37
37
  });
38
38
 
39
- // src/convert-anthropic-messages-usage.ts
40
- function convertAnthropicMessagesUsage(usage) {
41
- var _a, _b;
42
- const inputTokens = usage.input_tokens;
43
- const outputTokens = usage.output_tokens;
44
- const cacheCreationTokens = (_a = usage.cache_creation_input_tokens) != null ? _a : 0;
45
- const cacheReadTokens = (_b = usage.cache_read_input_tokens) != null ? _b : 0;
46
- return {
47
- inputTokens: {
48
- total: inputTokens + cacheCreationTokens + cacheReadTokens,
49
- noCache: inputTokens,
50
- cacheRead: cacheReadTokens,
51
- cacheWrite: cacheCreationTokens
52
- },
53
- outputTokens: {
54
- total: outputTokens,
55
- text: void 0,
56
- reasoning: void 0
57
- },
58
- raw: usage
59
- };
60
- }
61
-
62
39
  // src/anthropic-messages-api.ts
63
40
  import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
64
41
  import { z as z2 } from "zod/v4";
@@ -1328,6 +1305,29 @@ async function prepareTools({
1328
1305
  }
1329
1306
  }
1330
1307
 
1308
+ // src/convert-anthropic-messages-usage.ts
1309
+ function convertAnthropicMessagesUsage(usage) {
1310
+ var _a, _b;
1311
+ const inputTokens = usage.input_tokens;
1312
+ const outputTokens = usage.output_tokens;
1313
+ const cacheCreationTokens = (_a = usage.cache_creation_input_tokens) != null ? _a : 0;
1314
+ const cacheReadTokens = (_b = usage.cache_read_input_tokens) != null ? _b : 0;
1315
+ return {
1316
+ inputTokens: {
1317
+ total: inputTokens + cacheCreationTokens + cacheReadTokens,
1318
+ noCache: inputTokens,
1319
+ cacheRead: cacheReadTokens,
1320
+ cacheWrite: cacheCreationTokens
1321
+ },
1322
+ outputTokens: {
1323
+ total: outputTokens,
1324
+ text: void 0,
1325
+ reasoning: void 0
1326
+ },
1327
+ raw: usage
1328
+ };
1329
+ }
1330
+
1331
1331
  // src/convert-to-anthropic-messages-prompt.ts
1332
1332
  import {
1333
1333
  UnsupportedFunctionalityError as UnsupportedFunctionalityError2