@ai-sdk/amazon-bedrock 5.0.97 → 5.0.98
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 +22 -0
- package/dist/anthropic/index.js +1 -1
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/mantle/index.cjs +1 -1
- package/dist/mantle/index.js +1 -1
- package/package.json +5 -5
- package/src/amazon-bedrock-chat-language-model.ts +22 -1
- package/src/amazon-bedrock-image-model.ts +8 -0
package/dist/mantle/index.cjs
CHANGED
|
@@ -35,7 +35,7 @@ var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
|
35
35
|
var import_aws4fetch = require("aws4fetch");
|
|
36
36
|
|
|
37
37
|
// src/version.ts
|
|
38
|
-
var VERSION = true ? "5.0.
|
|
38
|
+
var VERSION = true ? "5.0.98" : "0.0.0-test";
|
|
39
39
|
|
|
40
40
|
// src/amazon-bedrock-sigv4-fetch.ts
|
|
41
41
|
function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
|
package/dist/mantle/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import { AwsV4Signer } from "aws4fetch";
|
|
24
24
|
|
|
25
25
|
// src/version.ts
|
|
26
|
-
var VERSION = true ? "5.0.
|
|
26
|
+
var VERSION = true ? "5.0.98" : "0.0.0-test";
|
|
27
27
|
|
|
28
28
|
// src/amazon-bedrock-sigv4-fetch.ts
|
|
29
29
|
function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/amazon-bedrock",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.98",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@ai-sdk/anthropic": "4.0.
|
|
45
|
-
"@ai-sdk/openai": "4.0.
|
|
46
|
-
"@ai-sdk/provider": "4.0.
|
|
47
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
44
|
+
"@ai-sdk/anthropic": "4.0.66",
|
|
45
|
+
"@ai-sdk/openai": "4.0.79",
|
|
46
|
+
"@ai-sdk/provider": "4.0.19",
|
|
47
|
+
"@ai-sdk/provider-utils": "5.0.50",
|
|
48
48
|
"@smithy/eventstream-codec": "^4.3.3",
|
|
49
49
|
"@smithy/util-utf8": "^4.3.3",
|
|
50
50
|
"aws4fetch": "^1.0.20"
|
|
@@ -234,6 +234,7 @@ export class AmazonBedrockChatLanguageModel implements LanguageModelV4 {
|
|
|
234
234
|
const isOpenAIModel = openAIModelId != null;
|
|
235
235
|
const isOpenAIGptOssModel =
|
|
236
236
|
openAIModelId?.startsWith('openai.gpt-oss-') ?? false;
|
|
237
|
+
const isNovaReasoningModel = isNova2ReasoningModel(this.modelId);
|
|
237
238
|
const shouldNormalizeTemperature = !isOpenAIModel || isOpenAIGptOssModel;
|
|
238
239
|
|
|
239
240
|
if (shouldNormalizeTemperature && temperature != null && temperature > 1) {
|
|
@@ -495,6 +496,22 @@ export class AmazonBedrockChatLanguageModel implements LanguageModelV4 {
|
|
|
495
496
|
}
|
|
496
497
|
}
|
|
497
498
|
|
|
499
|
+
if (
|
|
500
|
+
isNovaReasoningModel &&
|
|
501
|
+
thinkingType === 'enabled' &&
|
|
502
|
+
(maxReasoningEffort === 'high' ||
|
|
503
|
+
maxReasoningEffort === 'xhigh' ||
|
|
504
|
+
maxReasoningEffort === 'max') &&
|
|
505
|
+
inferenceConfig.maxTokens != null
|
|
506
|
+
) {
|
|
507
|
+
delete inferenceConfig.maxTokens;
|
|
508
|
+
warnings.push({
|
|
509
|
+
type: 'unsupported',
|
|
510
|
+
feature: 'maxOutputTokens',
|
|
511
|
+
details: `maxOutputTokens is not supported by ${this.modelId} when high reasoning is enabled and will be ignored`,
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
|
|
498
515
|
if (useNativeStructuredOutput) {
|
|
499
516
|
amazonBedrockOptions.additionalModelRequestFields = {
|
|
500
517
|
...amazonBedrockOptions.additionalModelRequestFields,
|
|
@@ -1603,6 +1620,10 @@ const amazonBedrockReasoningEffortMap: Partial<
|
|
|
1603
1620
|
xhigh: 'max',
|
|
1604
1621
|
};
|
|
1605
1622
|
|
|
1623
|
+
function isNova2ReasoningModel(modelId: string): boolean {
|
|
1624
|
+
return modelId.includes('amazon.nova-2-lite-v1:0');
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1606
1627
|
function resolveAmazonBedrockReasoningConfig({
|
|
1607
1628
|
reasoning,
|
|
1608
1629
|
amazonBedrockOptions,
|
|
@@ -1626,7 +1647,7 @@ function resolveAmazonBedrockReasoningConfig({
|
|
|
1626
1647
|
const hasPortableReasoning = reasoning !== 'none';
|
|
1627
1648
|
const hasExplicitReasoningConfig =
|
|
1628
1649
|
amazonBedrockOptions.reasoningConfig != null;
|
|
1629
|
-
const isNovaReasoningModel = modelId
|
|
1650
|
+
const isNovaReasoningModel = isNova2ReasoningModel(modelId);
|
|
1630
1651
|
const supportsPortableReasoning = isOpenAIModel || isNovaReasoningModel;
|
|
1631
1652
|
|
|
1632
1653
|
if (isAnthropicModel) {
|
|
@@ -55,6 +55,14 @@ export class AmazonBedrockImageModel implements ImageModelV4 {
|
|
|
55
55
|
return modelMaxImagesPerCall[this.modelId] ?? 1;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
get supportsFileInputs(): boolean | undefined {
|
|
59
|
+
return this.modelId === 'amazon.nova-canvas-v1:0' ? true : undefined;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get supportsMaskInputs(): boolean | undefined {
|
|
63
|
+
return this.modelId === 'amazon.nova-canvas-v1:0' ? true : undefined;
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
private getUrl(modelId: string): string {
|
|
59
67
|
const encodedModelId = encodeURIComponent(modelId);
|
|
60
68
|
return `${this.config.baseUrl()}/model/${encodedModelId}/invoke`;
|