@ai-sdk/amazon-bedrock 4.0.0-beta.103 → 4.0.0-beta.105

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,22 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 4.0.0-beta.105
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9549c9e]
8
+ - @ai-sdk/provider@3.0.0-beta.29
9
+ - @ai-sdk/anthropic@3.0.0-beta.94
10
+ - @ai-sdk/provider-utils@4.0.0-beta.56
11
+
12
+ ## 4.0.0-beta.104
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [50b70d6]
17
+ - @ai-sdk/provider-utils@4.0.0-beta.55
18
+ - @ai-sdk/anthropic@3.0.0-beta.93
19
+
3
20
  ## 4.0.0-beta.103
4
21
 
5
22
  ### Patch Changes
package/dist/index.js CHANGED
@@ -107,45 +107,6 @@ var BedrockErrorSchema = import_v42.z.object({
107
107
  type: import_v42.z.string().nullish()
108
108
  });
109
109
 
110
- // src/convert-bedrock-usage.ts
111
- function convertBedrockUsage(usage) {
112
- var _a, _b;
113
- if (usage == null) {
114
- return {
115
- inputTokens: {
116
- total: void 0,
117
- noCache: void 0,
118
- cacheRead: void 0,
119
- cacheWrite: void 0
120
- },
121
- outputTokens: {
122
- total: void 0,
123
- text: void 0,
124
- reasoning: void 0
125
- },
126
- raw: void 0
127
- };
128
- }
129
- const inputTokens = usage.inputTokens;
130
- const outputTokens = usage.outputTokens;
131
- const cacheReadTokens = (_a = usage.cacheReadInputTokens) != null ? _a : 0;
132
- const cacheWriteTokens = (_b = usage.cacheWriteInputTokens) != null ? _b : 0;
133
- return {
134
- inputTokens: {
135
- total: inputTokens,
136
- noCache: inputTokens - cacheReadTokens,
137
- cacheRead: cacheReadTokens,
138
- cacheWrite: cacheWriteTokens
139
- },
140
- outputTokens: {
141
- total: outputTokens,
142
- text: outputTokens,
143
- reasoning: void 0
144
- },
145
- raw: usage
146
- };
147
- }
148
-
149
110
  // src/bedrock-event-stream-response-handler.ts
150
111
  var import_provider = require("@ai-sdk/provider");
151
112
  var import_provider_utils = require("@ai-sdk/provider-utils");
@@ -355,6 +316,45 @@ async function prepareTools({
355
316
  };
356
317
  }
357
318
 
319
+ // src/convert-bedrock-usage.ts
320
+ function convertBedrockUsage(usage) {
321
+ var _a, _b;
322
+ if (usage == null) {
323
+ return {
324
+ inputTokens: {
325
+ total: void 0,
326
+ noCache: void 0,
327
+ cacheRead: void 0,
328
+ cacheWrite: void 0
329
+ },
330
+ outputTokens: {
331
+ total: void 0,
332
+ text: void 0,
333
+ reasoning: void 0
334
+ },
335
+ raw: void 0
336
+ };
337
+ }
338
+ const inputTokens = usage.inputTokens;
339
+ const outputTokens = usage.outputTokens;
340
+ const cacheReadTokens = (_a = usage.cacheReadInputTokens) != null ? _a : 0;
341
+ const cacheWriteTokens = (_b = usage.cacheWriteInputTokens) != null ? _b : 0;
342
+ return {
343
+ inputTokens: {
344
+ total: inputTokens,
345
+ noCache: inputTokens - cacheReadTokens,
346
+ cacheRead: cacheReadTokens,
347
+ cacheWrite: cacheWriteTokens
348
+ },
349
+ outputTokens: {
350
+ total: outputTokens,
351
+ text: outputTokens,
352
+ reasoning: void 0
353
+ },
354
+ raw: usage
355
+ };
356
+ }
357
+
358
358
  // src/convert-to-bedrock-chat-messages.ts
359
359
  var import_provider3 = require("@ai-sdk/provider");
360
360
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
@@ -1717,7 +1717,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
1717
1717
  var import_aws4fetch = require("aws4fetch");
1718
1718
 
1719
1719
  // src/version.ts
1720
- var VERSION = true ? "4.0.0-beta.103" : "0.0.0-test";
1720
+ var VERSION = true ? "4.0.0-beta.105" : "0.0.0-test";
1721
1721
 
1722
1722
  // src/bedrock-sigv4-fetch.ts
1723
1723
  function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {