@ai-sdk/amazon-bedrock 4.0.55 → 4.0.56
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 +8 -0
- package/dist/anthropic/index.js +1 -1
- package/dist/anthropic/index.mjs +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/docs/08-amazon-bedrock.mdx +14 -6
- package/package.json +2 -2
- package/src/bedrock-chat-language-model.ts +2 -2
- package/src/bedrock-chat-options.ts +4 -2
- package/src/index.ts +10 -2
- package/src/reranking/bedrock-reranking-model.ts +2 -2
- package/src/reranking/bedrock-reranking-options.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @ai-sdk/amazon-bedrock
|
|
2
2
|
|
|
3
|
+
## 4.0.56
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 99fbed8: feat: normalize provider specific model options type names and ensure they are exported
|
|
8
|
+
- Updated dependencies [99fbed8]
|
|
9
|
+
- @ai-sdk/anthropic@3.0.42
|
|
10
|
+
|
|
3
11
|
## 4.0.55
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/anthropic/index.js
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 ? "4.0.
|
|
38
|
+
var VERSION = true ? "4.0.56" : "0.0.0-test";
|
|
39
39
|
|
|
40
40
|
// src/bedrock-sigv4-fetch.ts
|
|
41
41
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|
package/dist/anthropic/index.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import { AwsV4Signer } from "aws4fetch";
|
|
25
25
|
|
|
26
26
|
// src/version.ts
|
|
27
|
-
var VERSION = true ? "4.0.
|
|
27
|
+
var VERSION = true ? "4.0.56" : "0.0.0-test";
|
|
28
28
|
|
|
29
29
|
// src/bedrock-sigv4-fetch.ts
|
|
30
30
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, RerankingM
|
|
|
5
5
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
6
6
|
|
|
7
7
|
type BedrockChatModelId = 'amazon.titan-tg1-large' | 'amazon.titan-text-express-v1' | 'anthropic.claude-v2' | 'anthropic.claude-v2:1' | 'anthropic.claude-instant-v1' | 'anthropic.claude-haiku-4-5-20251001-v1:0' | 'anthropic.claude-sonnet-4-20250514-v1:0' | 'anthropic.claude-sonnet-4-5-20250929-v1:0' | 'anthropic.claude-opus-4-20250514-v1:0' | 'anthropic.claude-opus-4-1-20250805-v1:0' | 'anthropic.claude-3-7-sonnet-20250219-v1:0' | 'anthropic.claude-3-5-sonnet-20240620-v1:0' | 'anthropic.claude-3-5-sonnet-20241022-v2:0' | 'anthropic.claude-3-5-haiku-20241022-v1:0' | 'anthropic.claude-3-sonnet-20240229-v1:0' | 'anthropic.claude-3-haiku-20240307-v1:0' | 'anthropic.claude-3-opus-20240229-v1:0' | 'cohere.command-text-v14' | 'cohere.command-light-text-v14' | 'cohere.command-r-v1:0' | 'cohere.command-r-plus-v1:0' | 'meta.llama3-70b-instruct-v1:0' | 'meta.llama3-8b-instruct-v1:0' | 'meta.llama3-1-405b-instruct-v1:0' | 'meta.llama3-1-70b-instruct-v1:0' | 'meta.llama3-1-8b-instruct-v1:0' | 'meta.llama3-2-11b-instruct-v1:0' | 'meta.llama3-2-1b-instruct-v1:0' | 'meta.llama3-2-3b-instruct-v1:0' | 'meta.llama3-2-90b-instruct-v1:0' | 'mistral.mistral-7b-instruct-v0:2' | 'mistral.mixtral-8x7b-instruct-v0:1' | 'mistral.mistral-large-2402-v1:0' | 'mistral.mistral-small-2402-v1:0' | 'openai.gpt-oss-120b-1:0' | 'openai.gpt-oss-20b-1:0' | 'amazon.titan-text-express-v1' | 'amazon.titan-text-lite-v1' | 'us.amazon.nova-premier-v1:0' | 'us.amazon.nova-pro-v1:0' | 'us.amazon.nova-micro-v1:0' | 'us.amazon.nova-lite-v1:0' | 'us.anthropic.claude-3-sonnet-20240229-v1:0' | 'us.anthropic.claude-3-opus-20240229-v1:0' | 'us.anthropic.claude-3-haiku-20240307-v1:0' | 'us.anthropic.claude-3-5-sonnet-20240620-v1:0' | 'us.anthropic.claude-3-5-haiku-20241022-v1:0' | 'us.anthropic.claude-3-5-sonnet-20241022-v2:0' | 'us.anthropic.claude-3-7-sonnet-20250219-v1:0' | 'us.anthropic.claude-sonnet-4-20250514-v1:0' | 'us.anthropic.claude-sonnet-4-5-20250929-v1:0' | 'us.anthropic.claude-opus-4-20250514-v1:0' | 'us.anthropic.claude-opus-4-1-20250805-v1:0' | 'us.meta.llama3-2-11b-instruct-v1:0' | 'us.meta.llama3-2-3b-instruct-v1:0' | 'us.meta.llama3-2-90b-instruct-v1:0' | 'us.meta.llama3-2-1b-instruct-v1:0' | 'us.meta.llama3-1-8b-instruct-v1:0' | 'us.meta.llama3-1-70b-instruct-v1:0' | 'us.meta.llama3-3-70b-instruct-v1:0' | 'us.deepseek.r1-v1:0' | 'us.mistral.pixtral-large-2502-v1:0' | 'us.meta.llama4-scout-17b-instruct-v1:0' | 'us.meta.llama4-maverick-17b-instruct-v1:0' | (string & {});
|
|
8
|
-
declare const
|
|
8
|
+
declare const amazonBedrockLanguageModelOptions: z.ZodObject<{
|
|
9
9
|
additionalModelRequestFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
10
10
|
reasoningConfig: z.ZodOptional<z.ZodObject<{
|
|
11
11
|
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">, z.ZodLiteral<"adaptive">]>>;
|
|
@@ -19,7 +19,7 @@ declare const bedrockProviderOptions: z.ZodObject<{
|
|
|
19
19
|
}, z.core.$strip>>;
|
|
20
20
|
anthropicBeta: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
|
-
type
|
|
22
|
+
type AmazonBedrockLanguageModelOptions = z.infer<typeof amazonBedrockLanguageModelOptions>;
|
|
23
23
|
|
|
24
24
|
type BedrockEmbeddingModelId = 'amazon.titan-embed-text-v1' | 'amazon.titan-embed-text-v2:0' | 'cohere.embed-english-v3' | 'cohere.embed-multilingual-v3' | (string & {});
|
|
25
25
|
|
|
@@ -33,7 +33,7 @@ interface BedrockCredentials {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
type BedrockRerankingModelId = 'amazon.rerank-v1:0' | 'cohere.rerank-v3-5:0' | (string & {});
|
|
36
|
-
type
|
|
36
|
+
type AmazonBedrockRerankingModelOptions = {
|
|
37
37
|
/**
|
|
38
38
|
* 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.
|
|
39
39
|
*/
|
|
@@ -162,4 +162,4 @@ declare const bedrock: AmazonBedrockProvider;
|
|
|
162
162
|
|
|
163
163
|
declare const VERSION: string;
|
|
164
164
|
|
|
165
|
-
export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type BedrockProviderOptions, type BedrockRerankingOptions, VERSION, bedrock, createAmazonBedrock };
|
|
165
|
+
export { type AmazonBedrockLanguageModelOptions, type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type AmazonBedrockRerankingModelOptions, type AmazonBedrockLanguageModelOptions as BedrockProviderOptions, type AmazonBedrockRerankingModelOptions as BedrockRerankingOptions, VERSION, bedrock, createAmazonBedrock };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { ProviderV3, LanguageModelV3, EmbeddingModelV3, ImageModelV3, RerankingM
|
|
|
5
5
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
6
6
|
|
|
7
7
|
type BedrockChatModelId = 'amazon.titan-tg1-large' | 'amazon.titan-text-express-v1' | 'anthropic.claude-v2' | 'anthropic.claude-v2:1' | 'anthropic.claude-instant-v1' | 'anthropic.claude-haiku-4-5-20251001-v1:0' | 'anthropic.claude-sonnet-4-20250514-v1:0' | 'anthropic.claude-sonnet-4-5-20250929-v1:0' | 'anthropic.claude-opus-4-20250514-v1:0' | 'anthropic.claude-opus-4-1-20250805-v1:0' | 'anthropic.claude-3-7-sonnet-20250219-v1:0' | 'anthropic.claude-3-5-sonnet-20240620-v1:0' | 'anthropic.claude-3-5-sonnet-20241022-v2:0' | 'anthropic.claude-3-5-haiku-20241022-v1:0' | 'anthropic.claude-3-sonnet-20240229-v1:0' | 'anthropic.claude-3-haiku-20240307-v1:0' | 'anthropic.claude-3-opus-20240229-v1:0' | 'cohere.command-text-v14' | 'cohere.command-light-text-v14' | 'cohere.command-r-v1:0' | 'cohere.command-r-plus-v1:0' | 'meta.llama3-70b-instruct-v1:0' | 'meta.llama3-8b-instruct-v1:0' | 'meta.llama3-1-405b-instruct-v1:0' | 'meta.llama3-1-70b-instruct-v1:0' | 'meta.llama3-1-8b-instruct-v1:0' | 'meta.llama3-2-11b-instruct-v1:0' | 'meta.llama3-2-1b-instruct-v1:0' | 'meta.llama3-2-3b-instruct-v1:0' | 'meta.llama3-2-90b-instruct-v1:0' | 'mistral.mistral-7b-instruct-v0:2' | 'mistral.mixtral-8x7b-instruct-v0:1' | 'mistral.mistral-large-2402-v1:0' | 'mistral.mistral-small-2402-v1:0' | 'openai.gpt-oss-120b-1:0' | 'openai.gpt-oss-20b-1:0' | 'amazon.titan-text-express-v1' | 'amazon.titan-text-lite-v1' | 'us.amazon.nova-premier-v1:0' | 'us.amazon.nova-pro-v1:0' | 'us.amazon.nova-micro-v1:0' | 'us.amazon.nova-lite-v1:0' | 'us.anthropic.claude-3-sonnet-20240229-v1:0' | 'us.anthropic.claude-3-opus-20240229-v1:0' | 'us.anthropic.claude-3-haiku-20240307-v1:0' | 'us.anthropic.claude-3-5-sonnet-20240620-v1:0' | 'us.anthropic.claude-3-5-haiku-20241022-v1:0' | 'us.anthropic.claude-3-5-sonnet-20241022-v2:0' | 'us.anthropic.claude-3-7-sonnet-20250219-v1:0' | 'us.anthropic.claude-sonnet-4-20250514-v1:0' | 'us.anthropic.claude-sonnet-4-5-20250929-v1:0' | 'us.anthropic.claude-opus-4-20250514-v1:0' | 'us.anthropic.claude-opus-4-1-20250805-v1:0' | 'us.meta.llama3-2-11b-instruct-v1:0' | 'us.meta.llama3-2-3b-instruct-v1:0' | 'us.meta.llama3-2-90b-instruct-v1:0' | 'us.meta.llama3-2-1b-instruct-v1:0' | 'us.meta.llama3-1-8b-instruct-v1:0' | 'us.meta.llama3-1-70b-instruct-v1:0' | 'us.meta.llama3-3-70b-instruct-v1:0' | 'us.deepseek.r1-v1:0' | 'us.mistral.pixtral-large-2502-v1:0' | 'us.meta.llama4-scout-17b-instruct-v1:0' | 'us.meta.llama4-maverick-17b-instruct-v1:0' | (string & {});
|
|
8
|
-
declare const
|
|
8
|
+
declare const amazonBedrockLanguageModelOptions: z.ZodObject<{
|
|
9
9
|
additionalModelRequestFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
10
10
|
reasoningConfig: z.ZodOptional<z.ZodObject<{
|
|
11
11
|
type: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">, z.ZodLiteral<"adaptive">]>>;
|
|
@@ -19,7 +19,7 @@ declare const bedrockProviderOptions: z.ZodObject<{
|
|
|
19
19
|
}, z.core.$strip>>;
|
|
20
20
|
anthropicBeta: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
|
-
type
|
|
22
|
+
type AmazonBedrockLanguageModelOptions = z.infer<typeof amazonBedrockLanguageModelOptions>;
|
|
23
23
|
|
|
24
24
|
type BedrockEmbeddingModelId = 'amazon.titan-embed-text-v1' | 'amazon.titan-embed-text-v2:0' | 'cohere.embed-english-v3' | 'cohere.embed-multilingual-v3' | (string & {});
|
|
25
25
|
|
|
@@ -33,7 +33,7 @@ interface BedrockCredentials {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
type BedrockRerankingModelId = 'amazon.rerank-v1:0' | 'cohere.rerank-v3-5:0' | (string & {});
|
|
36
|
-
type
|
|
36
|
+
type AmazonBedrockRerankingModelOptions = {
|
|
37
37
|
/**
|
|
38
38
|
* 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.
|
|
39
39
|
*/
|
|
@@ -162,4 +162,4 @@ declare const bedrock: AmazonBedrockProvider;
|
|
|
162
162
|
|
|
163
163
|
declare const VERSION: string;
|
|
164
164
|
|
|
165
|
-
export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type BedrockProviderOptions, type BedrockRerankingOptions, VERSION, bedrock, createAmazonBedrock };
|
|
165
|
+
export { type AmazonBedrockLanguageModelOptions, type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type AmazonBedrockRerankingModelOptions, type AmazonBedrockLanguageModelOptions as BedrockProviderOptions, type AmazonBedrockRerankingModelOptions as BedrockRerankingOptions, VERSION, bedrock, createAmazonBedrock };
|
package/dist/index.js
CHANGED
|
@@ -79,7 +79,7 @@ var bedrockFilePartProviderOptions = import_v4.z.object({
|
|
|
79
79
|
enabled: import_v4.z.boolean()
|
|
80
80
|
}).optional()
|
|
81
81
|
});
|
|
82
|
-
var
|
|
82
|
+
var amazonBedrockLanguageModelOptions = import_v4.z.object({
|
|
83
83
|
/**
|
|
84
84
|
* Additional inference parameters that the model supports,
|
|
85
85
|
* beyond the base set of inference parameters that Converse
|
|
@@ -772,7 +772,7 @@ var BedrockChatLanguageModel = class {
|
|
|
772
772
|
const bedrockOptions = (_a = await (0, import_provider_utils4.parseProviderOptions)({
|
|
773
773
|
provider: "bedrock",
|
|
774
774
|
providerOptions,
|
|
775
|
-
schema:
|
|
775
|
+
schema: amazonBedrockLanguageModelOptions
|
|
776
776
|
})) != null ? _a : {};
|
|
777
777
|
const warnings = [];
|
|
778
778
|
if (frequencyPenalty != null) {
|
|
@@ -1894,7 +1894,7 @@ var import_provider_utils7 = require("@ai-sdk/provider-utils");
|
|
|
1894
1894
|
var import_aws4fetch = require("aws4fetch");
|
|
1895
1895
|
|
|
1896
1896
|
// src/version.ts
|
|
1897
|
-
var VERSION = true ? "4.0.
|
|
1897
|
+
var VERSION = true ? "4.0.56" : "0.0.0-test";
|
|
1898
1898
|
|
|
1899
1899
|
// src/bedrock-sigv4-fetch.ts
|
|
1900
1900
|
function createSigV4FetchFunction(getCredentials, fetch = globalThis.fetch) {
|
|
@@ -2000,7 +2000,7 @@ var bedrockRerankingResponseSchema = (0, import_provider_utils8.lazySchema)(
|
|
|
2000
2000
|
// src/reranking/bedrock-reranking-options.ts
|
|
2001
2001
|
var import_provider_utils9 = require("@ai-sdk/provider-utils");
|
|
2002
2002
|
var import_v48 = require("zod/v4");
|
|
2003
|
-
var
|
|
2003
|
+
var amazonBedrockRerankingModelOptionsSchema = (0, import_provider_utils9.lazySchema)(
|
|
2004
2004
|
() => (0, import_provider_utils9.zodSchema)(
|
|
2005
2005
|
import_v48.z.object({
|
|
2006
2006
|
/**
|
|
@@ -2034,7 +2034,7 @@ var BedrockRerankingModel = class {
|
|
|
2034
2034
|
const bedrockOptions = await (0, import_provider_utils10.parseProviderOptions)({
|
|
2035
2035
|
provider: "bedrock",
|
|
2036
2036
|
providerOptions,
|
|
2037
|
-
schema:
|
|
2037
|
+
schema: amazonBedrockRerankingModelOptionsSchema
|
|
2038
2038
|
});
|
|
2039
2039
|
const {
|
|
2040
2040
|
value: response,
|