@ai-sdk/amazon-bedrock 3.0.0-canary.5 → 3.0.0-canary.7

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 CHANGED
@@ -1,5 +1,40 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 3.0.0-canary.7
4
+
5
+ ### Patch Changes
6
+
7
+ - fa49207: feat(providers/openai-compatible): convert to providerOptions
8
+ - 26735b5: chore(embedding-model): add v2 interface
9
+ - Updated dependencies [26735b5]
10
+ - Updated dependencies [443d8ec]
11
+ - Updated dependencies [14c9410]
12
+ - Updated dependencies [d9c98f4]
13
+ - Updated dependencies [c4a2fec]
14
+ - Updated dependencies [0054544]
15
+ - Updated dependencies [9e9c809]
16
+ - Updated dependencies [32831c6]
17
+ - Updated dependencies [d0f9495]
18
+ - Updated dependencies [fd65bc6]
19
+ - Updated dependencies [393138b]
20
+ - Updated dependencies [7182d14]
21
+ - @ai-sdk/provider@2.0.0-canary.6
22
+ - @ai-sdk/provider-utils@3.0.0-canary.7
23
+
24
+ ## 3.0.0-canary.6
25
+
26
+ ### Patch Changes
27
+
28
+ - 97ea26f: chore(providers/bedrock): convert to providerOptions
29
+ - 97ea26f: chore(providers/bedrock): use camelCase for providerOptions
30
+ - Updated dependencies [411e483]
31
+ - Updated dependencies [79457bd]
32
+ - Updated dependencies [ad80501]
33
+ - Updated dependencies [1766ede]
34
+ - Updated dependencies [f10304b]
35
+ - @ai-sdk/provider@2.0.0-canary.5
36
+ - @ai-sdk/provider-utils@3.0.0-canary.6
37
+
3
38
  ## 3.0.0-canary.5
4
39
 
5
40
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,15 +1,39 @@
1
- import { ProviderV2, LanguageModelV2, EmbeddingModelV1, ImageModelV1 } from '@ai-sdk/provider';
1
+ import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV1 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
+ import { z } from 'zod';
3
4
 
4
5
  type BedrockChatModelId = 'amazon.titan-tg1-large' | 'amazon.titan-text-express-v1' | 'anthropic.claude-v2' | 'anthropic.claude-v2:1' | 'anthropic.claude-instant-v1' | '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' | 'amazon.titan-text-express-v1' | 'amazon.titan-text-lite-v1' | (string & {});
5
- interface BedrockChatSettings {
6
+ declare const bedrockProviderOptions: z.ZodObject<{
6
7
  /**
7
- Additional inference parameters that the model supports,
8
- beyond the base set of inference parameters that Converse
9
- supports in the inferenceConfig field
10
- */
11
- additionalModelRequestFields?: Record<string, any>;
12
- }
8
+ * Additional inference parameters that the model supports,
9
+ * beyond the base set of inference parameters that Converse
10
+ * supports in the inferenceConfig field
11
+ */
12
+ additionalModelRequestFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
13
+ reasoningConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
14
+ type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>>>;
15
+ budgetTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ type?: "enabled" | "disabled" | null | undefined;
18
+ budgetTokens?: number | null | undefined;
19
+ }, {
20
+ type?: "enabled" | "disabled" | null | undefined;
21
+ budgetTokens?: number | null | undefined;
22
+ }>>>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ additionalModelRequestFields?: Record<string, any> | undefined;
25
+ reasoningConfig?: {
26
+ type?: "enabled" | "disabled" | null | undefined;
27
+ budgetTokens?: number | null | undefined;
28
+ } | null | undefined;
29
+ }, {
30
+ additionalModelRequestFields?: Record<string, any> | undefined;
31
+ reasoningConfig?: {
32
+ type?: "enabled" | "disabled" | null | undefined;
33
+ budgetTokens?: number | null | undefined;
34
+ } | null | undefined;
35
+ }>;
36
+ type BedrockProviderOptions = z.infer<typeof bedrockProviderOptions>;
13
37
 
14
38
  type BedrockEmbeddingModelId = 'amazon.titan-embed-text-v1' | 'amazon.titan-embed-text-v2:0' | 'cohere.embed-english-v3' | 'cohere.embed-multilingual-v3' | (string & {});
15
39
  interface BedrockEmbeddingSettings {
@@ -49,6 +73,7 @@ interface AmazonBedrockProviderSettings {
49
73
  region?: string;
50
74
  /**
51
75
  The AWS access key ID to use for the Bedrock provider. Defaults to the value of the
76
+ `AWS_ACCESS_KEY_ID` environment variable.
52
77
  */
53
78
  accessKeyId?: string;
54
79
  /**
@@ -84,9 +109,9 @@ interface AmazonBedrockProviderSettings {
84
109
  generateId?: () => string;
85
110
  }
86
111
  interface AmazonBedrockProvider extends ProviderV2 {
87
- (modelId: BedrockChatModelId, settings?: BedrockChatSettings): LanguageModelV2;
88
- languageModel(modelId: BedrockChatModelId, settings?: BedrockChatSettings): LanguageModelV2;
89
- embedding(modelId: BedrockEmbeddingModelId, settings?: BedrockEmbeddingSettings): EmbeddingModelV1<string>;
112
+ (modelId: BedrockChatModelId): LanguageModelV2;
113
+ languageModel(modelId: BedrockChatModelId): LanguageModelV2;
114
+ embedding(modelId: BedrockEmbeddingModelId, settings?: BedrockEmbeddingSettings): EmbeddingModelV2<string>;
90
115
  image(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
91
116
  imageModel(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
92
117
  }
@@ -99,4 +124,4 @@ Default Bedrock provider instance.
99
124
  */
100
125
  declare const bedrock: AmazonBedrockProvider;
101
126
 
102
- export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, bedrock, createAmazonBedrock };
127
+ export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type BedrockProviderOptions, bedrock, createAmazonBedrock };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,39 @@
1
- import { ProviderV2, LanguageModelV2, EmbeddingModelV1, ImageModelV1 } from '@ai-sdk/provider';
1
+ import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV1 } from '@ai-sdk/provider';
2
2
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
+ import { z } from 'zod';
3
4
 
4
5
  type BedrockChatModelId = 'amazon.titan-tg1-large' | 'amazon.titan-text-express-v1' | 'anthropic.claude-v2' | 'anthropic.claude-v2:1' | 'anthropic.claude-instant-v1' | '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' | 'amazon.titan-text-express-v1' | 'amazon.titan-text-lite-v1' | (string & {});
5
- interface BedrockChatSettings {
6
+ declare const bedrockProviderOptions: z.ZodObject<{
6
7
  /**
7
- Additional inference parameters that the model supports,
8
- beyond the base set of inference parameters that Converse
9
- supports in the inferenceConfig field
10
- */
11
- additionalModelRequestFields?: Record<string, any>;
12
- }
8
+ * Additional inference parameters that the model supports,
9
+ * beyond the base set of inference parameters that Converse
10
+ * supports in the inferenceConfig field
11
+ */
12
+ additionalModelRequestFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
13
+ reasoningConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
14
+ type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>>>;
15
+ budgetTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ type?: "enabled" | "disabled" | null | undefined;
18
+ budgetTokens?: number | null | undefined;
19
+ }, {
20
+ type?: "enabled" | "disabled" | null | undefined;
21
+ budgetTokens?: number | null | undefined;
22
+ }>>>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ additionalModelRequestFields?: Record<string, any> | undefined;
25
+ reasoningConfig?: {
26
+ type?: "enabled" | "disabled" | null | undefined;
27
+ budgetTokens?: number | null | undefined;
28
+ } | null | undefined;
29
+ }, {
30
+ additionalModelRequestFields?: Record<string, any> | undefined;
31
+ reasoningConfig?: {
32
+ type?: "enabled" | "disabled" | null | undefined;
33
+ budgetTokens?: number | null | undefined;
34
+ } | null | undefined;
35
+ }>;
36
+ type BedrockProviderOptions = z.infer<typeof bedrockProviderOptions>;
13
37
 
14
38
  type BedrockEmbeddingModelId = 'amazon.titan-embed-text-v1' | 'amazon.titan-embed-text-v2:0' | 'cohere.embed-english-v3' | 'cohere.embed-multilingual-v3' | (string & {});
15
39
  interface BedrockEmbeddingSettings {
@@ -49,6 +73,7 @@ interface AmazonBedrockProviderSettings {
49
73
  region?: string;
50
74
  /**
51
75
  The AWS access key ID to use for the Bedrock provider. Defaults to the value of the
76
+ `AWS_ACCESS_KEY_ID` environment variable.
52
77
  */
53
78
  accessKeyId?: string;
54
79
  /**
@@ -84,9 +109,9 @@ interface AmazonBedrockProviderSettings {
84
109
  generateId?: () => string;
85
110
  }
86
111
  interface AmazonBedrockProvider extends ProviderV2 {
87
- (modelId: BedrockChatModelId, settings?: BedrockChatSettings): LanguageModelV2;
88
- languageModel(modelId: BedrockChatModelId, settings?: BedrockChatSettings): LanguageModelV2;
89
- embedding(modelId: BedrockEmbeddingModelId, settings?: BedrockEmbeddingSettings): EmbeddingModelV1<string>;
112
+ (modelId: BedrockChatModelId): LanguageModelV2;
113
+ languageModel(modelId: BedrockChatModelId): LanguageModelV2;
114
+ embedding(modelId: BedrockEmbeddingModelId, settings?: BedrockEmbeddingSettings): EmbeddingModelV2<string>;
90
115
  image(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
91
116
  imageModel(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
92
117
  }
@@ -99,4 +124,4 @@ Default Bedrock provider instance.
99
124
  */
100
125
  declare const bedrock: AmazonBedrockProvider;
101
126
 
102
- export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, bedrock, createAmazonBedrock };
127
+ export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type BedrockProviderOptions, bedrock, createAmazonBedrock };