@ai-sdk/amazon-bedrock 3.0.30 → 3.0.32
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 +16 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +103 -92
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "@ai-sdk/provider-utils";
|
|
9
9
|
|
|
10
10
|
// src/version.ts
|
|
11
|
-
var VERSION = true ? "3.0.
|
|
11
|
+
var VERSION = true ? "3.0.32" : "0.0.0-test";
|
|
12
12
|
|
|
13
13
|
// src/bedrock-provider.ts
|
|
14
14
|
import { anthropicTools as anthropicTools2 } from "@ai-sdk/anthropic/internal";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
postJsonToApi,
|
|
23
23
|
resolve
|
|
24
24
|
} from "@ai-sdk/provider-utils";
|
|
25
|
-
import
|
|
25
|
+
import * as z3 from "zod/v4";
|
|
26
26
|
|
|
27
27
|
// src/bedrock-api-types.ts
|
|
28
28
|
var BEDROCK_CACHE_POINT = {
|
|
@@ -59,7 +59,7 @@ var BEDROCK_DOCUMENT_MIME_TYPES = {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
// src/bedrock-chat-options.ts
|
|
62
|
-
import
|
|
62
|
+
import * as z from "zod/v4";
|
|
63
63
|
var bedrockFilePartProviderOptions = z.object({
|
|
64
64
|
/**
|
|
65
65
|
* Citation configuration for this document.
|
|
@@ -86,7 +86,7 @@ var bedrockProviderOptions = z.object({
|
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
// src/bedrock-error.ts
|
|
89
|
-
import
|
|
89
|
+
import * as z2 from "zod/v4";
|
|
90
90
|
var BedrockErrorSchema = z2.object({
|
|
91
91
|
message: z2.string(),
|
|
92
92
|
type: z2.string().nullish()
|
|
@@ -329,6 +329,7 @@ async function shouldEnableCitations(providerMetadata) {
|
|
|
329
329
|
return (_b = (_a = bedrockOptions == null ? void 0 : bedrockOptions.citations) == null ? void 0 : _a.enabled) != null ? _b : false;
|
|
330
330
|
}
|
|
331
331
|
async function convertToBedrockChatMessages(prompt) {
|
|
332
|
+
var _a;
|
|
332
333
|
const blocks = groupIntoBlocks(prompt);
|
|
333
334
|
let system = [];
|
|
334
335
|
const messages = [];
|
|
@@ -394,7 +395,7 @@ async function convertToBedrockChatMessages(prompt) {
|
|
|
394
395
|
bedrockContent.push({
|
|
395
396
|
document: {
|
|
396
397
|
format: getBedrockDocumentFormat(part.mediaType),
|
|
397
|
-
name: generateDocumentName(),
|
|
398
|
+
name: (_a = part.filename) != null ? _a : generateDocumentName(),
|
|
398
399
|
source: { bytes: convertToBase64(part.data) },
|
|
399
400
|
...enableCitations && {
|
|
400
401
|
citations: { enabled: true }
|
|
@@ -1321,7 +1322,7 @@ import {
|
|
|
1321
1322
|
} from "@ai-sdk/provider-utils";
|
|
1322
1323
|
|
|
1323
1324
|
// src/bedrock-embedding-options.ts
|
|
1324
|
-
import
|
|
1325
|
+
import * as z4 from "zod/v4";
|
|
1325
1326
|
var bedrockEmbeddingProviderOptions = z4.object({
|
|
1326
1327
|
/**
|
|
1327
1328
|
The number of dimensions the resulting output embeddings should have (defaults to 1024).
|
|
@@ -1336,7 +1337,7 @@ var bedrockEmbeddingProviderOptions = z4.object({
|
|
|
1336
1337
|
});
|
|
1337
1338
|
|
|
1338
1339
|
// src/bedrock-embedding-model.ts
|
|
1339
|
-
import
|
|
1340
|
+
import * as z5 from "zod/v4";
|
|
1340
1341
|
var BedrockEmbeddingModel = class {
|
|
1341
1342
|
constructor(modelId, config) {
|
|
1342
1343
|
this.modelId = modelId;
|
|
@@ -1418,7 +1419,7 @@ var modelMaxImagesPerCall = {
|
|
|
1418
1419
|
};
|
|
1419
1420
|
|
|
1420
1421
|
// src/bedrock-image-model.ts
|
|
1421
|
-
import
|
|
1422
|
+
import * as z6 from "zod/v4";
|
|
1422
1423
|
var BedrockImageModel = class {
|
|
1423
1424
|
constructor(modelId, config) {
|
|
1424
1425
|
this.modelId = modelId;
|