@ai-sdk/amazon-bedrock 4.0.97 → 4.0.99
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 +20 -0
- package/dist/anthropic/index.js +1 -1
- package/dist/anthropic/index.js.map +1 -1
- package/dist/anthropic/index.mjs +1 -1
- package/dist/anthropic/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +129 -124
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +129 -124
- package/dist/index.mjs.map +1 -1
- package/docs/08-amazon-bedrock.mdx +13 -15
- package/package.json +5 -5
- package/src/anthropic/bedrock-anthropic-fetch.ts +1 -1
- package/src/anthropic/bedrock-anthropic-provider.ts +6 -6
- package/src/bedrock-api-types.ts +1 -1
- package/src/bedrock-chat-language-model.ts +16 -16
- package/src/bedrock-embedding-model.ts +4 -4
- package/src/bedrock-event-stream-response-handler.ts +3 -3
- package/src/bedrock-image-model.ts +4 -4
- package/src/bedrock-prepare-tools.ts +7 -4
- package/src/bedrock-provider.ts +18 -13
- package/src/bedrock-reasoning-metadata.ts +10 -0
- package/src/bedrock-sigv4-fetch.ts +1 -1
- package/src/convert-bedrock-usage.ts +1 -1
- package/src/convert-to-bedrock-chat-messages.ts +28 -17
- package/src/map-bedrock-finish-reason.ts +2 -2
- package/src/reranking/bedrock-reranking-model.ts +5 -5
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
postJsonToApi,
|
|
18
18
|
resolve
|
|
19
19
|
} from "@ai-sdk/provider-utils";
|
|
20
|
-
import { z as
|
|
20
|
+
import { z as z4 } from "zod/v4";
|
|
21
21
|
|
|
22
22
|
// src/bedrock-api-types.ts
|
|
23
23
|
var BEDROCK_STOP_REASONS = [
|
|
@@ -381,6 +381,13 @@ import {
|
|
|
381
381
|
stripFileExtension
|
|
382
382
|
} from "@ai-sdk/provider-utils";
|
|
383
383
|
|
|
384
|
+
// src/bedrock-reasoning-metadata.ts
|
|
385
|
+
import { z as z3 } from "zod/v4";
|
|
386
|
+
var bedrockReasoningMetadataSchema = z3.object({
|
|
387
|
+
signature: z3.string().optional(),
|
|
388
|
+
redactedData: z3.string().optional()
|
|
389
|
+
});
|
|
390
|
+
|
|
384
391
|
// src/normalize-tool-call-id.ts
|
|
385
392
|
function isMistralModel(modelId) {
|
|
386
393
|
return modelId.includes("mistral.");
|
|
@@ -624,7 +631,9 @@ async function convertToBedrockChatMessages(prompt, isMistral = false) {
|
|
|
624
631
|
}
|
|
625
632
|
}
|
|
626
633
|
});
|
|
627
|
-
} else
|
|
634
|
+
} else if (part.providerOptions == null || Object.keys(part.providerOptions).every(
|
|
635
|
+
(k2) => k2 === "bedrock" || k2 === "amazonBedrock"
|
|
636
|
+
)) {
|
|
628
637
|
bedrockContent.push({
|
|
629
638
|
reasoningContent: {
|
|
630
639
|
reasoningText: {
|
|
@@ -1483,116 +1492,112 @@ var BedrockChatLanguageModel = class {
|
|
|
1483
1492
|
return `${this.config.baseUrl()}/model/${encodedModelId}`;
|
|
1484
1493
|
}
|
|
1485
1494
|
};
|
|
1486
|
-
var BedrockStopReasonSchema =
|
|
1487
|
-
|
|
1488
|
-
|
|
1495
|
+
var BedrockStopReasonSchema = z4.union([
|
|
1496
|
+
z4.enum(BEDROCK_STOP_REASONS),
|
|
1497
|
+
z4.string()
|
|
1489
1498
|
]);
|
|
1490
|
-
var BedrockAdditionalModelResponseFieldsSchema =
|
|
1491
|
-
delta:
|
|
1492
|
-
stop_sequence:
|
|
1499
|
+
var BedrockAdditionalModelResponseFieldsSchema = z4.object({
|
|
1500
|
+
delta: z4.object({
|
|
1501
|
+
stop_sequence: z4.string().nullish()
|
|
1493
1502
|
}).nullish()
|
|
1494
|
-
}).catchall(
|
|
1495
|
-
var BedrockToolUseSchema =
|
|
1496
|
-
toolUseId:
|
|
1497
|
-
name:
|
|
1498
|
-
input:
|
|
1503
|
+
}).catchall(z4.unknown());
|
|
1504
|
+
var BedrockToolUseSchema = z4.object({
|
|
1505
|
+
toolUseId: z4.string(),
|
|
1506
|
+
name: z4.string(),
|
|
1507
|
+
input: z4.unknown()
|
|
1499
1508
|
});
|
|
1500
|
-
var BedrockReasoningTextSchema =
|
|
1501
|
-
signature:
|
|
1502
|
-
text:
|
|
1509
|
+
var BedrockReasoningTextSchema = z4.object({
|
|
1510
|
+
signature: z4.string().nullish(),
|
|
1511
|
+
text: z4.string()
|
|
1503
1512
|
});
|
|
1504
|
-
var BedrockRedactedReasoningSchema =
|
|
1505
|
-
data:
|
|
1513
|
+
var BedrockRedactedReasoningSchema = z4.object({
|
|
1514
|
+
data: z4.string()
|
|
1506
1515
|
});
|
|
1507
|
-
var BedrockResponseSchema =
|
|
1508
|
-
metrics:
|
|
1509
|
-
latencyMs:
|
|
1516
|
+
var BedrockResponseSchema = z4.object({
|
|
1517
|
+
metrics: z4.object({
|
|
1518
|
+
latencyMs: z4.number()
|
|
1510
1519
|
}).nullish(),
|
|
1511
|
-
output:
|
|
1512
|
-
message:
|
|
1513
|
-
content:
|
|
1514
|
-
|
|
1515
|
-
text:
|
|
1520
|
+
output: z4.object({
|
|
1521
|
+
message: z4.object({
|
|
1522
|
+
content: z4.array(
|
|
1523
|
+
z4.object({
|
|
1524
|
+
text: z4.string().nullish(),
|
|
1516
1525
|
toolUse: BedrockToolUseSchema.nullish(),
|
|
1517
|
-
reasoningContent:
|
|
1518
|
-
|
|
1526
|
+
reasoningContent: z4.union([
|
|
1527
|
+
z4.object({
|
|
1519
1528
|
reasoningText: BedrockReasoningTextSchema
|
|
1520
1529
|
}),
|
|
1521
|
-
|
|
1530
|
+
z4.object({
|
|
1522
1531
|
redactedReasoning: BedrockRedactedReasoningSchema
|
|
1523
1532
|
})
|
|
1524
1533
|
]).nullish()
|
|
1525
1534
|
})
|
|
1526
1535
|
),
|
|
1527
|
-
role:
|
|
1536
|
+
role: z4.string()
|
|
1528
1537
|
})
|
|
1529
1538
|
}),
|
|
1530
1539
|
stopReason: BedrockStopReasonSchema,
|
|
1531
1540
|
additionalModelResponseFields: BedrockAdditionalModelResponseFieldsSchema.nullish(),
|
|
1532
|
-
trace:
|
|
1533
|
-
performanceConfig:
|
|
1534
|
-
serviceTier:
|
|
1535
|
-
usage:
|
|
1536
|
-
inputTokens:
|
|
1537
|
-
outputTokens:
|
|
1538
|
-
totalTokens:
|
|
1539
|
-
cacheReadInputTokens:
|
|
1540
|
-
cacheWriteInputTokens:
|
|
1541
|
-
cacheDetails:
|
|
1541
|
+
trace: z4.unknown().nullish(),
|
|
1542
|
+
performanceConfig: z4.object({ latency: z4.string() }).nullish(),
|
|
1543
|
+
serviceTier: z4.object({ type: z4.string() }).nullish(),
|
|
1544
|
+
usage: z4.object({
|
|
1545
|
+
inputTokens: z4.number(),
|
|
1546
|
+
outputTokens: z4.number(),
|
|
1547
|
+
totalTokens: z4.number(),
|
|
1548
|
+
cacheReadInputTokens: z4.number().nullish(),
|
|
1549
|
+
cacheWriteInputTokens: z4.number().nullish(),
|
|
1550
|
+
cacheDetails: z4.array(z4.object({ inputTokens: z4.number(), ttl: z4.string() })).nullish()
|
|
1542
1551
|
})
|
|
1543
1552
|
});
|
|
1544
|
-
var BedrockStreamSchema =
|
|
1545
|
-
contentBlockDelta:
|
|
1546
|
-
contentBlockIndex:
|
|
1547
|
-
delta:
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
reasoningContent:
|
|
1553
|
+
var BedrockStreamSchema = z4.object({
|
|
1554
|
+
contentBlockDelta: z4.object({
|
|
1555
|
+
contentBlockIndex: z4.number(),
|
|
1556
|
+
delta: z4.union([
|
|
1557
|
+
z4.object({ text: z4.string() }),
|
|
1558
|
+
z4.object({ toolUse: z4.object({ input: z4.string() }) }),
|
|
1559
|
+
z4.object({
|
|
1560
|
+
reasoningContent: z4.object({ text: z4.string() })
|
|
1552
1561
|
}),
|
|
1553
|
-
|
|
1554
|
-
reasoningContent:
|
|
1555
|
-
signature:
|
|
1562
|
+
z4.object({
|
|
1563
|
+
reasoningContent: z4.object({
|
|
1564
|
+
signature: z4.string()
|
|
1556
1565
|
})
|
|
1557
1566
|
}),
|
|
1558
|
-
|
|
1559
|
-
reasoningContent:
|
|
1567
|
+
z4.object({
|
|
1568
|
+
reasoningContent: z4.object({ data: z4.string() })
|
|
1560
1569
|
})
|
|
1561
1570
|
]).nullish()
|
|
1562
1571
|
}).nullish(),
|
|
1563
|
-
contentBlockStart:
|
|
1564
|
-
contentBlockIndex:
|
|
1565
|
-
start:
|
|
1572
|
+
contentBlockStart: z4.object({
|
|
1573
|
+
contentBlockIndex: z4.number(),
|
|
1574
|
+
start: z4.object({
|
|
1566
1575
|
toolUse: BedrockToolUseSchema.nullish()
|
|
1567
1576
|
}).nullish()
|
|
1568
1577
|
}).nullish(),
|
|
1569
|
-
contentBlockStop:
|
|
1570
|
-
contentBlockIndex:
|
|
1578
|
+
contentBlockStop: z4.object({
|
|
1579
|
+
contentBlockIndex: z4.number()
|
|
1571
1580
|
}).nullish(),
|
|
1572
|
-
internalServerException:
|
|
1573
|
-
messageStop:
|
|
1581
|
+
internalServerException: z4.record(z4.string(), z4.unknown()).nullish(),
|
|
1582
|
+
messageStop: z4.object({
|
|
1574
1583
|
additionalModelResponseFields: BedrockAdditionalModelResponseFieldsSchema.nullish(),
|
|
1575
1584
|
stopReason: BedrockStopReasonSchema
|
|
1576
1585
|
}).nullish(),
|
|
1577
|
-
metadata:
|
|
1578
|
-
trace:
|
|
1579
|
-
performanceConfig:
|
|
1580
|
-
serviceTier:
|
|
1581
|
-
usage:
|
|
1582
|
-
cacheReadInputTokens:
|
|
1583
|
-
cacheWriteInputTokens:
|
|
1584
|
-
cacheDetails:
|
|
1585
|
-
inputTokens:
|
|
1586
|
-
outputTokens:
|
|
1586
|
+
metadata: z4.object({
|
|
1587
|
+
trace: z4.unknown().nullish(),
|
|
1588
|
+
performanceConfig: z4.object({ latency: z4.string() }).nullish(),
|
|
1589
|
+
serviceTier: z4.object({ type: z4.string() }).nullish(),
|
|
1590
|
+
usage: z4.object({
|
|
1591
|
+
cacheReadInputTokens: z4.number().nullish(),
|
|
1592
|
+
cacheWriteInputTokens: z4.number().nullish(),
|
|
1593
|
+
cacheDetails: z4.array(z4.object({ inputTokens: z4.number(), ttl: z4.string() })).nullish(),
|
|
1594
|
+
inputTokens: z4.number(),
|
|
1595
|
+
outputTokens: z4.number()
|
|
1587
1596
|
}).nullish()
|
|
1588
1597
|
}).nullish(),
|
|
1589
|
-
modelStreamErrorException:
|
|
1590
|
-
throttlingException:
|
|
1591
|
-
validationException:
|
|
1592
|
-
});
|
|
1593
|
-
var bedrockReasoningMetadataSchema = z3.object({
|
|
1594
|
-
signature: z3.string().optional(),
|
|
1595
|
-
redactedData: z3.string().optional()
|
|
1598
|
+
modelStreamErrorException: z4.record(z4.string(), z4.unknown()).nullish(),
|
|
1599
|
+
throttlingException: z4.record(z4.string(), z4.unknown()).nullish(),
|
|
1600
|
+
validationException: z4.record(z4.string(), z4.unknown()).nullish()
|
|
1596
1601
|
});
|
|
1597
1602
|
|
|
1598
1603
|
// src/bedrock-embedding-model.ts
|
|
@@ -1609,29 +1614,29 @@ import {
|
|
|
1609
1614
|
} from "@ai-sdk/provider-utils";
|
|
1610
1615
|
|
|
1611
1616
|
// src/bedrock-embedding-options.ts
|
|
1612
|
-
import { z as
|
|
1613
|
-
var amazonBedrockEmbeddingModelOptionsSchema =
|
|
1617
|
+
import { z as z5 } from "zod/v4";
|
|
1618
|
+
var amazonBedrockEmbeddingModelOptionsSchema = z5.object({
|
|
1614
1619
|
/**
|
|
1615
1620
|
* The number of dimensions the resulting output embeddings should have (defaults to 1024).
|
|
1616
1621
|
* Only supported in amazon.titan-embed-text-v2:0.
|
|
1617
1622
|
*/
|
|
1618
|
-
dimensions:
|
|
1623
|
+
dimensions: z5.union([z5.literal(1024), z5.literal(512), z5.literal(256)]).optional(),
|
|
1619
1624
|
/**
|
|
1620
1625
|
* Flag indicating whether or not to normalize the output embeddings. Defaults to true.
|
|
1621
1626
|
* Only supported in amazon.titan-embed-text-v2:0.
|
|
1622
1627
|
*/
|
|
1623
|
-
normalize:
|
|
1628
|
+
normalize: z5.boolean().optional(),
|
|
1624
1629
|
/**
|
|
1625
1630
|
* The number of dimensions for Nova embedding models (defaults to 1024).
|
|
1626
1631
|
* Supported values: 256, 384, 1024, 3072.
|
|
1627
1632
|
* Only supported in amazon.nova-* embedding models.
|
|
1628
1633
|
*/
|
|
1629
|
-
embeddingDimension:
|
|
1634
|
+
embeddingDimension: z5.union([z5.literal(256), z5.literal(384), z5.literal(1024), z5.literal(3072)]).optional(),
|
|
1630
1635
|
/**
|
|
1631
1636
|
* The purpose of the embedding. Defaults to 'GENERIC_INDEX'.
|
|
1632
1637
|
* Only supported in amazon.nova-* embedding models.
|
|
1633
1638
|
*/
|
|
1634
|
-
embeddingPurpose:
|
|
1639
|
+
embeddingPurpose: z5.enum([
|
|
1635
1640
|
"GENERIC_INDEX",
|
|
1636
1641
|
"TEXT_RETRIEVAL",
|
|
1637
1642
|
"IMAGE_RETRIEVAL",
|
|
@@ -1647,21 +1652,21 @@ var amazonBedrockEmbeddingModelOptionsSchema = z4.object({
|
|
|
1647
1652
|
* Common values: `search_document`, `search_query`, `classification`, `clustering`.
|
|
1648
1653
|
* If not set, the provider defaults to `search_query`.
|
|
1649
1654
|
*/
|
|
1650
|
-
inputType:
|
|
1655
|
+
inputType: z5.enum(["search_document", "search_query", "classification", "clustering"]).optional(),
|
|
1651
1656
|
/**
|
|
1652
1657
|
* Truncation behavior when input exceeds the model's context length.
|
|
1653
1658
|
* Supported in Cohere and Nova embedding models. Defaults to 'END' for Nova models.
|
|
1654
1659
|
*/
|
|
1655
|
-
truncate:
|
|
1660
|
+
truncate: z5.enum(["NONE", "START", "END"]).optional(),
|
|
1656
1661
|
/**
|
|
1657
1662
|
* The number of dimensions the resulting output embeddings should have (defaults to 1536).
|
|
1658
1663
|
* Only supported in cohere.embed-v4:0 and newer Cohere embedding models.
|
|
1659
1664
|
*/
|
|
1660
|
-
outputDimension:
|
|
1665
|
+
outputDimension: z5.union([z5.literal(256), z5.literal(512), z5.literal(1024), z5.literal(1536)]).optional()
|
|
1661
1666
|
});
|
|
1662
1667
|
|
|
1663
1668
|
// src/bedrock-embedding-model.ts
|
|
1664
|
-
import { z as
|
|
1669
|
+
import { z as z6 } from "zod/v4";
|
|
1665
1670
|
var BedrockEmbeddingModel = class {
|
|
1666
1671
|
constructor(modelId, config) {
|
|
1667
1672
|
this.modelId = modelId;
|
|
@@ -1757,30 +1762,30 @@ var BedrockEmbeddingModel = class {
|
|
|
1757
1762
|
};
|
|
1758
1763
|
}
|
|
1759
1764
|
};
|
|
1760
|
-
var BedrockEmbeddingResponseSchema =
|
|
1765
|
+
var BedrockEmbeddingResponseSchema = z6.union([
|
|
1761
1766
|
// Titan-style response
|
|
1762
|
-
|
|
1763
|
-
embedding:
|
|
1764
|
-
inputTextTokenCount:
|
|
1767
|
+
z6.object({
|
|
1768
|
+
embedding: z6.array(z6.number()),
|
|
1769
|
+
inputTextTokenCount: z6.number()
|
|
1765
1770
|
}),
|
|
1766
1771
|
// Nova-style response
|
|
1767
|
-
|
|
1768
|
-
embeddings:
|
|
1769
|
-
|
|
1770
|
-
embeddingType:
|
|
1771
|
-
embedding:
|
|
1772
|
+
z6.object({
|
|
1773
|
+
embeddings: z6.array(
|
|
1774
|
+
z6.object({
|
|
1775
|
+
embeddingType: z6.string(),
|
|
1776
|
+
embedding: z6.array(z6.number())
|
|
1772
1777
|
})
|
|
1773
1778
|
),
|
|
1774
|
-
inputTokenCount:
|
|
1779
|
+
inputTokenCount: z6.number().optional()
|
|
1775
1780
|
}),
|
|
1776
1781
|
// Cohere v3-style response
|
|
1777
|
-
|
|
1778
|
-
embeddings:
|
|
1782
|
+
z6.object({
|
|
1783
|
+
embeddings: z6.array(z6.array(z6.number()))
|
|
1779
1784
|
}),
|
|
1780
1785
|
// Cohere v4-style response
|
|
1781
|
-
|
|
1782
|
-
embeddings:
|
|
1783
|
-
float:
|
|
1786
|
+
z6.object({
|
|
1787
|
+
embeddings: z6.object({
|
|
1788
|
+
float: z6.array(z6.array(z6.number()))
|
|
1784
1789
|
})
|
|
1785
1790
|
})
|
|
1786
1791
|
]);
|
|
@@ -1801,7 +1806,7 @@ var modelMaxImagesPerCall = {
|
|
|
1801
1806
|
};
|
|
1802
1807
|
|
|
1803
1808
|
// src/bedrock-image-model.ts
|
|
1804
|
-
import { z as
|
|
1809
|
+
import { z as z7 } from "zod/v4";
|
|
1805
1810
|
var BedrockImageModel = class {
|
|
1806
1811
|
constructor(modelId, config) {
|
|
1807
1812
|
this.modelId = modelId;
|
|
@@ -1987,16 +1992,16 @@ function getBase64Data(file) {
|
|
|
1987
1992
|
}
|
|
1988
1993
|
return file.data;
|
|
1989
1994
|
}
|
|
1990
|
-
var bedrockImageResponseSchema =
|
|
1995
|
+
var bedrockImageResponseSchema = z7.object({
|
|
1991
1996
|
// Normal successful response
|
|
1992
|
-
images:
|
|
1997
|
+
images: z7.array(z7.string()).optional(),
|
|
1993
1998
|
// Moderation response fields
|
|
1994
|
-
id:
|
|
1995
|
-
status:
|
|
1996
|
-
result:
|
|
1997
|
-
progress:
|
|
1998
|
-
details:
|
|
1999
|
-
preview:
|
|
1999
|
+
id: z7.string().optional(),
|
|
2000
|
+
status: z7.string().optional(),
|
|
2001
|
+
result: z7.unknown().optional(),
|
|
2002
|
+
progress: z7.unknown().optional(),
|
|
2003
|
+
details: z7.record(z7.string(), z7.unknown()).optional(),
|
|
2004
|
+
preview: z7.unknown().optional()
|
|
2000
2005
|
});
|
|
2001
2006
|
|
|
2002
2007
|
// src/bedrock-sigv4-fetch.ts
|
|
@@ -2009,7 +2014,7 @@ import {
|
|
|
2009
2014
|
import { AwsV4Signer } from "aws4fetch";
|
|
2010
2015
|
|
|
2011
2016
|
// src/version.ts
|
|
2012
|
-
var VERSION = true ? "4.0.
|
|
2017
|
+
var VERSION = true ? "4.0.99" : "0.0.0-test";
|
|
2013
2018
|
|
|
2014
2019
|
// src/bedrock-sigv4-fetch.ts
|
|
2015
2020
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|
|
@@ -2104,35 +2109,35 @@ import {
|
|
|
2104
2109
|
|
|
2105
2110
|
// src/reranking/bedrock-reranking-api.ts
|
|
2106
2111
|
import { lazySchema, zodSchema } from "@ai-sdk/provider-utils";
|
|
2107
|
-
import { z as
|
|
2112
|
+
import { z as z8 } from "zod/v4";
|
|
2108
2113
|
var bedrockRerankingResponseSchema = lazySchema(
|
|
2109
2114
|
() => zodSchema(
|
|
2110
|
-
|
|
2111
|
-
results:
|
|
2112
|
-
|
|
2113
|
-
index:
|
|
2114
|
-
relevanceScore:
|
|
2115
|
+
z8.object({
|
|
2116
|
+
results: z8.array(
|
|
2117
|
+
z8.object({
|
|
2118
|
+
index: z8.number(),
|
|
2119
|
+
relevanceScore: z8.number()
|
|
2115
2120
|
})
|
|
2116
2121
|
),
|
|
2117
|
-
nextToken:
|
|
2122
|
+
nextToken: z8.string().optional()
|
|
2118
2123
|
})
|
|
2119
2124
|
)
|
|
2120
2125
|
);
|
|
2121
2126
|
|
|
2122
2127
|
// src/reranking/bedrock-reranking-options.ts
|
|
2123
2128
|
import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
|
|
2124
|
-
import { z as
|
|
2129
|
+
import { z as z9 } from "zod/v4";
|
|
2125
2130
|
var amazonBedrockRerankingModelOptionsSchema = lazySchema2(
|
|
2126
2131
|
() => zodSchema2(
|
|
2127
|
-
|
|
2132
|
+
z9.object({
|
|
2128
2133
|
/**
|
|
2129
2134
|
* If the total number of results was greater than could fit in a response, a token is returned in the nextToken field. You can enter that token in this field to return the next batch of results.
|
|
2130
2135
|
*/
|
|
2131
|
-
nextToken:
|
|
2136
|
+
nextToken: z9.string().optional(),
|
|
2132
2137
|
/**
|
|
2133
2138
|
* Additional model request fields to pass to the model.
|
|
2134
2139
|
*/
|
|
2135
|
-
additionalModelRequestFields:
|
|
2140
|
+
additionalModelRequestFields: z9.record(z9.string(), z9.any()).optional()
|
|
2136
2141
|
})
|
|
2137
2142
|
)
|
|
2138
2143
|
);
|
|
@@ -2258,7 +2263,7 @@ function createAmazonBedrock(options = {}) {
|
|
|
2258
2263
|
environmentVariableName: "AWS_SECRET_ACCESS_KEY",
|
|
2259
2264
|
description: "AWS secret access key"
|
|
2260
2265
|
}),
|
|
2261
|
-
sessionToken: loadOptionalSetting({
|
|
2266
|
+
sessionToken: options.accessKeyId != null && options.secretAccessKey != null ? options.sessionToken : loadOptionalSetting({
|
|
2262
2267
|
settingValue: options.sessionToken,
|
|
2263
2268
|
environmentVariableName: "AWS_SESSION_TOKEN"
|
|
2264
2269
|
})
|