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

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,106 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 3.0.0-canary.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [e86be6f]
8
+ - @ai-sdk/provider@2.0.0-canary.9
9
+ - @ai-sdk/provider-utils@3.0.0-canary.10
10
+
11
+ ## 3.0.0-canary.9
12
+
13
+ ### Patch Changes
14
+
15
+ - 92c0b4b: chore(providers/bedrock): update embedding model to use providerOptions
16
+ - Updated dependencies [95857aa]
17
+ - Updated dependencies [7ea4132]
18
+ - @ai-sdk/provider@2.0.0-canary.8
19
+ - @ai-sdk/provider-utils@3.0.0-canary.9
20
+
21
+ ## 3.0.0-canary.8
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [5d142ab]
26
+ - Updated dependencies [b6b43c7]
27
+ - Updated dependencies [8aa9e20]
28
+ - Updated dependencies [3795467]
29
+ - @ai-sdk/provider-utils@3.0.0-canary.8
30
+ - @ai-sdk/provider@2.0.0-canary.7
31
+
32
+ ## 3.0.0-canary.7
33
+
34
+ ### Patch Changes
35
+
36
+ - fa49207: feat(providers/openai-compatible): convert to providerOptions
37
+ - 26735b5: chore(embedding-model): add v2 interface
38
+ - Updated dependencies [26735b5]
39
+ - Updated dependencies [443d8ec]
40
+ - Updated dependencies [14c9410]
41
+ - Updated dependencies [d9c98f4]
42
+ - Updated dependencies [c4a2fec]
43
+ - Updated dependencies [0054544]
44
+ - Updated dependencies [9e9c809]
45
+ - Updated dependencies [32831c6]
46
+ - Updated dependencies [d0f9495]
47
+ - Updated dependencies [fd65bc6]
48
+ - Updated dependencies [393138b]
49
+ - Updated dependencies [7182d14]
50
+ - @ai-sdk/provider@2.0.0-canary.6
51
+ - @ai-sdk/provider-utils@3.0.0-canary.7
52
+
53
+ ## 3.0.0-canary.6
54
+
55
+ ### Patch Changes
56
+
57
+ - 97ea26f: chore(providers/bedrock): convert to providerOptions
58
+ - 97ea26f: chore(providers/bedrock): use camelCase for providerOptions
59
+ - Updated dependencies [411e483]
60
+ - Updated dependencies [79457bd]
61
+ - Updated dependencies [ad80501]
62
+ - Updated dependencies [1766ede]
63
+ - Updated dependencies [f10304b]
64
+ - @ai-sdk/provider@2.0.0-canary.5
65
+ - @ai-sdk/provider-utils@3.0.0-canary.6
66
+
67
+ ## 3.0.0-canary.5
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies [6f6bb89]
72
+ - @ai-sdk/provider@2.0.0-canary.4
73
+ - @ai-sdk/provider-utils@3.0.0-canary.5
74
+
75
+ ## 3.0.0-canary.4
76
+
77
+ ### Patch Changes
78
+
79
+ - Updated dependencies [d1a1aa1]
80
+ - @ai-sdk/provider@2.0.0-canary.3
81
+ - @ai-sdk/provider-utils@3.0.0-canary.4
82
+
83
+ ## 3.0.0-canary.3
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [a166433]
88
+ - Updated dependencies [abf9a79]
89
+ - Updated dependencies [9f95b35]
90
+ - Updated dependencies [0a87932]
91
+ - Updated dependencies [6dc848c]
92
+ - @ai-sdk/provider-utils@3.0.0-canary.3
93
+ - @ai-sdk/provider@2.0.0-canary.2
94
+
95
+ ## 3.0.0-canary.2
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [c57e248]
100
+ - Updated dependencies [33f4a6a]
101
+ - @ai-sdk/provider@2.0.0-canary.1
102
+ - @ai-sdk/provider-utils@3.0.0-canary.2
103
+
3
104
  ## 3.0.0-canary.1
4
105
 
5
106
  ### 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, 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
- 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,9 +97,9 @@ 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>;
100
+ (modelId: BedrockChatModelId): LanguageModelV2;
101
+ languageModel(modelId: BedrockChatModelId): LanguageModelV2;
102
+ embedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV2<string>;
90
103
  image(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
91
104
  imageModel(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
92
105
  }
@@ -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, 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
- 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,9 +97,9 @@ 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>;
100
+ (modelId: BedrockChatModelId): LanguageModelV2;
101
+ languageModel(modelId: BedrockChatModelId): LanguageModelV2;
102
+ embedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV2<string>;
90
103
  image(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
91
104
  imageModel(modelId: BedrockImageModelId, settings?: BedrockImageSettings): ImageModelV1;
92
105
  }
@@ -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 };