@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @ai-sdk/amazon-bedrock
|
|
2
2
|
|
|
3
|
+
## 5.0.98
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9c7ff9a: fix(amazon-bedrock): omit max output tokens for Nova 2 Lite high reasoning
|
|
8
|
+
- 525efc5: feat(provider): advertise image model file and mask input support
|
|
9
|
+
|
|
10
|
+
Use confirmed model IDs for capability declarations so unrecognized model names
|
|
11
|
+
remain unknown. Include Together AI FLUX.2 Pro and Flex single-image editing, and
|
|
12
|
+
allow asynchronous capability lookups and middleware overrides to resolve to
|
|
13
|
+
unknown.
|
|
14
|
+
|
|
15
|
+
Advertise QuiverAI Arrow 2 and Arrow 2 Telos file-input support, and mark Together
|
|
16
|
+
AI Gemini image inputs unsupported by the current single-image request mapping.
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [e3605f6]
|
|
19
|
+
- Updated dependencies [525efc5]
|
|
20
|
+
- @ai-sdk/provider-utils@5.0.50
|
|
21
|
+
- @ai-sdk/openai@4.0.79
|
|
22
|
+
- @ai-sdk/provider@4.0.19
|
|
23
|
+
- @ai-sdk/anthropic@4.0.66
|
|
24
|
+
|
|
3
25
|
## 5.0.97
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/anthropic/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/dist/index.js
CHANGED
|
@@ -1352,6 +1352,7 @@ var AmazonBedrockChatLanguageModel = class _AmazonBedrockChatLanguageModel {
|
|
|
1352
1352
|
const openAIModelId = /^(?:[^.]+\.)?(openai\..+)$/.exec(this.modelId)?.[1];
|
|
1353
1353
|
const isOpenAIModel = openAIModelId != null;
|
|
1354
1354
|
const isOpenAIGptOssModel = openAIModelId?.startsWith("openai.gpt-oss-") ?? false;
|
|
1355
|
+
const isNovaReasoningModel = isNova2ReasoningModel(this.modelId);
|
|
1355
1356
|
const shouldNormalizeTemperature = !isOpenAIModel || isOpenAIGptOssModel;
|
|
1356
1357
|
if (shouldNormalizeTemperature && temperature != null && temperature > 1) {
|
|
1357
1358
|
warnings.push({
|
|
@@ -1524,6 +1525,14 @@ var AmazonBedrockChatLanguageModel = class _AmazonBedrockChatLanguageModel {
|
|
|
1524
1525
|
};
|
|
1525
1526
|
}
|
|
1526
1527
|
}
|
|
1528
|
+
if (isNovaReasoningModel && thinkingType === "enabled" && (maxReasoningEffort === "high" || maxReasoningEffort === "xhigh" || maxReasoningEffort === "max") && inferenceConfig.maxTokens != null) {
|
|
1529
|
+
delete inferenceConfig.maxTokens;
|
|
1530
|
+
warnings.push({
|
|
1531
|
+
type: "unsupported",
|
|
1532
|
+
feature: "maxOutputTokens",
|
|
1533
|
+
details: `maxOutputTokens is not supported by ${this.modelId} when high reasoning is enabled and will be ignored`
|
|
1534
|
+
});
|
|
1535
|
+
}
|
|
1527
1536
|
if (useNativeStructuredOutput) {
|
|
1528
1537
|
amazonBedrockOptions.additionalModelRequestFields = {
|
|
1529
1538
|
...amazonBedrockOptions.additionalModelRequestFields,
|
|
@@ -2355,6 +2364,9 @@ var amazonBedrockReasoningEffortMap = {
|
|
|
2355
2364
|
high: "high",
|
|
2356
2365
|
xhigh: "max"
|
|
2357
2366
|
};
|
|
2367
|
+
function isNova2ReasoningModel(modelId) {
|
|
2368
|
+
return modelId.includes("amazon.nova-2-lite-v1:0");
|
|
2369
|
+
}
|
|
2358
2370
|
function resolveAmazonBedrockReasoningConfig({
|
|
2359
2371
|
reasoning,
|
|
2360
2372
|
amazonBedrockOptions,
|
|
@@ -2369,7 +2381,7 @@ function resolveAmazonBedrockReasoningConfig({
|
|
|
2369
2381
|
const result = { ...amazonBedrockOptions };
|
|
2370
2382
|
const hasPortableReasoning = reasoning !== "none";
|
|
2371
2383
|
const hasExplicitReasoningConfig = amazonBedrockOptions.reasoningConfig != null;
|
|
2372
|
-
const isNovaReasoningModel = modelId
|
|
2384
|
+
const isNovaReasoningModel = isNova2ReasoningModel(modelId);
|
|
2373
2385
|
const supportsPortableReasoning = isOpenAIModel || isNovaReasoningModel;
|
|
2374
2386
|
if (isAnthropicModel2) {
|
|
2375
2387
|
const capabilities = getModelCapabilities(modelId);
|
|
@@ -2723,6 +2735,12 @@ var AmazonBedrockImageModel = class _AmazonBedrockImageModel {
|
|
|
2723
2735
|
get maxImagesPerCall() {
|
|
2724
2736
|
return modelMaxImagesPerCall[this.modelId] ?? 1;
|
|
2725
2737
|
}
|
|
2738
|
+
get supportsFileInputs() {
|
|
2739
|
+
return this.modelId === "amazon.nova-canvas-v1:0" ? true : void 0;
|
|
2740
|
+
}
|
|
2741
|
+
get supportsMaskInputs() {
|
|
2742
|
+
return this.modelId === "amazon.nova-canvas-v1:0" ? true : void 0;
|
|
2743
|
+
}
|
|
2726
2744
|
getUrl(modelId) {
|
|
2727
2745
|
const encodedModelId = encodeURIComponent(modelId);
|
|
2728
2746
|
return `${this.config.baseUrl()}/model/${encodedModelId}/invoke`;
|
|
@@ -2927,7 +2945,7 @@ import {
|
|
|
2927
2945
|
import { AwsV4Signer } from "aws4fetch";
|
|
2928
2946
|
|
|
2929
2947
|
// src/version.ts
|
|
2930
|
-
var VERSION = true ? "5.0.
|
|
2948
|
+
var VERSION = true ? "5.0.98" : "0.0.0-test";
|
|
2931
2949
|
|
|
2932
2950
|
// src/amazon-bedrock-sigv4-fetch.ts
|
|
2933
2951
|
function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
|