@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/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "@ai-sdk/provider-utils";
|
|
12
12
|
|
|
13
13
|
// src/version.ts
|
|
14
|
-
var VERSION = true ? "3.0.0-beta.
|
|
14
|
+
var VERSION = true ? "3.0.0-beta.94" : "0.0.0-test";
|
|
15
15
|
|
|
16
16
|
// src/anthropic-messages-language-model.ts
|
|
17
17
|
import {
|
|
@@ -51,29 +51,6 @@ var anthropicFailedResponseHandler = createJsonErrorResponseHandler({
|
|
|
51
51
|
errorToMessage: (data) => data.error.message
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
// src/convert-anthropic-messages-usage.ts
|
|
55
|
-
function convertAnthropicMessagesUsage(usage) {
|
|
56
|
-
var _a, _b;
|
|
57
|
-
const inputTokens = usage.input_tokens;
|
|
58
|
-
const outputTokens = usage.output_tokens;
|
|
59
|
-
const cacheCreationTokens = (_a = usage.cache_creation_input_tokens) != null ? _a : 0;
|
|
60
|
-
const cacheReadTokens = (_b = usage.cache_read_input_tokens) != null ? _b : 0;
|
|
61
|
-
return {
|
|
62
|
-
inputTokens: {
|
|
63
|
-
total: inputTokens + cacheCreationTokens + cacheReadTokens,
|
|
64
|
-
noCache: inputTokens,
|
|
65
|
-
cacheRead: cacheReadTokens,
|
|
66
|
-
cacheWrite: cacheCreationTokens
|
|
67
|
-
},
|
|
68
|
-
outputTokens: {
|
|
69
|
-
total: outputTokens,
|
|
70
|
-
text: void 0,
|
|
71
|
-
reasoning: void 0
|
|
72
|
-
},
|
|
73
|
-
raw: usage
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
54
|
// src/anthropic-messages-api.ts
|
|
78
55
|
import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
|
|
79
56
|
import { z as z2 } from "zod/v4";
|
|
@@ -1343,6 +1320,29 @@ async function prepareTools({
|
|
|
1343
1320
|
}
|
|
1344
1321
|
}
|
|
1345
1322
|
|
|
1323
|
+
// src/convert-anthropic-messages-usage.ts
|
|
1324
|
+
function convertAnthropicMessagesUsage(usage) {
|
|
1325
|
+
var _a, _b;
|
|
1326
|
+
const inputTokens = usage.input_tokens;
|
|
1327
|
+
const outputTokens = usage.output_tokens;
|
|
1328
|
+
const cacheCreationTokens = (_a = usage.cache_creation_input_tokens) != null ? _a : 0;
|
|
1329
|
+
const cacheReadTokens = (_b = usage.cache_read_input_tokens) != null ? _b : 0;
|
|
1330
|
+
return {
|
|
1331
|
+
inputTokens: {
|
|
1332
|
+
total: inputTokens + cacheCreationTokens + cacheReadTokens,
|
|
1333
|
+
noCache: inputTokens,
|
|
1334
|
+
cacheRead: cacheReadTokens,
|
|
1335
|
+
cacheWrite: cacheCreationTokens
|
|
1336
|
+
},
|
|
1337
|
+
outputTokens: {
|
|
1338
|
+
total: outputTokens,
|
|
1339
|
+
text: void 0,
|
|
1340
|
+
reasoning: void 0
|
|
1341
|
+
},
|
|
1342
|
+
raw: usage
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
1346
|
// src/convert-to-anthropic-messages-prompt.ts
|
|
1347
1347
|
import {
|
|
1348
1348
|
UnsupportedFunctionalityError as UnsupportedFunctionalityError2
|