@ai-sdk/amazon-bedrock 2.2.8 → 3.0.0-alpha.1
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 +195 -15
- package/README.md +2 -2
- package/dist/index.d.mts +46 -34
- package/dist/index.d.ts +46 -34
- package/dist/index.js +366 -356
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +373 -361
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,35 +1,215 @@
|
|
|
1
1
|
# @ai-sdk/amazon-bedrock
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.0-alpha.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- Updated dependencies [
|
|
8
|
-
- @ai-sdk/provider@
|
|
9
|
-
- @ai-sdk/provider-utils@
|
|
7
|
+
- Updated dependencies [3f2f00c]
|
|
8
|
+
- @ai-sdk/provider@2.0.0-alpha.1
|
|
9
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.1
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 3.0.0-canary.19
|
|
12
12
|
|
|
13
13
|
### Patch Changes
|
|
14
14
|
|
|
15
|
-
- Updated dependencies [
|
|
16
|
-
- @ai-sdk/provider@
|
|
17
|
-
- @ai-sdk/provider-utils@2.2.6
|
|
15
|
+
- Updated dependencies [faf8446]
|
|
16
|
+
- @ai-sdk/provider-utils@3.0.0-canary.19
|
|
18
17
|
|
|
19
|
-
##
|
|
18
|
+
## 3.0.0-canary.18
|
|
20
19
|
|
|
21
20
|
### Patch Changes
|
|
22
21
|
|
|
23
|
-
- Updated dependencies [
|
|
24
|
-
- @ai-sdk/provider-utils@
|
|
25
|
-
- @ai-sdk/provider@1.1.1
|
|
22
|
+
- Updated dependencies [40acf9b]
|
|
23
|
+
- @ai-sdk/provider-utils@3.0.0-canary.18
|
|
26
24
|
|
|
27
|
-
##
|
|
25
|
+
## 3.0.0-canary.17
|
|
28
26
|
|
|
29
27
|
### Patch Changes
|
|
30
28
|
|
|
31
|
-
- Updated dependencies [
|
|
32
|
-
- @ai-sdk/provider-utils@
|
|
29
|
+
- Updated dependencies [ea7a7c9]
|
|
30
|
+
- @ai-sdk/provider-utils@3.0.0-canary.17
|
|
31
|
+
|
|
32
|
+
## 3.0.0-canary.16
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [87b828f]
|
|
37
|
+
- @ai-sdk/provider-utils@3.0.0-canary.16
|
|
38
|
+
|
|
39
|
+
## 3.0.0-canary.15
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency
|
|
44
|
+
- 6f231db: fix(providers): always use optional instead of mix of nullish for providerOptions
|
|
45
|
+
- Updated dependencies [a571d6e]
|
|
46
|
+
- Updated dependencies [a8c8bd5]
|
|
47
|
+
- Updated dependencies [7979f7f]
|
|
48
|
+
- Updated dependencies [41fa418]
|
|
49
|
+
- @ai-sdk/provider-utils@3.0.0-canary.15
|
|
50
|
+
- @ai-sdk/provider@2.0.0-canary.14
|
|
51
|
+
|
|
52
|
+
## 3.0.0-canary.14
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- Updated dependencies [957b739]
|
|
57
|
+
- Updated dependencies [9bd5ab5]
|
|
58
|
+
- @ai-sdk/provider-utils@3.0.0-canary.14
|
|
59
|
+
- @ai-sdk/provider@2.0.0-canary.13
|
|
60
|
+
|
|
61
|
+
## 3.0.0-canary.13
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- d9209ca: fix (image-model): `specificationVersion: v1` -> `v2`
|
|
66
|
+
- Updated dependencies [7b3ae3f]
|
|
67
|
+
- Updated dependencies [0ff02bb]
|
|
68
|
+
- @ai-sdk/provider@2.0.0-canary.12
|
|
69
|
+
- @ai-sdk/provider-utils@3.0.0-canary.13
|
|
70
|
+
|
|
71
|
+
## 3.0.0-canary.12
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- Updated dependencies [9bf7291]
|
|
76
|
+
- Updated dependencies [4617fab]
|
|
77
|
+
- Updated dependencies [e030615]
|
|
78
|
+
- @ai-sdk/provider@2.0.0-canary.11
|
|
79
|
+
- @ai-sdk/provider-utils@3.0.0-canary.12
|
|
80
|
+
|
|
81
|
+
## 3.0.0-canary.11
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
|
|
86
|
+
- Updated dependencies [66962ed]
|
|
87
|
+
- Updated dependencies [9301f86]
|
|
88
|
+
- Updated dependencies [a3f768e]
|
|
89
|
+
- @ai-sdk/provider-utils@3.0.0-canary.11
|
|
90
|
+
- @ai-sdk/provider@2.0.0-canary.10
|
|
91
|
+
|
|
92
|
+
## 3.0.0-canary.10
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- Updated dependencies [e86be6f]
|
|
97
|
+
- @ai-sdk/provider@2.0.0-canary.9
|
|
98
|
+
- @ai-sdk/provider-utils@3.0.0-canary.10
|
|
99
|
+
|
|
100
|
+
## 3.0.0-canary.9
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- 92c0b4b: chore(providers/bedrock): update embedding model to use providerOptions
|
|
105
|
+
- Updated dependencies [95857aa]
|
|
106
|
+
- Updated dependencies [7ea4132]
|
|
107
|
+
- @ai-sdk/provider@2.0.0-canary.8
|
|
108
|
+
- @ai-sdk/provider-utils@3.0.0-canary.9
|
|
109
|
+
|
|
110
|
+
## 3.0.0-canary.8
|
|
111
|
+
|
|
112
|
+
### Patch Changes
|
|
113
|
+
|
|
114
|
+
- Updated dependencies [5d142ab]
|
|
115
|
+
- Updated dependencies [b6b43c7]
|
|
116
|
+
- Updated dependencies [8aa9e20]
|
|
117
|
+
- Updated dependencies [3795467]
|
|
118
|
+
- @ai-sdk/provider-utils@3.0.0-canary.8
|
|
119
|
+
- @ai-sdk/provider@2.0.0-canary.7
|
|
120
|
+
|
|
121
|
+
## 3.0.0-canary.7
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- fa49207: feat(providers/openai-compatible): convert to providerOptions
|
|
126
|
+
- 26735b5: chore(embedding-model): add v2 interface
|
|
127
|
+
- Updated dependencies [26735b5]
|
|
128
|
+
- Updated dependencies [443d8ec]
|
|
129
|
+
- Updated dependencies [14c9410]
|
|
130
|
+
- Updated dependencies [d9c98f4]
|
|
131
|
+
- Updated dependencies [c4a2fec]
|
|
132
|
+
- Updated dependencies [0054544]
|
|
133
|
+
- Updated dependencies [9e9c809]
|
|
134
|
+
- Updated dependencies [32831c6]
|
|
135
|
+
- Updated dependencies [d0f9495]
|
|
136
|
+
- Updated dependencies [fd65bc6]
|
|
137
|
+
- Updated dependencies [393138b]
|
|
138
|
+
- Updated dependencies [7182d14]
|
|
139
|
+
- @ai-sdk/provider@2.0.0-canary.6
|
|
140
|
+
- @ai-sdk/provider-utils@3.0.0-canary.7
|
|
141
|
+
|
|
142
|
+
## 3.0.0-canary.6
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- 97ea26f: chore(providers/bedrock): convert to providerOptions
|
|
147
|
+
- 97ea26f: chore(providers/bedrock): use camelCase for providerOptions
|
|
148
|
+
- Updated dependencies [411e483]
|
|
149
|
+
- Updated dependencies [79457bd]
|
|
150
|
+
- Updated dependencies [ad80501]
|
|
151
|
+
- Updated dependencies [1766ede]
|
|
152
|
+
- Updated dependencies [f10304b]
|
|
153
|
+
- @ai-sdk/provider@2.0.0-canary.5
|
|
154
|
+
- @ai-sdk/provider-utils@3.0.0-canary.6
|
|
155
|
+
|
|
156
|
+
## 3.0.0-canary.5
|
|
157
|
+
|
|
158
|
+
### Patch Changes
|
|
159
|
+
|
|
160
|
+
- Updated dependencies [6f6bb89]
|
|
161
|
+
- @ai-sdk/provider@2.0.0-canary.4
|
|
162
|
+
- @ai-sdk/provider-utils@3.0.0-canary.5
|
|
163
|
+
|
|
164
|
+
## 3.0.0-canary.4
|
|
165
|
+
|
|
166
|
+
### Patch Changes
|
|
167
|
+
|
|
168
|
+
- Updated dependencies [d1a1aa1]
|
|
169
|
+
- @ai-sdk/provider@2.0.0-canary.3
|
|
170
|
+
- @ai-sdk/provider-utils@3.0.0-canary.4
|
|
171
|
+
|
|
172
|
+
## 3.0.0-canary.3
|
|
173
|
+
|
|
174
|
+
### Patch Changes
|
|
175
|
+
|
|
176
|
+
- Updated dependencies [a166433]
|
|
177
|
+
- Updated dependencies [abf9a79]
|
|
178
|
+
- Updated dependencies [9f95b35]
|
|
179
|
+
- Updated dependencies [0a87932]
|
|
180
|
+
- Updated dependencies [6dc848c]
|
|
181
|
+
- @ai-sdk/provider-utils@3.0.0-canary.3
|
|
182
|
+
- @ai-sdk/provider@2.0.0-canary.2
|
|
183
|
+
|
|
184
|
+
## 3.0.0-canary.2
|
|
185
|
+
|
|
186
|
+
### Patch Changes
|
|
187
|
+
|
|
188
|
+
- Updated dependencies [c57e248]
|
|
189
|
+
- Updated dependencies [33f4a6a]
|
|
190
|
+
- @ai-sdk/provider@2.0.0-canary.1
|
|
191
|
+
- @ai-sdk/provider-utils@3.0.0-canary.2
|
|
192
|
+
|
|
193
|
+
## 3.0.0-canary.1
|
|
194
|
+
|
|
195
|
+
### Patch Changes
|
|
196
|
+
|
|
197
|
+
- Updated dependencies [060370c]
|
|
198
|
+
- Updated dependencies [0c0c0b3]
|
|
199
|
+
- Updated dependencies [63d791d]
|
|
200
|
+
- @ai-sdk/provider-utils@3.0.0-canary.1
|
|
201
|
+
|
|
202
|
+
## 3.0.0-canary.0
|
|
203
|
+
|
|
204
|
+
### Major Changes
|
|
205
|
+
|
|
206
|
+
- d5f588f: AI SDK 5
|
|
207
|
+
|
|
208
|
+
### Patch Changes
|
|
209
|
+
|
|
210
|
+
- Updated dependencies [d5f588f]
|
|
211
|
+
- @ai-sdk/provider-utils@3.0.0-canary.0
|
|
212
|
+
- @ai-sdk/provider@2.0.0-canary.0
|
|
33
213
|
|
|
34
214
|
## 2.2.4
|
|
35
215
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AI SDK - Amazon Bedrock Provider
|
|
2
2
|
|
|
3
|
-
The **[Amazon Bedrock provider](https://sdk.
|
|
3
|
+
The **[Amazon Bedrock provider](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock)** for the [AI SDK](https://ai-sdk.dev/docs)
|
|
4
4
|
contains language model support for the Amazon Bedrock [converse API](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html).
|
|
5
5
|
|
|
6
6
|
## Setup
|
|
@@ -33,4 +33,4 @@ const { text } = await generateText({
|
|
|
33
33
|
|
|
34
34
|
## Documentation
|
|
35
35
|
|
|
36
|
-
Please check out the **[Amazon Bedrock provider documentation](https://sdk.
|
|
36
|
+
Please check out the **[Amazon Bedrock provider documentation](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock)** for more information.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
6
|
+
declare const bedrockProviderOptions: z.ZodObject<{
|
|
6
7
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
additionalModelRequestFields
|
|
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.ZodObject<{
|
|
14
|
+
type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>>;
|
|
15
|
+
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
type?: "enabled" | "disabled" | undefined;
|
|
18
|
+
budgetTokens?: number | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
type?: "enabled" | "disabled" | undefined;
|
|
21
|
+
budgetTokens?: number | undefined;
|
|
22
|
+
}>>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
additionalModelRequestFields?: Record<string, any> | undefined;
|
|
25
|
+
reasoningConfig?: {
|
|
26
|
+
type?: "enabled" | "disabled" | undefined;
|
|
27
|
+
budgetTokens?: number | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
additionalModelRequestFields?: Record<string, any> | undefined;
|
|
31
|
+
reasoningConfig?: {
|
|
32
|
+
type?: "enabled" | "disabled" | undefined;
|
|
33
|
+
budgetTokens?: number | undefined;
|
|
34
|
+
} | 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
|
-
interface BedrockImageSettings {
|
|
30
|
-
/**
|
|
31
|
-
* Override the maximum number of images per call (default is dependent on the
|
|
32
|
-
* model, or 1 for an unknown model).
|
|
33
|
-
*/
|
|
34
|
-
maxImagesPerCall?: number;
|
|
35
|
-
}
|
|
36
41
|
|
|
37
42
|
interface BedrockCredentials {
|
|
38
43
|
region: string;
|
|
@@ -84,12 +89,19 @@ interface AmazonBedrockProviderSettings {
|
|
|
84
89
|
credentialProvider?: () => PromiseLike<Omit<BedrockCredentials, 'region'>>;
|
|
85
90
|
generateId?: () => string;
|
|
86
91
|
}
|
|
87
|
-
interface AmazonBedrockProvider extends
|
|
88
|
-
(modelId: BedrockChatModelId
|
|
89
|
-
languageModel(modelId: BedrockChatModelId
|
|
90
|
-
embedding(modelId: BedrockEmbeddingModelId
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
interface AmazonBedrockProvider extends ProviderV2 {
|
|
93
|
+
(modelId: BedrockChatModelId): LanguageModelV2;
|
|
94
|
+
languageModel(modelId: BedrockChatModelId): LanguageModelV2;
|
|
95
|
+
embedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV2<string>;
|
|
96
|
+
/**
|
|
97
|
+
Creates a model for image generation.
|
|
98
|
+
@deprecated Use `imageModel` instead.
|
|
99
|
+
*/
|
|
100
|
+
image(modelId: BedrockImageModelId): ImageModelV2;
|
|
101
|
+
/**
|
|
102
|
+
Creates a model for image generation.
|
|
103
|
+
*/
|
|
104
|
+
imageModel(modelId: BedrockImageModelId): ImageModelV2;
|
|
93
105
|
}
|
|
94
106
|
/**
|
|
95
107
|
Create an Amazon Bedrock provider instance.
|
|
@@ -100,4 +112,4 @@ Default Bedrock provider instance.
|
|
|
100
112
|
*/
|
|
101
113
|
declare const bedrock: AmazonBedrockProvider;
|
|
102
114
|
|
|
103
|
-
export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, bedrock, createAmazonBedrock };
|
|
115
|
+
export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type BedrockProviderOptions, bedrock, createAmazonBedrock };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
6
|
+
declare const bedrockProviderOptions: z.ZodObject<{
|
|
6
7
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
additionalModelRequestFields
|
|
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.ZodObject<{
|
|
14
|
+
type: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>>;
|
|
15
|
+
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
type?: "enabled" | "disabled" | undefined;
|
|
18
|
+
budgetTokens?: number | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
type?: "enabled" | "disabled" | undefined;
|
|
21
|
+
budgetTokens?: number | undefined;
|
|
22
|
+
}>>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
additionalModelRequestFields?: Record<string, any> | undefined;
|
|
25
|
+
reasoningConfig?: {
|
|
26
|
+
type?: "enabled" | "disabled" | undefined;
|
|
27
|
+
budgetTokens?: number | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
additionalModelRequestFields?: Record<string, any> | undefined;
|
|
31
|
+
reasoningConfig?: {
|
|
32
|
+
type?: "enabled" | "disabled" | undefined;
|
|
33
|
+
budgetTokens?: number | undefined;
|
|
34
|
+
} | 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
|
-
interface BedrockImageSettings {
|
|
30
|
-
/**
|
|
31
|
-
* Override the maximum number of images per call (default is dependent on the
|
|
32
|
-
* model, or 1 for an unknown model).
|
|
33
|
-
*/
|
|
34
|
-
maxImagesPerCall?: number;
|
|
35
|
-
}
|
|
36
41
|
|
|
37
42
|
interface BedrockCredentials {
|
|
38
43
|
region: string;
|
|
@@ -84,12 +89,19 @@ interface AmazonBedrockProviderSettings {
|
|
|
84
89
|
credentialProvider?: () => PromiseLike<Omit<BedrockCredentials, 'region'>>;
|
|
85
90
|
generateId?: () => string;
|
|
86
91
|
}
|
|
87
|
-
interface AmazonBedrockProvider extends
|
|
88
|
-
(modelId: BedrockChatModelId
|
|
89
|
-
languageModel(modelId: BedrockChatModelId
|
|
90
|
-
embedding(modelId: BedrockEmbeddingModelId
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
interface AmazonBedrockProvider extends ProviderV2 {
|
|
93
|
+
(modelId: BedrockChatModelId): LanguageModelV2;
|
|
94
|
+
languageModel(modelId: BedrockChatModelId): LanguageModelV2;
|
|
95
|
+
embedding(modelId: BedrockEmbeddingModelId): EmbeddingModelV2<string>;
|
|
96
|
+
/**
|
|
97
|
+
Creates a model for image generation.
|
|
98
|
+
@deprecated Use `imageModel` instead.
|
|
99
|
+
*/
|
|
100
|
+
image(modelId: BedrockImageModelId): ImageModelV2;
|
|
101
|
+
/**
|
|
102
|
+
Creates a model for image generation.
|
|
103
|
+
*/
|
|
104
|
+
imageModel(modelId: BedrockImageModelId): ImageModelV2;
|
|
93
105
|
}
|
|
94
106
|
/**
|
|
95
107
|
Create an Amazon Bedrock provider instance.
|
|
@@ -100,4 +112,4 @@ Default Bedrock provider instance.
|
|
|
100
112
|
*/
|
|
101
113
|
declare const bedrock: AmazonBedrockProvider;
|
|
102
114
|
|
|
103
|
-
export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, bedrock, createAmazonBedrock };
|
|
115
|
+
export { type AmazonBedrockProvider, type AmazonBedrockProviderSettings, type BedrockProviderOptions, bedrock, createAmazonBedrock };
|