@adaline/bedrock 0.16.0 → 0.18.0

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/dist/index.d.mts CHANGED
@@ -44,6 +44,220 @@ declare class BaseChatModelAnthropic extends BaseChatModel {
44
44
  partialResponse: PartialChatResponseType;
45
45
  buffer: string;
46
46
  }>;
47
+ transformProxyStreamChatResponseChunk(chunk: string, buffer: string, data?: any, headers?: Record<string, string>, query?: Record<string, string>): AsyncGenerator<{
48
+ partialResponse: PartialChatResponseType;
49
+ buffer: string;
50
+ }>;
51
+ private getRegionHelper;
52
+ getProxyStreamChatUrl(data?: any, headers?: Record<string, string>, query?: Record<string, string>): Promise<UrlType>;
53
+ private getProxyChatHeaders;
54
+ getProxyCompleteChatUrl(data?: any, headers?: Record<string, string>, query?: Record<string, string>): Promise<UrlType>;
55
+ getProxyCompleteChatHeaders(data?: any, headers?: Record<string, string>, query?: Record<string, string>): Promise<HeadersType>;
56
+ getProxyStreamChatHeaders(data?: any, headers?: Record<string, string>, query?: Record<string, string>): Promise<HeadersType>;
57
+ }
58
+
59
+ declare const BedrockClaude3_5Haiku20241022Literal = "anthropic.claude-3-5-haiku-20241022-v1:0";
60
+ declare const BedrockClaude3_5Haiku20241022Schema: {
61
+ name: string;
62
+ description: string;
63
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
64
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
65
+ maxInputTokens: number;
66
+ maxOutputTokens: number;
67
+ config: {
68
+ def: Record<string, {
69
+ type: "multi-string";
70
+ param: string;
71
+ title: string;
72
+ description: string;
73
+ max: number;
74
+ } | {
75
+ type: "object-schema";
76
+ param: string;
77
+ title: string;
78
+ description: string;
79
+ objectSchema?: any;
80
+ } | {
81
+ type: "range";
82
+ param: string;
83
+ title: string;
84
+ description: string;
85
+ max: number;
86
+ default: number;
87
+ min: number;
88
+ step: number;
89
+ } | {
90
+ type: "select-boolean";
91
+ param: string;
92
+ title: string;
93
+ description: string;
94
+ default: boolean | null;
95
+ } | {
96
+ type: "select-string";
97
+ param: string;
98
+ title: string;
99
+ description: string;
100
+ default: string | null;
101
+ choices: string[];
102
+ }>;
103
+ schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
104
+ };
105
+ };
106
+ declare const BedrockClaude3_5Haiku20241022Options: z.ZodObject<{
107
+ modelName: z.ZodString;
108
+ awsRegion: z.ZodString;
109
+ awsAccessKeyId: z.ZodString;
110
+ awsSecretAccessKey: z.ZodString;
111
+ }, "strip", z.ZodTypeAny, {
112
+ modelName: string;
113
+ awsRegion: string;
114
+ awsAccessKeyId: string;
115
+ awsSecretAccessKey: string;
116
+ }, {
117
+ modelName: string;
118
+ awsRegion: string;
119
+ awsAccessKeyId: string;
120
+ awsSecretAccessKey: string;
121
+ }>;
122
+ type BedrockClaude3_5Haiku20241022OptionsType = z.infer<typeof BedrockClaude3_5Haiku20241022Options>;
123
+ declare class BedrockClaude3_5Haiku20241022 extends BaseChatModelAnthropic {
124
+ constructor(options: BedrockClaude3_5Haiku20241022OptionsType);
125
+ }
126
+
127
+ declare const BedrockClaude3_5Sonnet20240620Literal = "anthropic.claude-3-5-sonnet-20240620-v1:0";
128
+ declare const BedrockClaude3_5Sonnet20240620Schema: {
129
+ name: string;
130
+ description: string;
131
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
132
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
133
+ maxInputTokens: number;
134
+ maxOutputTokens: number;
135
+ config: {
136
+ def: Record<string, {
137
+ type: "multi-string";
138
+ param: string;
139
+ title: string;
140
+ description: string;
141
+ max: number;
142
+ } | {
143
+ type: "object-schema";
144
+ param: string;
145
+ title: string;
146
+ description: string;
147
+ objectSchema?: any;
148
+ } | {
149
+ type: "range";
150
+ param: string;
151
+ title: string;
152
+ description: string;
153
+ max: number;
154
+ default: number;
155
+ min: number;
156
+ step: number;
157
+ } | {
158
+ type: "select-boolean";
159
+ param: string;
160
+ title: string;
161
+ description: string;
162
+ default: boolean | null;
163
+ } | {
164
+ type: "select-string";
165
+ param: string;
166
+ title: string;
167
+ description: string;
168
+ default: string | null;
169
+ choices: string[];
170
+ }>;
171
+ schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
172
+ };
173
+ };
174
+ declare const BedrockClaude3_5Sonnet20240620Options: z.ZodObject<{
175
+ modelName: z.ZodString;
176
+ awsRegion: z.ZodString;
177
+ awsAccessKeyId: z.ZodString;
178
+ awsSecretAccessKey: z.ZodString;
179
+ }, "strip", z.ZodTypeAny, {
180
+ modelName: string;
181
+ awsRegion: string;
182
+ awsAccessKeyId: string;
183
+ awsSecretAccessKey: string;
184
+ }, {
185
+ modelName: string;
186
+ awsRegion: string;
187
+ awsAccessKeyId: string;
188
+ awsSecretAccessKey: string;
189
+ }>;
190
+ type BedrockClaude3_5Sonnet20240620OptionsType = z.infer<typeof BedrockClaude3_5Sonnet20240620Options>;
191
+ declare class BedrockClaude3_5Sonnet20240620 extends BaseChatModelAnthropic {
192
+ constructor(options: BedrockClaude3_5Sonnet20240620OptionsType);
193
+ }
194
+
195
+ declare const BedrockClaude3_5Sonnet20241022Literal = "anthropic.claude-3-5-sonnet-20241022-v2:0";
196
+ declare const BedrockClaude3_5Sonnet20241022Schema: {
197
+ name: string;
198
+ description: string;
199
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
200
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
201
+ maxInputTokens: number;
202
+ maxOutputTokens: number;
203
+ config: {
204
+ def: Record<string, {
205
+ type: "multi-string";
206
+ param: string;
207
+ title: string;
208
+ description: string;
209
+ max: number;
210
+ } | {
211
+ type: "object-schema";
212
+ param: string;
213
+ title: string;
214
+ description: string;
215
+ objectSchema?: any;
216
+ } | {
217
+ type: "range";
218
+ param: string;
219
+ title: string;
220
+ description: string;
221
+ max: number;
222
+ default: number;
223
+ min: number;
224
+ step: number;
225
+ } | {
226
+ type: "select-boolean";
227
+ param: string;
228
+ title: string;
229
+ description: string;
230
+ default: boolean | null;
231
+ } | {
232
+ type: "select-string";
233
+ param: string;
234
+ title: string;
235
+ description: string;
236
+ default: string | null;
237
+ choices: string[];
238
+ }>;
239
+ schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
240
+ };
241
+ };
242
+ declare const BedrockClaude3_5Sonnet20241022Options: z.ZodObject<{
243
+ modelName: z.ZodString;
244
+ awsRegion: z.ZodString;
245
+ awsAccessKeyId: z.ZodString;
246
+ awsSecretAccessKey: z.ZodString;
247
+ }, "strip", z.ZodTypeAny, {
248
+ modelName: string;
249
+ awsRegion: string;
250
+ awsAccessKeyId: string;
251
+ awsSecretAccessKey: string;
252
+ }, {
253
+ modelName: string;
254
+ awsRegion: string;
255
+ awsAccessKeyId: string;
256
+ awsSecretAccessKey: string;
257
+ }>;
258
+ type BedrockClaude3_5Sonnet20241022OptionsType = z.infer<typeof BedrockClaude3_5Sonnet20241022Options>;
259
+ declare class BedrockClaude3_5Sonnet20241022 extends BaseChatModelAnthropic {
260
+ constructor(options: BedrockClaude3_5Sonnet20241022OptionsType);
47
261
  }
48
262
 
49
263
  declare const BedrockClaude3Haiku20240307Literal = "anthropic.claude-3-haiku-20240307-v1:0";
@@ -114,6 +328,142 @@ declare class BedrockClaude3Haiku20240307 extends BaseChatModelAnthropic {
114
328
  constructor(options: BedrockClaude3Haiku20240307OptionsType);
115
329
  }
116
330
 
331
+ declare const BedrockClaude3Opus20240229Literal = "anthropic.claude-3-opus-20240229-v1:0";
332
+ declare const BedrockClaude3Opus20240229Schema: {
333
+ name: string;
334
+ description: string;
335
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
336
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
337
+ maxInputTokens: number;
338
+ maxOutputTokens: number;
339
+ config: {
340
+ def: Record<string, {
341
+ type: "multi-string";
342
+ param: string;
343
+ title: string;
344
+ description: string;
345
+ max: number;
346
+ } | {
347
+ type: "object-schema";
348
+ param: string;
349
+ title: string;
350
+ description: string;
351
+ objectSchema?: any;
352
+ } | {
353
+ type: "range";
354
+ param: string;
355
+ title: string;
356
+ description: string;
357
+ max: number;
358
+ default: number;
359
+ min: number;
360
+ step: number;
361
+ } | {
362
+ type: "select-boolean";
363
+ param: string;
364
+ title: string;
365
+ description: string;
366
+ default: boolean | null;
367
+ } | {
368
+ type: "select-string";
369
+ param: string;
370
+ title: string;
371
+ description: string;
372
+ default: string | null;
373
+ choices: string[];
374
+ }>;
375
+ schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
376
+ };
377
+ };
378
+ declare const BedrockClaude3Opus20240229Options: z.ZodObject<{
379
+ modelName: z.ZodString;
380
+ awsRegion: z.ZodString;
381
+ awsAccessKeyId: z.ZodString;
382
+ awsSecretAccessKey: z.ZodString;
383
+ }, "strip", z.ZodTypeAny, {
384
+ modelName: string;
385
+ awsRegion: string;
386
+ awsAccessKeyId: string;
387
+ awsSecretAccessKey: string;
388
+ }, {
389
+ modelName: string;
390
+ awsRegion: string;
391
+ awsAccessKeyId: string;
392
+ awsSecretAccessKey: string;
393
+ }>;
394
+ type BedrockClaude3Opus20240229OptionsType = z.infer<typeof BedrockClaude3Opus20240229Options>;
395
+ declare class BedrockClaude3Opus20240229 extends BaseChatModelAnthropic {
396
+ constructor(options: BedrockClaude3Opus20240229OptionsType);
397
+ }
398
+
399
+ declare const BedrockClaude3Sonnet20240229Literal = "anthropic.claude-3-sonnet-20240229-v1:0";
400
+ declare const BedrockClaude3Sonnet20240229Schema: {
401
+ name: string;
402
+ description: string;
403
+ roles: Partial<Record<"system" | "user" | "assistant" | "tool", string | undefined>>;
404
+ modalities: ["text" | "image" | "tool-call" | "tool-response", ...("text" | "image" | "tool-call" | "tool-response")[]];
405
+ maxInputTokens: number;
406
+ maxOutputTokens: number;
407
+ config: {
408
+ def: Record<string, {
409
+ type: "multi-string";
410
+ param: string;
411
+ title: string;
412
+ description: string;
413
+ max: number;
414
+ } | {
415
+ type: "object-schema";
416
+ param: string;
417
+ title: string;
418
+ description: string;
419
+ objectSchema?: any;
420
+ } | {
421
+ type: "range";
422
+ param: string;
423
+ title: string;
424
+ description: string;
425
+ max: number;
426
+ default: number;
427
+ min: number;
428
+ step: number;
429
+ } | {
430
+ type: "select-boolean";
431
+ param: string;
432
+ title: string;
433
+ description: string;
434
+ default: boolean | null;
435
+ } | {
436
+ type: "select-string";
437
+ param: string;
438
+ title: string;
439
+ description: string;
440
+ default: string | null;
441
+ choices: string[];
442
+ }>;
443
+ schema: z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, unknown, unknown>;
444
+ };
445
+ };
446
+ declare const BedrockClaude3Sonnet20240229Options: z.ZodObject<{
447
+ modelName: z.ZodString;
448
+ awsRegion: z.ZodString;
449
+ awsAccessKeyId: z.ZodString;
450
+ awsSecretAccessKey: z.ZodString;
451
+ }, "strip", z.ZodTypeAny, {
452
+ modelName: string;
453
+ awsRegion: string;
454
+ awsAccessKeyId: string;
455
+ awsSecretAccessKey: string;
456
+ }, {
457
+ modelName: string;
458
+ awsRegion: string;
459
+ awsAccessKeyId: string;
460
+ awsSecretAccessKey: string;
461
+ }>;
462
+ type BedrockClaude3Sonnet20240229OptionsType = z.infer<typeof BedrockClaude3Sonnet20240229Options>;
463
+ declare class BedrockClaude3Sonnet20240229 extends BaseChatModelAnthropic {
464
+ constructor(options: BedrockClaude3Sonnet20240229OptionsType);
465
+ }
466
+
117
467
  declare class Bedrock<C extends BaseChatModelOptionsType, E extends Record<string, any> = Record<string, any>> implements ProviderV1<C, E> {
118
468
  readonly version: "v1";
119
469
  readonly name = "bedrock";
@@ -129,4 +479,4 @@ declare class Bedrock<C extends BaseChatModelOptionsType, E extends Record<strin
129
479
  embeddingModel(options: E): EmbeddingModelV1;
130
480
  }
131
481
 
132
- export { BaseChatModelAnthropic, BaseChatModelOptions, type BaseChatModelOptionsType, Bedrock, BedrockClaude3Haiku20240307, BedrockClaude3Haiku20240307Literal, BedrockClaude3Haiku20240307Options, type BedrockClaude3Haiku20240307OptionsType, BedrockClaude3Haiku20240307Schema };
482
+ export { BaseChatModelAnthropic, BaseChatModelOptions, type BaseChatModelOptionsType, Bedrock, BedrockClaude3Haiku20240307, BedrockClaude3Haiku20240307Literal, BedrockClaude3Haiku20240307Options, type BedrockClaude3Haiku20240307OptionsType, BedrockClaude3Haiku20240307Schema, BedrockClaude3Opus20240229, BedrockClaude3Opus20240229Literal, BedrockClaude3Opus20240229Options, type BedrockClaude3Opus20240229OptionsType, BedrockClaude3Opus20240229Schema, BedrockClaude3Sonnet20240229, BedrockClaude3Sonnet20240229Literal, BedrockClaude3Sonnet20240229Options, type BedrockClaude3Sonnet20240229OptionsType, BedrockClaude3Sonnet20240229Schema, BedrockClaude3_5Haiku20241022, BedrockClaude3_5Haiku20241022Literal, BedrockClaude3_5Haiku20241022Options, type BedrockClaude3_5Haiku20241022OptionsType, BedrockClaude3_5Haiku20241022Schema, BedrockClaude3_5Sonnet20240620, BedrockClaude3_5Sonnet20240620Literal, BedrockClaude3_5Sonnet20240620Options, type BedrockClaude3_5Sonnet20240620OptionsType, BedrockClaude3_5Sonnet20240620Schema, BedrockClaude3_5Sonnet20241022, BedrockClaude3_5Sonnet20241022Literal, BedrockClaude3_5Sonnet20241022Options, type BedrockClaude3_5Sonnet20241022OptionsType, BedrockClaude3_5Sonnet20241022Schema };