@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 +8 -0
- package/dist/index.js +24 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -24
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +3 -3
- package/dist/internal/index.d.ts +3 -3
- package/dist/internal/index.js +23 -23
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +23 -23
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
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.
|
|
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");
|