@ai-sdk/amazon-bedrock 3.0.0-canary.1 → 3.0.0-canary.11

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,117 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 3.0.0-canary.11
4
+
5
+ ### Patch Changes
6
+
7
+ - 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
8
+ - Updated dependencies [66962ed]
9
+ - Updated dependencies [9301f86]
10
+ - Updated dependencies [a3f768e]
11
+ - @ai-sdk/provider-utils@3.0.0-canary.11
12
+ - @ai-sdk/provider@2.0.0-canary.10
13
+
14
+ ## 3.0.0-canary.10
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [e86be6f]
19
+ - @ai-sdk/provider@2.0.0-canary.9
20
+ - @ai-sdk/provider-utils@3.0.0-canary.10
21
+
22
+ ## 3.0.0-canary.9
23
+
24
+ ### Patch Changes
25
+
26
+ - 92c0b4b: chore(providers/bedrock): update embedding model to use providerOptions
27
+ - Updated dependencies [95857aa]
28
+ - Updated dependencies [7ea4132]
29
+ - @ai-sdk/provider@2.0.0-canary.8
30
+ - @ai-sdk/provider-utils@3.0.0-canary.9
31
+
32
+ ## 3.0.0-canary.8
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [5d142ab]
37
+ - Updated dependencies [b6b43c7]
38
+ - Updated dependencies [8aa9e20]
39
+ - Updated dependencies [3795467]
40
+ - @ai-sdk/provider-utils@3.0.0-canary.8
41
+ - @ai-sdk/provider@2.0.0-canary.7
42
+
43
+ ## 3.0.0-canary.7
44
+
45
+ ### Patch Changes
46
+
47
+ - fa49207: feat(providers/openai-compatible): convert to providerOptions
48
+ - 26735b5: chore(embedding-model): add v2 interface
49
+ - Updated dependencies [26735b5]
50
+ - Updated dependencies [443d8ec]
51
+ - Updated dependencies [14c9410]
52
+ - Updated dependencies [d9c98f4]
53
+ - Updated dependencies [c4a2fec]
54
+ - Updated dependencies [0054544]
55
+ - Updated dependencies [9e9c809]
56
+ - Updated dependencies [32831c6]
57
+ - Updated dependencies [d0f9495]
58
+ - Updated dependencies [fd65bc6]
59
+ - Updated dependencies [393138b]
60
+ - Updated dependencies [7182d14]
61
+ - @ai-sdk/provider@2.0.0-canary.6
62
+ - @ai-sdk/provider-utils@3.0.0-canary.7
63
+
64
+ ## 3.0.0-canary.6
65
+
66
+ ### Patch Changes
67
+
68
+ - 97ea26f: chore(providers/bedrock): convert to providerOptions
69
+ - 97ea26f: chore(providers/bedrock): use camelCase for providerOptions
70
+ - Updated dependencies [411e483]
71
+ - Updated dependencies [79457bd]
72
+ - Updated dependencies [ad80501]
73
+ - Updated dependencies [1766ede]
74
+ - Updated dependencies [f10304b]
75
+ - @ai-sdk/provider@2.0.0-canary.5
76
+ - @ai-sdk/provider-utils@3.0.0-canary.6
77
+
78
+ ## 3.0.0-canary.5
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies [6f6bb89]
83
+ - @ai-sdk/provider@2.0.0-canary.4
84
+ - @ai-sdk/provider-utils@3.0.0-canary.5
85
+
86
+ ## 3.0.0-canary.4
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [d1a1aa1]
91
+ - @ai-sdk/provider@2.0.0-canary.3
92
+ - @ai-sdk/provider-utils@3.0.0-canary.4
93
+
94
+ ## 3.0.0-canary.3
95
+
96
+ ### Patch Changes
97
+
98
+ - Updated dependencies [a166433]
99
+ - Updated dependencies [abf9a79]
100
+ - Updated dependencies [9f95b35]
101
+ - Updated dependencies [0a87932]
102
+ - Updated dependencies [6dc848c]
103
+ - @ai-sdk/provider-utils@3.0.0-canary.3
104
+ - @ai-sdk/provider@2.0.0-canary.2
105
+
106
+ ## 3.0.0-canary.2
107
+
108
+ ### Patch Changes
109
+
110
+ - Updated dependencies [c57e248]
111
+ - Updated dependencies [33f4a6a]
112
+ - @ai-sdk/provider@2.0.0-canary.1
113
+ - @ai-sdk/provider-utils@3.0.0-canary.2
114
+
3
115
  ## 3.0.0-canary.1
4
116
 
5
117
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,29 +1,41 @@
1
- import { ProviderV2, LanguageModelV2, EmbeddingModelV1, ImageModelV1 } from '@ai-sdk/provider';
1
+ import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2 } 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
- interface BedrockEmbeddingSettings {
16
- /**
17
- The number of dimensions the resulting output embeddings should have (defaults to 1024).
18
- Only supported in amazon.titan-embed-text-v2:0.
19
- */
20
- dimensions?: 1024 | 512 | 256;
21
- /**
22
- Flag indicating whether or not to normalize the output embeddings. Defaults to true
23
- Only supported in amazon.titan-embed-text-v2:0.
24
- */
25
- normalize?: boolean;
26
- }
27
39
 
28
40
  type BedrockImageModelId = 'amazon.nova-canvas-v1:0' | (string & {});
29
41
  interface BedrockImageSettings {
@@ -49,6 +61,7 @@ interface AmazonBedrockProviderSettings {
49
61
  region?: string;
50
62
  /**
51
63
  The AWS access key ID to use for the Bedrock provider. Defaults to the value of the
64
+ `AWS_ACCESS_KEY_ID` environment variable.
52
65
  */
53
66
  accessKeyId?: string;
54
67
  /**
@@ -84,11 +97,11 @@ interface AmazonBedrockProviderSettings {
84
97
  generateId?: () => string;
85
98
  }
86
99
  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>;
90
- image(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
91
- imageModel(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
100
+ (modelId: BedrockChatModelId): LanguageModelV2;
101
+ languageModel(modelId: BedrockChatModelId): LanguageModelV2;
102
+ embedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV2<string>;
103
+ image(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV2;
104
+ imageModel(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV2;
92
105
  }
93
106
  /**
94
107
  Create an Amazon Bedrock provider instance.
@@ -99,4 +112,4 @@ Default Bedrock provider instance.
99
112
  */
100
113
  declare const bedrock: AmazonBedrockProvider;
101
114
 
102
- export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, bedrock, createAmazonBedrock };
115
+ export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type BedrockProviderOptions, bedrock, createAmazonBedrock };
package/dist/index.d.ts CHANGED
@@ -1,29 +1,41 @@
1
- import { ProviderV2, LanguageModelV2, EmbeddingModelV1, ImageModelV1 } from '@ai-sdk/provider';
1
+ import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2 } 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
- interface BedrockEmbeddingSettings {
16
- /**
17
- The number of dimensions the resulting output embeddings should have (defaults to 1024).
18
- Only supported in amazon.titan-embed-text-v2:0.
19
- */
20
- dimensions?: 1024 | 512 | 256;
21
- /**
22
- Flag indicating whether or not to normalize the output embeddings. Defaults to true
23
- Only supported in amazon.titan-embed-text-v2:0.
24
- */
25
- normalize?: boolean;
26
- }
27
39
 
28
40
  type BedrockImageModelId = 'amazon.nova-canvas-v1:0' | (string & {});
29
41
  interface BedrockImageSettings {
@@ -49,6 +61,7 @@ interface AmazonBedrockProviderSettings {
49
61
  region?: string;
50
62
  /**
51
63
  The AWS access key ID to use for the Bedrock provider. Defaults to the value of the
64
+ `AWS_ACCESS_KEY_ID` environment variable.
52
65
  */
53
66
  accessKeyId?: string;
54
67
  /**
@@ -84,11 +97,11 @@ interface AmazonBedrockProviderSettings {
84
97
  generateId?: () => string;
85
98
  }
86
99
  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>;
90
- image(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
91
- imageModel(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
100
+ (modelId: BedrockChatModelId): LanguageModelV2;
101
+ languageModel(modelId: BedrockChatModelId): LanguageModelV2;
102
+ embedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV2<string>;
103
+ image(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV2;
104
+ imageModel(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV2;
92
105
  }
93
106
  /**
94
107
  Create an Amazon Bedrock provider instance.
@@ -99,4 +112,4 @@ Default Bedrock provider instance.
99
112
  */
100
113
  declare const bedrock: AmazonBedrockProvider;
101
114
 
102
- export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, bedrock, createAmazonBedrock };
115
+ export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type BedrockProviderOptions, bedrock, createAmazonBedrock };