@aws-sdk/client-bedrock 3.699.0 → 3.703.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-cjs/index.js +667 -33
- package/dist-es/models/models_0.js +214 -24
- package/dist-es/protocols/Aws_restJson1.js +407 -3
- package/dist-types/commands/BatchDeleteEvaluationJobCommand.d.ts +3 -1
- package/dist-types/commands/CreateEvaluationJobCommand.d.ts +156 -2
- package/dist-types/commands/GetEvaluationJobCommand.d.ts +156 -3
- package/dist-types/commands/ListEvaluationJobsCommand.d.ts +10 -2
- package/dist-types/commands/StopEvaluationJobCommand.d.ts +1 -1
- package/dist-types/models/models_0.d.ts +1171 -146
- package/dist-types/ts3.4/models/models_0.d.ts +549 -52
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";
|
|
2
|
+
import { DocumentType as __DocumentType } from "@smithy/types";
|
|
2
3
|
import { BedrockServiceException as __BaseException } from "./BedrockServiceException";
|
|
3
4
|
/**
|
|
4
5
|
* <p>The request is denied because of missing access permissions.</p>
|
|
@@ -17,28 +18,28 @@ export declare class AccessDeniedException extends __BaseException {
|
|
|
17
18
|
*/
|
|
18
19
|
export interface BatchDeleteEvaluationJobRequest {
|
|
19
20
|
/**
|
|
20
|
-
* <p>
|
|
21
|
+
* <p>A list of one or more evaluation job Amazon Resource Names (ARNs) you want to delete.</p>
|
|
21
22
|
* @public
|
|
22
23
|
*/
|
|
23
24
|
jobIdentifiers: string[] | undefined;
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
|
-
* <p>A JSON array that provides the status of the
|
|
27
|
+
* <p>A JSON array that provides the status of the evaluation jobs being deleted.</p>
|
|
27
28
|
* @public
|
|
28
29
|
*/
|
|
29
30
|
export interface BatchDeleteEvaluationJobError {
|
|
30
31
|
/**
|
|
31
|
-
* <p>The ARN of the
|
|
32
|
+
* <p>The ARN of the evaluation job being deleted.</p>
|
|
32
33
|
* @public
|
|
33
34
|
*/
|
|
34
35
|
jobIdentifier: string | undefined;
|
|
35
36
|
/**
|
|
36
|
-
* <p>A HTTP status code of the
|
|
37
|
+
* <p>A HTTP status code of the evaluation job being deleted.</p>
|
|
37
38
|
* @public
|
|
38
39
|
*/
|
|
39
40
|
code: string | undefined;
|
|
40
41
|
/**
|
|
41
|
-
* <p>A status message about the
|
|
42
|
+
* <p>A status message about the evaluation job deletion.</p>
|
|
42
43
|
* @public
|
|
43
44
|
*/
|
|
44
45
|
message?: string | undefined;
|
|
@@ -60,17 +61,17 @@ export declare const EvaluationJobStatus: {
|
|
|
60
61
|
*/
|
|
61
62
|
export type EvaluationJobStatus = (typeof EvaluationJobStatus)[keyof typeof EvaluationJobStatus];
|
|
62
63
|
/**
|
|
63
|
-
* <p>An
|
|
64
|
+
* <p>An evaluation job for deletion, and it’s current status.</p>
|
|
64
65
|
* @public
|
|
65
66
|
*/
|
|
66
67
|
export interface BatchDeleteEvaluationJobItem {
|
|
67
68
|
/**
|
|
68
|
-
* <p>The ARN of
|
|
69
|
+
* <p>The Amazon Resource Name (ARN) of the evaluation job for deletion.</p>
|
|
69
70
|
* @public
|
|
70
71
|
*/
|
|
71
72
|
jobIdentifier: string | undefined;
|
|
72
73
|
/**
|
|
73
|
-
* <p>The status of the job
|
|
74
|
+
* <p>The status of the evaluation job for deletion.</p>
|
|
74
75
|
* @public
|
|
75
76
|
*/
|
|
76
77
|
jobStatus: EvaluationJobStatus | undefined;
|
|
@@ -80,12 +81,12 @@ export interface BatchDeleteEvaluationJobItem {
|
|
|
80
81
|
*/
|
|
81
82
|
export interface BatchDeleteEvaluationJobResponse {
|
|
82
83
|
/**
|
|
83
|
-
* <p>A JSON object containing the HTTP status codes and the ARNs of
|
|
84
|
+
* <p>A JSON object containing the HTTP status codes and the ARNs of evaluation jobs that failed to be deleted.</p>
|
|
84
85
|
* @public
|
|
85
86
|
*/
|
|
86
87
|
errors: BatchDeleteEvaluationJobError[] | undefined;
|
|
87
88
|
/**
|
|
88
|
-
* <p>The list of
|
|
89
|
+
* <p>The list of evaluation jobs for deletion.</p>
|
|
89
90
|
* @public
|
|
90
91
|
*/
|
|
91
92
|
evaluationJobs: BatchDeleteEvaluationJobItem[] | undefined;
|
|
@@ -150,6 +151,18 @@ export declare class ValidationException extends __BaseException {
|
|
|
150
151
|
*/
|
|
151
152
|
constructor(opts: __ExceptionOptionType<ValidationException, __BaseException>);
|
|
152
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* @public
|
|
156
|
+
* @enum
|
|
157
|
+
*/
|
|
158
|
+
export declare const ApplicationType: {
|
|
159
|
+
readonly MODEL_EVALUATION: "ModelEvaluation";
|
|
160
|
+
readonly RAG_EVALUATION: "RagEvaluation";
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
export type ApplicationType = (typeof ApplicationType)[keyof typeof ApplicationType];
|
|
153
166
|
/**
|
|
154
167
|
* <p>The location in Amazon S3 where your prompt dataset is stored.</p>
|
|
155
168
|
* @public
|
|
@@ -212,12 +225,13 @@ export declare const EvaluationTaskType: {
|
|
|
212
225
|
*/
|
|
213
226
|
export type EvaluationTaskType = (typeof EvaluationTaskType)[keyof typeof EvaluationTaskType];
|
|
214
227
|
/**
|
|
215
|
-
* <p>Defines the
|
|
228
|
+
* <p>Defines the prompt datasets, built-in metric names and custom metric names, and the task type.</p>
|
|
216
229
|
* @public
|
|
217
230
|
*/
|
|
218
231
|
export interface EvaluationDatasetMetricConfig {
|
|
219
232
|
/**
|
|
220
|
-
* <p>The
|
|
233
|
+
* <p>The the type of task you want to evaluate for your evaluation job. This applies only
|
|
234
|
+
* to model evaluation jobs and is ignored for knowledge base evaluation jobs.</p>
|
|
221
235
|
* @public
|
|
222
236
|
*/
|
|
223
237
|
taskType: EvaluationTaskType | undefined;
|
|
@@ -227,21 +241,78 @@ export interface EvaluationDatasetMetricConfig {
|
|
|
227
241
|
*/
|
|
228
242
|
dataset: EvaluationDataset | undefined;
|
|
229
243
|
/**
|
|
230
|
-
* <p>The names of the metrics
|
|
244
|
+
* <p>The names of the metrics you want to use for your evaluation job.</p>
|
|
245
|
+
* <p>For knowledge base evaluation jobs that evaluate retrieval only, valid values are
|
|
246
|
+
* "<code>Builtin.ContextRelevance</code>", "<code>Builtin.ContextConverage</code>".</p>
|
|
247
|
+
* <p>For knowledge base evaluation jobs that evaluate retrieval with response generation,
|
|
248
|
+
* valid values are "<code>Builtin.Correctness</code>", "<code>Builtin.Completeness</code>",
|
|
249
|
+
* "<code>Builtin.Helpfulness</code>", "<code>Builtin.LogicalCoherence</code>",
|
|
250
|
+
* "<code>Builtin.Faithfulness</code>", "<code>Builtin.Harmfulness</code>",
|
|
251
|
+
* "<code>Builtin.Stereotyping</code>", "<code>Builtin.Refusal</code>".</p>
|
|
252
|
+
* <p>For automated model evaluation jobs, valid values are "<code>Builtin.Accuracy</code>", "<code>Builtin.Robustness</code>", and "<code>Builtin.Toxicity</code>". In model evaluation jobs that use a LLM as judge you can specify "<code>Builtin.Correctness</code>", "<code>Builtin.Completeness"</code>, "<code>Builtin.Faithfulness"</code>, "<code>Builtin.Helpfulness</code>", "<code>Builtin.Coherence</code>", "<code>Builtin.Relevance</code>", "<code>Builtin.FollowingInstructions</code>", "<code>Builtin.ProfessionalStyleAndTone</code>", You can also specify the following responsible AI related metrics only for model evaluation job that use a LLM as judge "<code>Builtin.Harmfulness</code>", "<code>Builtin.Stereotyping</code>", and "<code>Builtin.Refusal</code>".</p>
|
|
253
|
+
* <p>For human-based model evaluation jobs, the list of strings must match the
|
|
254
|
+
* <code>name</code> parameter specified in <code>HumanEvaluationCustomMetric</code>.</p>
|
|
231
255
|
* @public
|
|
232
256
|
*/
|
|
233
257
|
metricNames: string[] | undefined;
|
|
234
258
|
}
|
|
235
259
|
/**
|
|
236
|
-
* <p>
|
|
260
|
+
* <p>The evaluator model used in knowledge base evaluation job or in model evaluation job that use a model as judge. This model computes all evaluation related metrics.</p>
|
|
261
|
+
* @public
|
|
262
|
+
*/
|
|
263
|
+
export interface BedrockEvaluatorModel {
|
|
264
|
+
/**
|
|
265
|
+
* <p>The Amazon Resource Name (ARN) of the evaluator model used used in knowledge base evaluation job or in model evaluation job that use a model as judge.</p>
|
|
266
|
+
* @public
|
|
267
|
+
*/
|
|
268
|
+
modelIdentifier: string | undefined;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* <p>Specifies the model configuration for the evaluator model. <code>EvaluatorModelConfig</code> is required for evaluation jobs that use a knowledge base or in model evaluation job that use a model as judge. This model computes all evaluation related metrics.</p>
|
|
272
|
+
* @public
|
|
273
|
+
*/
|
|
274
|
+
export type EvaluatorModelConfig = EvaluatorModelConfig.BedrockEvaluatorModelsMember | EvaluatorModelConfig.$UnknownMember;
|
|
275
|
+
/**
|
|
276
|
+
* @public
|
|
277
|
+
*/
|
|
278
|
+
export declare namespace EvaluatorModelConfig {
|
|
279
|
+
/**
|
|
280
|
+
* <p>The evaluator model used in knowledge base evaluation job or in model evaluation job that use a model as judge. This model computes all evaluation related metrics.</p>
|
|
281
|
+
* @public
|
|
282
|
+
*/
|
|
283
|
+
interface BedrockEvaluatorModelsMember {
|
|
284
|
+
bedrockEvaluatorModels: BedrockEvaluatorModel[];
|
|
285
|
+
$unknown?: never;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* @public
|
|
289
|
+
*/
|
|
290
|
+
interface $UnknownMember {
|
|
291
|
+
bedrockEvaluatorModels?: never;
|
|
292
|
+
$unknown: [string, any];
|
|
293
|
+
}
|
|
294
|
+
interface Visitor<T> {
|
|
295
|
+
bedrockEvaluatorModels: (value: BedrockEvaluatorModel[]) => T;
|
|
296
|
+
_: (name: string, value: any) => T;
|
|
297
|
+
}
|
|
298
|
+
const visit: <T>(value: EvaluatorModelConfig, visitor: Visitor<T>) => T;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* <p>The configuration details of an automated evaluation job. The <code>EvaluationDatasetMetricConfig</code> object
|
|
302
|
+
* is used to specify the prompt datasets, task type, and metric names.</p>
|
|
237
303
|
* @public
|
|
238
304
|
*/
|
|
239
305
|
export interface AutomatedEvaluationConfig {
|
|
240
306
|
/**
|
|
241
|
-
* <p>
|
|
307
|
+
* <p>Configuration details of the prompt datasets and metrics you want to use for your evaluation job.</p>
|
|
242
308
|
* @public
|
|
243
309
|
*/
|
|
244
310
|
datasetMetricConfigs: EvaluationDatasetMetricConfig[] | undefined;
|
|
311
|
+
/**
|
|
312
|
+
* <p>Contains the evaluator model configuration details. <code>EvaluatorModelConfig</code> is required for evaluation jobs that use a knowledge base or in model evaluation job that use a model as judge. This model computes all evaluation related metrics.</p>
|
|
313
|
+
* @public
|
|
314
|
+
*/
|
|
315
|
+
evaluatorModelConfig?: EvaluatorModelConfig | undefined;
|
|
245
316
|
}
|
|
246
317
|
/**
|
|
247
318
|
* <p>In a model evaluation job that uses human workers you must
|
|
@@ -306,7 +377,7 @@ export interface HumanEvaluationConfig {
|
|
|
306
377
|
datasetMetricConfigs: EvaluationDatasetMetricConfig[] | undefined;
|
|
307
378
|
}
|
|
308
379
|
/**
|
|
309
|
-
* <p>
|
|
380
|
+
* <p>The configuration details of either an automated or human-based evaluation job.</p>
|
|
310
381
|
* @public
|
|
311
382
|
*/
|
|
312
383
|
export type EvaluationConfig = EvaluationConfig.AutomatedMember | EvaluationConfig.HumanMember | EvaluationConfig.$UnknownMember;
|
|
@@ -315,8 +386,7 @@ export type EvaluationConfig = EvaluationConfig.AutomatedMember | EvaluationConf
|
|
|
315
386
|
*/
|
|
316
387
|
export declare namespace EvaluationConfig {
|
|
317
388
|
/**
|
|
318
|
-
* <p>
|
|
319
|
-
* See <code>AutomatedEvaluationConfig</code> to view the required parameters.</p>
|
|
389
|
+
* <p>Contains the configuration details of an automated evaluation job that computes metrics.</p>
|
|
320
390
|
* @public
|
|
321
391
|
*/
|
|
322
392
|
interface AutomatedMember {
|
|
@@ -325,7 +395,7 @@ export declare namespace EvaluationConfig {
|
|
|
325
395
|
$unknown?: never;
|
|
326
396
|
}
|
|
327
397
|
/**
|
|
328
|
-
* <p>
|
|
398
|
+
* <p>Contains the configuration details of an evaluation job that uses human workers.</p>
|
|
329
399
|
* @public
|
|
330
400
|
*/
|
|
331
401
|
interface HumanMember {
|
|
@@ -349,7 +419,7 @@ export declare namespace EvaluationConfig {
|
|
|
349
419
|
const visit: <T>(value: EvaluationConfig, visitor: Visitor<T>) => T;
|
|
350
420
|
}
|
|
351
421
|
/**
|
|
352
|
-
* <p>Contains the ARN of the Amazon Bedrock model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a> specified in your
|
|
422
|
+
* <p>Contains the ARN of the Amazon Bedrock model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a> specified in your evaluation job. Each Amazon Bedrock model supports different <code>inferenceParams</code>. To learn more about supported inference parameters for Amazon Bedrock models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html">Inference parameters for foundation models</a>.</p>
|
|
353
423
|
* <p>The <code>inferenceParams</code> are specified using JSON. To successfully insert JSON as string make sure that all quotations are properly escaped. For example, <code>"temperature":"0.25"</code> key value pair would need to be formatted as <code>\"temperature\":\"0.25\"</code> to successfully accepted in the request.</p>
|
|
354
424
|
* @public
|
|
355
425
|
*/
|
|
@@ -363,7 +433,7 @@ export interface EvaluationBedrockModel {
|
|
|
363
433
|
* <p>Each Amazon Bedrock support different inference parameters that change how the model behaves during inference.</p>
|
|
364
434
|
* @public
|
|
365
435
|
*/
|
|
366
|
-
inferenceParams
|
|
436
|
+
inferenceParams?: string | undefined;
|
|
367
437
|
}
|
|
368
438
|
/**
|
|
369
439
|
* <p>Defines the models used in the model evaluation job.</p>
|
|
@@ -396,227 +466,380 @@ export declare namespace EvaluationModelConfig {
|
|
|
396
466
|
const visit: <T>(value: EvaluationModelConfig, visitor: Visitor<T>) => T;
|
|
397
467
|
}
|
|
398
468
|
/**
|
|
399
|
-
* <p>
|
|
469
|
+
* <p>The configuration details for the guardrail.</p>
|
|
400
470
|
* @public
|
|
401
471
|
*/
|
|
402
|
-
export
|
|
403
|
-
/**
|
|
404
|
-
* @public
|
|
405
|
-
*/
|
|
406
|
-
export declare namespace EvaluationInferenceConfig {
|
|
472
|
+
export interface GuardrailConfiguration {
|
|
407
473
|
/**
|
|
408
|
-
* <p>
|
|
474
|
+
* <p>The unique identifier for the guardrail.</p>
|
|
409
475
|
* @public
|
|
410
476
|
*/
|
|
411
|
-
|
|
412
|
-
models: EvaluationModelConfig[];
|
|
413
|
-
$unknown?: never;
|
|
414
|
-
}
|
|
477
|
+
guardrailId: string | undefined;
|
|
415
478
|
/**
|
|
479
|
+
* <p>The version of the guardrail.</p>
|
|
416
480
|
* @public
|
|
417
481
|
*/
|
|
418
|
-
|
|
419
|
-
models?: never;
|
|
420
|
-
$unknown: [string, any];
|
|
421
|
-
}
|
|
422
|
-
interface Visitor<T> {
|
|
423
|
-
models: (value: EvaluationModelConfig[]) => T;
|
|
424
|
-
_: (name: string, value: any) => T;
|
|
425
|
-
}
|
|
426
|
-
const visit: <T>(value: EvaluationInferenceConfig, visitor: Visitor<T>) => T;
|
|
482
|
+
guardrailVersion: string | undefined;
|
|
427
483
|
}
|
|
428
484
|
/**
|
|
429
|
-
* <p>
|
|
485
|
+
* <p>The configuration details for text generation using a language model via the
|
|
486
|
+
* <code>RetrieveAndGenerate</code> function.</p>
|
|
430
487
|
* @public
|
|
431
488
|
*/
|
|
432
|
-
export interface
|
|
489
|
+
export interface TextInferenceConfig {
|
|
433
490
|
/**
|
|
434
|
-
* <p>
|
|
491
|
+
* <p>Controls the random-ness of text generated by the language model, influencing how
|
|
492
|
+
* much the model sticks to the most predictable next words versus exploring more
|
|
493
|
+
* surprising options. A lower temperature value (e.g. 0.2 or 0.3) makes model outputs
|
|
494
|
+
* more deterministic or predictable, while a higher temperature (e.g. 0.8 or 0.9) makes
|
|
495
|
+
* the outputs more creative or unpredictable.</p>
|
|
435
496
|
* @public
|
|
436
497
|
*/
|
|
437
|
-
|
|
498
|
+
temperature?: number | undefined;
|
|
438
499
|
/**
|
|
439
|
-
* <p>
|
|
500
|
+
* <p>A probability distribution threshold which controls what the model considers for
|
|
501
|
+
* the set of possible next tokens. The model will only consider the top p% of the
|
|
502
|
+
* probability distribution when generating the next token.</p>
|
|
440
503
|
* @public
|
|
441
504
|
*/
|
|
442
|
-
|
|
505
|
+
topP?: number | undefined;
|
|
506
|
+
/**
|
|
507
|
+
* <p>The maximum number of tokens to generate in the output text. Do not use the minimum of 0
|
|
508
|
+
* or the maximum of 65536. The limit values described here are arbitrary values, for actual
|
|
509
|
+
* values consult the limits defined by your specific model.</p>
|
|
510
|
+
* @public
|
|
511
|
+
*/
|
|
512
|
+
maxTokens?: number | undefined;
|
|
513
|
+
/**
|
|
514
|
+
* <p>A list of sequences of characters that, if generated, will cause the model to stop
|
|
515
|
+
* generating further tokens. Do not use a minimum length of 1 or a maximum length of 1000.
|
|
516
|
+
* The limit values described here are arbitrary values, for actual values consult the
|
|
517
|
+
* limits defined by your specific model.</p>
|
|
518
|
+
* @public
|
|
519
|
+
*/
|
|
520
|
+
stopSequences?: string[] | undefined;
|
|
443
521
|
}
|
|
444
522
|
/**
|
|
445
|
-
* <p>
|
|
523
|
+
* <p>Contains configuration details of the inference for knowledge base retrieval and response generation.</p>
|
|
446
524
|
* @public
|
|
447
525
|
*/
|
|
448
|
-
export interface
|
|
526
|
+
export interface KbInferenceConfig {
|
|
449
527
|
/**
|
|
450
|
-
* <p>
|
|
528
|
+
* <p>Contains configuration details for text generation using a language model via the
|
|
529
|
+
* <code>RetrieveAndGenerate</code> function.</p>
|
|
451
530
|
* @public
|
|
452
531
|
*/
|
|
453
|
-
|
|
532
|
+
textInferenceConfig?: TextInferenceConfig | undefined;
|
|
454
533
|
}
|
|
455
534
|
/**
|
|
535
|
+
* <p>The template for the prompt that's sent to the model for response generation.</p>
|
|
456
536
|
* @public
|
|
457
537
|
*/
|
|
458
|
-
export interface
|
|
538
|
+
export interface PromptTemplate {
|
|
459
539
|
/**
|
|
460
|
-
* <p>The
|
|
540
|
+
* <p>The template for the prompt that's sent to the model for response generation. You can include
|
|
541
|
+
* prompt placeholders, which become replaced before the prompt is sent to the model to provide
|
|
542
|
+
* instructions and context to the model. In addition, you can include XML tags to delineate
|
|
543
|
+
* meaningful sections of the prompt template.</p>
|
|
544
|
+
* <p>For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html">Knowledge base prompt template</a> and
|
|
545
|
+
* <a href="https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags">Use XML tags with Anthropic Claude models</a>.</p>
|
|
461
546
|
* @public
|
|
462
547
|
*/
|
|
463
|
-
|
|
548
|
+
textPromptTemplate?: string | undefined;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* <p>The response generation configuration of the external source wrapper object.</p>
|
|
552
|
+
* @public
|
|
553
|
+
*/
|
|
554
|
+
export interface ExternalSourcesGenerationConfiguration {
|
|
464
555
|
/**
|
|
465
|
-
* <p>
|
|
556
|
+
* <p>Contains the template for the prompt for the external source wrapper object.</p>
|
|
466
557
|
* @public
|
|
467
558
|
*/
|
|
468
|
-
|
|
559
|
+
promptTemplate?: PromptTemplate | undefined;
|
|
469
560
|
/**
|
|
470
|
-
* <p>
|
|
471
|
-
* Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
|
|
561
|
+
* <p>Configuration details for the guardrail.</p>
|
|
472
562
|
* @public
|
|
473
563
|
*/
|
|
474
|
-
|
|
564
|
+
guardrailConfiguration?: GuardrailConfiguration | undefined;
|
|
475
565
|
/**
|
|
476
|
-
* <p>
|
|
566
|
+
* <p>Configuration details for inference when using <code>RetrieveAndGenerate</code> to generate
|
|
567
|
+
* responses while using an external source.</p>
|
|
477
568
|
* @public
|
|
478
569
|
*/
|
|
479
|
-
|
|
570
|
+
kbInferenceConfig?: KbInferenceConfig | undefined;
|
|
480
571
|
/**
|
|
481
|
-
* <p>
|
|
572
|
+
* <p>Additional model parameters and their corresponding values not included in the
|
|
573
|
+
* text inference configuration for an external source. Takes in custom model parameters
|
|
574
|
+
* specific to the language model being used.</p>
|
|
482
575
|
* @public
|
|
483
576
|
*/
|
|
484
|
-
|
|
577
|
+
additionalModelRequestFields?: Record<string, __DocumentType> | undefined;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* <p>Contains the document contained in the wrapper object, along with its attributes/fields.</p>
|
|
581
|
+
* @public
|
|
582
|
+
*/
|
|
583
|
+
export interface ByteContentDoc {
|
|
485
584
|
/**
|
|
486
|
-
* <p>
|
|
585
|
+
* <p>The file name of the document contained in the wrapper object.</p>
|
|
487
586
|
* @public
|
|
488
587
|
*/
|
|
489
|
-
|
|
588
|
+
identifier: string | undefined;
|
|
490
589
|
/**
|
|
491
|
-
* <p>
|
|
590
|
+
* <p>The MIME type of the document contained in the wrapper object.</p>
|
|
492
591
|
* @public
|
|
493
592
|
*/
|
|
494
|
-
|
|
593
|
+
contentType: string | undefined;
|
|
495
594
|
/**
|
|
496
|
-
* <p>
|
|
595
|
+
* <p>The byte value of the file to upload, encoded as a Base-64 string.</p>
|
|
497
596
|
* @public
|
|
498
597
|
*/
|
|
499
|
-
|
|
598
|
+
data: Uint8Array | undefined;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* <p>The unique wrapper object of the document from the S3 location.</p>
|
|
602
|
+
* @public
|
|
603
|
+
*/
|
|
604
|
+
export interface S3ObjectDoc {
|
|
500
605
|
/**
|
|
501
|
-
* <p>
|
|
606
|
+
* <p>The S3 URI location for the wrapper object of the document.</p>
|
|
502
607
|
* @public
|
|
503
608
|
*/
|
|
504
|
-
|
|
609
|
+
uri: string | undefined;
|
|
505
610
|
}
|
|
506
611
|
/**
|
|
507
612
|
* @public
|
|
613
|
+
* @enum
|
|
508
614
|
*/
|
|
509
|
-
export
|
|
615
|
+
export declare const ExternalSourceType: {
|
|
616
|
+
readonly BYTE_CONTENT: "BYTE_CONTENT";
|
|
617
|
+
readonly S3: "S3";
|
|
618
|
+
};
|
|
619
|
+
/**
|
|
620
|
+
* @public
|
|
621
|
+
*/
|
|
622
|
+
export type ExternalSourceType = (typeof ExternalSourceType)[keyof typeof ExternalSourceType];
|
|
623
|
+
/**
|
|
624
|
+
* <p>The unique external source of the content contained in the wrapper object.</p>
|
|
625
|
+
* @public
|
|
626
|
+
*/
|
|
627
|
+
export interface ExternalSource {
|
|
510
628
|
/**
|
|
511
|
-
* <p>The
|
|
629
|
+
* <p>The source type of the external source wrapper object.</p>
|
|
512
630
|
* @public
|
|
513
631
|
*/
|
|
514
|
-
|
|
632
|
+
sourceType: ExternalSourceType | undefined;
|
|
633
|
+
/**
|
|
634
|
+
* <p>The S3 location of the external source wrapper object.</p>
|
|
635
|
+
* @public
|
|
636
|
+
*/
|
|
637
|
+
s3Location?: S3ObjectDoc | undefined;
|
|
638
|
+
/**
|
|
639
|
+
* <p>The identifier, content type, and data of the external source wrapper object.</p>
|
|
640
|
+
* @public
|
|
641
|
+
*/
|
|
642
|
+
byteContent?: ByteContentDoc | undefined;
|
|
515
643
|
}
|
|
516
644
|
/**
|
|
517
|
-
* <p>The
|
|
645
|
+
* <p>The configuration of the external source wrapper object in the <code>retrieveAndGenerate</code>
|
|
646
|
+
* function.</p>
|
|
518
647
|
* @public
|
|
519
648
|
*/
|
|
520
|
-
export
|
|
521
|
-
readonly name: "ServiceQuotaExceededException";
|
|
522
|
-
readonly $fault: "client";
|
|
649
|
+
export interface ExternalSourcesRetrieveAndGenerateConfiguration {
|
|
523
650
|
/**
|
|
524
|
-
*
|
|
651
|
+
* <p>The Amazon Resource Name (ARN) of the foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a>
|
|
652
|
+
* used to generate responses.
|
|
653
|
+
* </p>
|
|
654
|
+
* @public
|
|
525
655
|
*/
|
|
526
|
-
|
|
656
|
+
modelArn: string | undefined;
|
|
657
|
+
/**
|
|
658
|
+
* <p>The document for the external source wrapper object in the <code>retrieveAndGenerate</code> function.</p>
|
|
659
|
+
* @public
|
|
660
|
+
*/
|
|
661
|
+
sources: ExternalSource[] | undefined;
|
|
662
|
+
/**
|
|
663
|
+
* <p>Contains configurations details for response generation based on retrieved text chunks.</p>
|
|
664
|
+
* @public
|
|
665
|
+
*/
|
|
666
|
+
generationConfiguration?: ExternalSourcesGenerationConfiguration | undefined;
|
|
527
667
|
}
|
|
528
668
|
/**
|
|
669
|
+
* <p>The configuration details for response generation based on retrieved text chunks.</p>
|
|
529
670
|
* @public
|
|
530
671
|
*/
|
|
531
|
-
export interface
|
|
672
|
+
export interface GenerationConfiguration {
|
|
532
673
|
/**
|
|
533
|
-
* <p>
|
|
674
|
+
* <p>Contains the template for the prompt that's sent to the model for response generation.</p>
|
|
534
675
|
* @public
|
|
535
676
|
*/
|
|
536
|
-
|
|
677
|
+
promptTemplate?: PromptTemplate | undefined;
|
|
678
|
+
/**
|
|
679
|
+
* <p>Contains configuration details for the guardrail.</p>
|
|
680
|
+
* @public
|
|
681
|
+
*/
|
|
682
|
+
guardrailConfiguration?: GuardrailConfiguration | undefined;
|
|
683
|
+
/**
|
|
684
|
+
* <p>Contains configuration details for inference for knowledge base retrieval and response generation.</p>
|
|
685
|
+
* @public
|
|
686
|
+
*/
|
|
687
|
+
kbInferenceConfig?: KbInferenceConfig | undefined;
|
|
688
|
+
/**
|
|
689
|
+
* <p>Additional model parameters and corresponding values not included in the
|
|
690
|
+
* <code>textInferenceConfig</code> structure for a knowledge base. This allows
|
|
691
|
+
* you to provide custom model parameters specific to the language model being
|
|
692
|
+
* used.</p>
|
|
693
|
+
* @public
|
|
694
|
+
*/
|
|
695
|
+
additionalModelRequestFields?: Record<string, __DocumentType> | undefined;
|
|
537
696
|
}
|
|
538
697
|
/**
|
|
539
698
|
* @public
|
|
540
699
|
* @enum
|
|
541
700
|
*/
|
|
542
|
-
export declare const
|
|
543
|
-
readonly
|
|
544
|
-
readonly HUMAN: "Human";
|
|
701
|
+
export declare const QueryTransformationType: {
|
|
702
|
+
readonly QUERY_DECOMPOSITION: "QUERY_DECOMPOSITION";
|
|
545
703
|
};
|
|
546
704
|
/**
|
|
547
705
|
* @public
|
|
548
706
|
*/
|
|
549
|
-
export type
|
|
707
|
+
export type QueryTransformationType = (typeof QueryTransformationType)[keyof typeof QueryTransformationType];
|
|
550
708
|
/**
|
|
709
|
+
* <p>The configuration details for transforming the prompt.</p>
|
|
551
710
|
* @public
|
|
552
711
|
*/
|
|
553
|
-
export interface
|
|
712
|
+
export interface QueryTransformationConfiguration {
|
|
554
713
|
/**
|
|
555
|
-
* <p>The
|
|
714
|
+
* <p>The type of transformation to apply to the prompt.</p>
|
|
556
715
|
* @public
|
|
557
716
|
*/
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
* <p>The Amazon Resource Name (ARN) of the model evaluation job.</p>
|
|
566
|
-
* @public
|
|
567
|
-
*/
|
|
568
|
-
jobArn: string | undefined;
|
|
569
|
-
/**
|
|
570
|
-
* <p>The description of the model evaluation job.</p>
|
|
571
|
-
* @public
|
|
572
|
-
*/
|
|
573
|
-
jobDescription?: string | undefined;
|
|
717
|
+
type: QueryTransformationType | undefined;
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* <p>The configuration details for the model to process the prompt prior to retrieval and response generation.</p>
|
|
721
|
+
* @public
|
|
722
|
+
*/
|
|
723
|
+
export interface OrchestrationConfiguration {
|
|
574
724
|
/**
|
|
575
|
-
* <p>
|
|
725
|
+
* <p>Contains configuration details for transforming the prompt.</p>
|
|
576
726
|
* @public
|
|
577
727
|
*/
|
|
578
|
-
|
|
728
|
+
queryTransformationConfiguration: QueryTransformationConfiguration | undefined;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* <p>Specifies the name of the metadata attribute/field to apply filters.
|
|
732
|
+
* You must match the name of the attribute/field in your data source/document metadata.</p>
|
|
733
|
+
* @public
|
|
734
|
+
*/
|
|
735
|
+
export interface FilterAttribute {
|
|
579
736
|
/**
|
|
580
|
-
* <p>The
|
|
737
|
+
* <p>The name of metadata attribute/field, which must match the name in your
|
|
738
|
+
* data source/document metadata.</p>
|
|
581
739
|
* @public
|
|
582
740
|
*/
|
|
583
|
-
|
|
741
|
+
key: string | undefined;
|
|
584
742
|
/**
|
|
585
|
-
* <p>The
|
|
743
|
+
* <p>The value of the metadata attribute/field.</p>
|
|
586
744
|
* @public
|
|
587
745
|
*/
|
|
588
|
-
|
|
746
|
+
value: __DocumentType | undefined;
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* @public
|
|
750
|
+
* @enum
|
|
751
|
+
*/
|
|
752
|
+
export declare const SearchType: {
|
|
753
|
+
readonly HYBRID: "HYBRID";
|
|
754
|
+
readonly SEMANTIC: "SEMANTIC";
|
|
755
|
+
};
|
|
756
|
+
/**
|
|
757
|
+
* @public
|
|
758
|
+
*/
|
|
759
|
+
export type SearchType = (typeof SearchType)[keyof typeof SearchType];
|
|
760
|
+
/**
|
|
761
|
+
* @public
|
|
762
|
+
* @enum
|
|
763
|
+
*/
|
|
764
|
+
export declare const RetrieveAndGenerateType: {
|
|
765
|
+
readonly EXTERNAL_SOURCES: "EXTERNAL_SOURCES";
|
|
766
|
+
readonly KNOWLEDGE_BASE: "KNOWLEDGE_BASE";
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* @public
|
|
770
|
+
*/
|
|
771
|
+
export type RetrieveAndGenerateType = (typeof RetrieveAndGenerateType)[keyof typeof RetrieveAndGenerateType];
|
|
772
|
+
/**
|
|
773
|
+
* <p>Definition of the key/value pair for a tag.</p>
|
|
774
|
+
* @public
|
|
775
|
+
*/
|
|
776
|
+
export interface Tag {
|
|
589
777
|
/**
|
|
590
|
-
* <p>
|
|
778
|
+
* <p>Key for the tag.</p>
|
|
591
779
|
* @public
|
|
592
780
|
*/
|
|
593
|
-
|
|
781
|
+
key: string | undefined;
|
|
594
782
|
/**
|
|
595
|
-
* <p>
|
|
783
|
+
* <p>Value for the tag.</p>
|
|
596
784
|
* @public
|
|
597
785
|
*/
|
|
598
|
-
|
|
786
|
+
value: string | undefined;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* <p>The Amazon S3 location where the results of your evaluation job are saved.</p>
|
|
790
|
+
* @public
|
|
791
|
+
*/
|
|
792
|
+
export interface EvaluationOutputDataConfig {
|
|
599
793
|
/**
|
|
600
|
-
* <p>Amazon S3
|
|
794
|
+
* <p>The Amazon S3 URI where the results of the evaluation job are saved.</p>
|
|
601
795
|
* @public
|
|
602
796
|
*/
|
|
603
|
-
|
|
797
|
+
s3Uri: string | undefined;
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* @public
|
|
801
|
+
*/
|
|
802
|
+
export interface CreateEvaluationJobResponse {
|
|
604
803
|
/**
|
|
605
|
-
* <p>
|
|
804
|
+
* <p>The Amazon Resource Name (ARN) of the evaluation job.</p>
|
|
606
805
|
* @public
|
|
607
806
|
*/
|
|
608
|
-
|
|
807
|
+
jobArn: string | undefined;
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* <p>The number of requests exceeds the service quota. Resubmit your request later.</p>
|
|
811
|
+
* @public
|
|
812
|
+
*/
|
|
813
|
+
export declare class ServiceQuotaExceededException extends __BaseException {
|
|
814
|
+
readonly name: "ServiceQuotaExceededException";
|
|
815
|
+
readonly $fault: "client";
|
|
609
816
|
/**
|
|
610
|
-
*
|
|
611
|
-
* @public
|
|
817
|
+
* @internal
|
|
612
818
|
*/
|
|
613
|
-
|
|
819
|
+
constructor(opts: __ExceptionOptionType<ServiceQuotaExceededException, __BaseException>);
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* @public
|
|
823
|
+
*/
|
|
824
|
+
export interface GetEvaluationJobRequest {
|
|
614
825
|
/**
|
|
615
|
-
* <p>
|
|
826
|
+
* <p>The Amazon Resource Name (ARN) of the evaluation job you want get information on.</p>
|
|
616
827
|
* @public
|
|
617
828
|
*/
|
|
618
|
-
|
|
829
|
+
jobIdentifier: string | undefined;
|
|
619
830
|
}
|
|
831
|
+
/**
|
|
832
|
+
* @public
|
|
833
|
+
* @enum
|
|
834
|
+
*/
|
|
835
|
+
export declare const EvaluationJobType: {
|
|
836
|
+
readonly AUTOMATED: "Automated";
|
|
837
|
+
readonly HUMAN: "Human";
|
|
838
|
+
};
|
|
839
|
+
/**
|
|
840
|
+
* @public
|
|
841
|
+
*/
|
|
842
|
+
export type EvaluationJobType = (typeof EvaluationJobType)[keyof typeof EvaluationJobType];
|
|
620
843
|
/**
|
|
621
844
|
* @public
|
|
622
845
|
* @enum
|
|
@@ -645,22 +868,27 @@ export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder];
|
|
|
645
868
|
*/
|
|
646
869
|
export interface ListEvaluationJobsRequest {
|
|
647
870
|
/**
|
|
648
|
-
* <p>A filter
|
|
871
|
+
* <p>A filter to only list evaluation jobs created after a specified time.</p>
|
|
649
872
|
* @public
|
|
650
873
|
*/
|
|
651
874
|
creationTimeAfter?: Date | undefined;
|
|
652
875
|
/**
|
|
653
|
-
* <p>A filter
|
|
876
|
+
* <p>A filter to only list evaluation jobs created before a specified time.</p>
|
|
654
877
|
* @public
|
|
655
878
|
*/
|
|
656
879
|
creationTimeBefore?: Date | undefined;
|
|
657
880
|
/**
|
|
658
|
-
* <p>
|
|
881
|
+
* <p>A filter to only list evaluation jobs that are of a certain status.</p>
|
|
659
882
|
* @public
|
|
660
883
|
*/
|
|
661
884
|
statusEquals?: EvaluationJobStatus | undefined;
|
|
662
885
|
/**
|
|
663
|
-
* <p>
|
|
886
|
+
* <p>A filter to only list evaluation jobs that are either model evaluations or knowledge base evaluations.</p>
|
|
887
|
+
* @public
|
|
888
|
+
*/
|
|
889
|
+
applicationTypeEquals?: ApplicationType | undefined;
|
|
890
|
+
/**
|
|
891
|
+
* <p>A filter to only list evaluation jobs that contain a specified string in the job name.</p>
|
|
664
892
|
* @public
|
|
665
893
|
*/
|
|
666
894
|
nameContains?: string | undefined;
|
|
@@ -675,56 +903,71 @@ export interface ListEvaluationJobsRequest {
|
|
|
675
903
|
*/
|
|
676
904
|
nextToken?: string | undefined;
|
|
677
905
|
/**
|
|
678
|
-
* <p>
|
|
906
|
+
* <p>Specifies a creation time to sort the list of evaluation jobs by when they were created.</p>
|
|
679
907
|
* @public
|
|
680
908
|
*/
|
|
681
909
|
sortBy?: SortJobsBy | undefined;
|
|
682
910
|
/**
|
|
683
|
-
* <p>
|
|
911
|
+
* <p>Specifies whether to sort the list of evaluation jobs by either ascending or descending order.</p>
|
|
684
912
|
* @public
|
|
685
913
|
*/
|
|
686
914
|
sortOrder?: SortOrder | undefined;
|
|
687
915
|
}
|
|
688
916
|
/**
|
|
689
|
-
* <p>
|
|
917
|
+
* <p>Summary information of an evaluation job.</p>
|
|
690
918
|
* @public
|
|
691
919
|
*/
|
|
692
920
|
export interface EvaluationSummary {
|
|
693
921
|
/**
|
|
694
|
-
* <p>The Amazon Resource Name (ARN) of the
|
|
922
|
+
* <p>The Amazon Resource Name (ARN) of the evaluation job.</p>
|
|
695
923
|
* @public
|
|
696
924
|
*/
|
|
697
925
|
jobArn: string | undefined;
|
|
698
926
|
/**
|
|
699
|
-
* <p>The name
|
|
927
|
+
* <p>The name for the evaluation job.</p>
|
|
700
928
|
* @public
|
|
701
929
|
*/
|
|
702
930
|
jobName: string | undefined;
|
|
703
931
|
/**
|
|
704
|
-
* <p>The current status of the
|
|
932
|
+
* <p>The current status of the evaluation job.</p>
|
|
705
933
|
* @public
|
|
706
934
|
*/
|
|
707
935
|
status: EvaluationJobStatus | undefined;
|
|
708
936
|
/**
|
|
709
|
-
* <p>
|
|
937
|
+
* <p>The time the evaluation job was created.</p>
|
|
710
938
|
* @public
|
|
711
939
|
*/
|
|
712
940
|
creationTime: Date | undefined;
|
|
713
941
|
/**
|
|
714
|
-
* <p>
|
|
942
|
+
* <p>Specifies whether the evaluation job is automated or human-based.</p>
|
|
715
943
|
* @public
|
|
716
944
|
*/
|
|
717
945
|
jobType: EvaluationJobType | undefined;
|
|
718
946
|
/**
|
|
719
|
-
* <p>
|
|
947
|
+
* <p>The type of task for model evaluation.</p>
|
|
720
948
|
* @public
|
|
721
949
|
*/
|
|
722
950
|
evaluationTaskTypes: EvaluationTaskType[] | undefined;
|
|
723
951
|
/**
|
|
724
|
-
* <p>The Amazon Resource Names (ARNs) of the model(s) used
|
|
952
|
+
* <p>The Amazon Resource Names (ARNs) of the model(s) used for the evaluation job.</p>
|
|
953
|
+
* @public
|
|
954
|
+
*/
|
|
955
|
+
modelIdentifiers?: string[] | undefined;
|
|
956
|
+
/**
|
|
957
|
+
* <p>The Amazon Resource Names (ARNs) of the knowledge base resources used for a knowledge base evaluation job.</p>
|
|
725
958
|
* @public
|
|
726
959
|
*/
|
|
727
|
-
|
|
960
|
+
ragIdentifiers?: string[] | undefined;
|
|
961
|
+
/**
|
|
962
|
+
* <p>The Amazon Resource Names (ARNs) of the models used to compute the metrics for a knowledge base evaluation job.</p>
|
|
963
|
+
* @public
|
|
964
|
+
*/
|
|
965
|
+
evaluatorModelIdentifiers?: string[] | undefined;
|
|
966
|
+
/**
|
|
967
|
+
* <p>Specifies whether the evaluation job is for evaluating a model or evaluating a knowledge base (retrieval and response generation).</p>
|
|
968
|
+
* @public
|
|
969
|
+
*/
|
|
970
|
+
applicationType?: ApplicationType | undefined;
|
|
728
971
|
}
|
|
729
972
|
/**
|
|
730
973
|
* @public
|
|
@@ -736,7 +979,7 @@ export interface ListEvaluationJobsResponse {
|
|
|
736
979
|
*/
|
|
737
980
|
nextToken?: string | undefined;
|
|
738
981
|
/**
|
|
739
|
-
* <p>A
|
|
982
|
+
* <p>A list of summaries of the evaluation jobs.</p>
|
|
740
983
|
* @public
|
|
741
984
|
*/
|
|
742
985
|
jobSummaries?: EvaluationSummary[] | undefined;
|
|
@@ -746,7 +989,7 @@ export interface ListEvaluationJobsResponse {
|
|
|
746
989
|
*/
|
|
747
990
|
export interface StopEvaluationJobRequest {
|
|
748
991
|
/**
|
|
749
|
-
* <p>The ARN of the
|
|
992
|
+
* <p>The Amazon Resource Name (ARN) of the evaluation job you want to stop.</p>
|
|
750
993
|
* @public
|
|
751
994
|
*/
|
|
752
995
|
jobIdentifier: string | undefined;
|
|
@@ -5064,7 +5307,733 @@ export interface StopModelCustomizationJobRequest {
|
|
|
5064
5307
|
export interface StopModelCustomizationJobResponse {
|
|
5065
5308
|
}
|
|
5066
5309
|
/**
|
|
5067
|
-
*
|
|
5310
|
+
* <p>Specifies the filters to use on the metadata attributes/fields in the knowledge base data
|
|
5311
|
+
* sources before returning results.</p>
|
|
5312
|
+
* @public
|
|
5313
|
+
*/
|
|
5314
|
+
export type RetrievalFilter = RetrievalFilter.AndAllMember | RetrievalFilter.EqualsMember | RetrievalFilter.GreaterThanMember | RetrievalFilter.GreaterThanOrEqualsMember | RetrievalFilter.InMember | RetrievalFilter.LessThanMember | RetrievalFilter.LessThanOrEqualsMember | RetrievalFilter.ListContainsMember | RetrievalFilter.NotEqualsMember | RetrievalFilter.NotInMember | RetrievalFilter.OrAllMember | RetrievalFilter.StartsWithMember | RetrievalFilter.StringContainsMember | RetrievalFilter.$UnknownMember;
|
|
5315
|
+
/**
|
|
5316
|
+
* @public
|
|
5317
|
+
*/
|
|
5318
|
+
export declare namespace RetrievalFilter {
|
|
5319
|
+
/**
|
|
5320
|
+
* <p>Knowledge base data sources are returned if they contain a metadata attribute whose
|
|
5321
|
+
* name matches the key and whose value matches the value in this object.</p>
|
|
5322
|
+
* <p>The following example would return data sources with an animal attribute whose value is 'cat':
|
|
5323
|
+
* <code>"equals": \{ "key": "animal", "value": "cat" \}</code>
|
|
5324
|
+
* </p>
|
|
5325
|
+
* @public
|
|
5326
|
+
*/
|
|
5327
|
+
interface EqualsMember {
|
|
5328
|
+
equals: FilterAttribute;
|
|
5329
|
+
notEquals?: never;
|
|
5330
|
+
greaterThan?: never;
|
|
5331
|
+
greaterThanOrEquals?: never;
|
|
5332
|
+
lessThan?: never;
|
|
5333
|
+
lessThanOrEquals?: never;
|
|
5334
|
+
in?: never;
|
|
5335
|
+
notIn?: never;
|
|
5336
|
+
startsWith?: never;
|
|
5337
|
+
listContains?: never;
|
|
5338
|
+
stringContains?: never;
|
|
5339
|
+
andAll?: never;
|
|
5340
|
+
orAll?: never;
|
|
5341
|
+
$unknown?: never;
|
|
5342
|
+
}
|
|
5343
|
+
/**
|
|
5344
|
+
* <p>Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value
|
|
5345
|
+
* doesn't match the value in this object are returned.</p>
|
|
5346
|
+
* <p>The following example would return data sources that don't contain an animal attribute whose value is 'cat':
|
|
5347
|
+
* <code>"notEquals": \{ "key": "animal", "value": "cat" \}</code>
|
|
5348
|
+
* </p>
|
|
5349
|
+
* @public
|
|
5350
|
+
*/
|
|
5351
|
+
interface NotEqualsMember {
|
|
5352
|
+
equals?: never;
|
|
5353
|
+
notEquals: FilterAttribute;
|
|
5354
|
+
greaterThan?: never;
|
|
5355
|
+
greaterThanOrEquals?: never;
|
|
5356
|
+
lessThan?: never;
|
|
5357
|
+
lessThanOrEquals?: never;
|
|
5358
|
+
in?: never;
|
|
5359
|
+
notIn?: never;
|
|
5360
|
+
startsWith?: never;
|
|
5361
|
+
listContains?: never;
|
|
5362
|
+
stringContains?: never;
|
|
5363
|
+
andAll?: never;
|
|
5364
|
+
orAll?: never;
|
|
5365
|
+
$unknown?: never;
|
|
5366
|
+
}
|
|
5367
|
+
/**
|
|
5368
|
+
* <p>Knowledge base data sources are returned if they contain a metadata attribute whose name
|
|
5369
|
+
* matches the key and whose value is greater than the value in this object.</p>
|
|
5370
|
+
* <p>The following example would return data sources with an year attribute whose value is
|
|
5371
|
+
* greater than '1989': <code>"greaterThan": \{ "key": "year", "value": 1989 \}</code>
|
|
5372
|
+
* </p>
|
|
5373
|
+
* @public
|
|
5374
|
+
*/
|
|
5375
|
+
interface GreaterThanMember {
|
|
5376
|
+
equals?: never;
|
|
5377
|
+
notEquals?: never;
|
|
5378
|
+
greaterThan: FilterAttribute;
|
|
5379
|
+
greaterThanOrEquals?: never;
|
|
5380
|
+
lessThan?: never;
|
|
5381
|
+
lessThanOrEquals?: never;
|
|
5382
|
+
in?: never;
|
|
5383
|
+
notIn?: never;
|
|
5384
|
+
startsWith?: never;
|
|
5385
|
+
listContains?: never;
|
|
5386
|
+
stringContains?: never;
|
|
5387
|
+
andAll?: never;
|
|
5388
|
+
orAll?: never;
|
|
5389
|
+
$unknown?: never;
|
|
5390
|
+
}
|
|
5391
|
+
/**
|
|
5392
|
+
* <p>Knowledge base data sources are returned if they contain a metadata attribute whose name
|
|
5393
|
+
* matches the key and whose value is greater than or equal to the value in this object.</p>
|
|
5394
|
+
* <p>The following example would return data sources with an year attribute whose value is
|
|
5395
|
+
* greater than or equal to '1989': <code>"greaterThanOrEquals": \{ "key": "year", "value": 1989 \}</code>
|
|
5396
|
+
* </p>
|
|
5397
|
+
* @public
|
|
5398
|
+
*/
|
|
5399
|
+
interface GreaterThanOrEqualsMember {
|
|
5400
|
+
equals?: never;
|
|
5401
|
+
notEquals?: never;
|
|
5402
|
+
greaterThan?: never;
|
|
5403
|
+
greaterThanOrEquals: FilterAttribute;
|
|
5404
|
+
lessThan?: never;
|
|
5405
|
+
lessThanOrEquals?: never;
|
|
5406
|
+
in?: never;
|
|
5407
|
+
notIn?: never;
|
|
5408
|
+
startsWith?: never;
|
|
5409
|
+
listContains?: never;
|
|
5410
|
+
stringContains?: never;
|
|
5411
|
+
andAll?: never;
|
|
5412
|
+
orAll?: never;
|
|
5413
|
+
$unknown?: never;
|
|
5414
|
+
}
|
|
5415
|
+
/**
|
|
5416
|
+
* <p>Knowledge base data sources are returned if they contain a metadata attribute whose name matches the
|
|
5417
|
+
* key and whose value is less than the value in this object.</p>
|
|
5418
|
+
* <p>The following example would return data sources with an year attribute whose value is less than to '1989':
|
|
5419
|
+
* <code>"lessThan": \{ "key": "year", "value": 1989 \}</code>
|
|
5420
|
+
* </p>
|
|
5421
|
+
* @public
|
|
5422
|
+
*/
|
|
5423
|
+
interface LessThanMember {
|
|
5424
|
+
equals?: never;
|
|
5425
|
+
notEquals?: never;
|
|
5426
|
+
greaterThan?: never;
|
|
5427
|
+
greaterThanOrEquals?: never;
|
|
5428
|
+
lessThan: FilterAttribute;
|
|
5429
|
+
lessThanOrEquals?: never;
|
|
5430
|
+
in?: never;
|
|
5431
|
+
notIn?: never;
|
|
5432
|
+
startsWith?: never;
|
|
5433
|
+
listContains?: never;
|
|
5434
|
+
stringContains?: never;
|
|
5435
|
+
andAll?: never;
|
|
5436
|
+
orAll?: never;
|
|
5437
|
+
$unknown?: never;
|
|
5438
|
+
}
|
|
5439
|
+
/**
|
|
5440
|
+
* <p>Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key
|
|
5441
|
+
* and whose value is less than or equal to the value in this object.</p>
|
|
5442
|
+
* <p>The following example would return data sources with an year attribute whose value is less than or equal
|
|
5443
|
+
* to '1989': <code>"lessThanOrEquals": \{ "key": "year", "value": 1989 \}</code>
|
|
5444
|
+
* </p>
|
|
5445
|
+
* @public
|
|
5446
|
+
*/
|
|
5447
|
+
interface LessThanOrEqualsMember {
|
|
5448
|
+
equals?: never;
|
|
5449
|
+
notEquals?: never;
|
|
5450
|
+
greaterThan?: never;
|
|
5451
|
+
greaterThanOrEquals?: never;
|
|
5452
|
+
lessThan?: never;
|
|
5453
|
+
lessThanOrEquals: FilterAttribute;
|
|
5454
|
+
in?: never;
|
|
5455
|
+
notIn?: never;
|
|
5456
|
+
startsWith?: never;
|
|
5457
|
+
listContains?: never;
|
|
5458
|
+
stringContains?: never;
|
|
5459
|
+
andAll?: never;
|
|
5460
|
+
orAll?: never;
|
|
5461
|
+
$unknown?: never;
|
|
5462
|
+
}
|
|
5463
|
+
/**
|
|
5464
|
+
* <p>Knowledge base data sources are returned if they contain a metadata attribute whose
|
|
5465
|
+
* name matches the key and whose value is in the list specified in the value in this object.</p>
|
|
5466
|
+
* <p>The following example would return data sources with an animal attribute that is either 'cat' or 'dog':
|
|
5467
|
+
* <code>"in": \{ "key": "animal", "value": ["cat", "dog"] \}</code>
|
|
5468
|
+
* </p>
|
|
5469
|
+
* @public
|
|
5470
|
+
*/
|
|
5471
|
+
interface InMember {
|
|
5472
|
+
equals?: never;
|
|
5473
|
+
notEquals?: never;
|
|
5474
|
+
greaterThan?: never;
|
|
5475
|
+
greaterThanOrEquals?: never;
|
|
5476
|
+
lessThan?: never;
|
|
5477
|
+
lessThanOrEquals?: never;
|
|
5478
|
+
in: FilterAttribute;
|
|
5479
|
+
notIn?: never;
|
|
5480
|
+
startsWith?: never;
|
|
5481
|
+
listContains?: never;
|
|
5482
|
+
stringContains?: never;
|
|
5483
|
+
andAll?: never;
|
|
5484
|
+
orAll?: never;
|
|
5485
|
+
$unknown?: never;
|
|
5486
|
+
}
|
|
5487
|
+
/**
|
|
5488
|
+
* <p>Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key
|
|
5489
|
+
* and whose value isn't in the list specified in the value in this object.</p>
|
|
5490
|
+
* <p>The following example would return data sources whose animal attribute is neither 'cat' nor 'dog':
|
|
5491
|
+
* <code>"notIn": \{ "key": "animal", "value": ["cat", "dog"] \}</code>
|
|
5492
|
+
* </p>
|
|
5493
|
+
* @public
|
|
5494
|
+
*/
|
|
5495
|
+
interface NotInMember {
|
|
5496
|
+
equals?: never;
|
|
5497
|
+
notEquals?: never;
|
|
5498
|
+
greaterThan?: never;
|
|
5499
|
+
greaterThanOrEquals?: never;
|
|
5500
|
+
lessThan?: never;
|
|
5501
|
+
lessThanOrEquals?: never;
|
|
5502
|
+
in?: never;
|
|
5503
|
+
notIn: FilterAttribute;
|
|
5504
|
+
startsWith?: never;
|
|
5505
|
+
listContains?: never;
|
|
5506
|
+
stringContains?: never;
|
|
5507
|
+
andAll?: never;
|
|
5508
|
+
orAll?: never;
|
|
5509
|
+
$unknown?: never;
|
|
5510
|
+
}
|
|
5511
|
+
/**
|
|
5512
|
+
* <p>Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key
|
|
5513
|
+
* and whose value starts with the value in this object. This filter is currently only supported for
|
|
5514
|
+
* Amazon OpenSearch Serverless vector stores.</p>
|
|
5515
|
+
* <p>The following example would return data sources with an animal attribute starts with 'ca' (for example, 'cat' or 'camel').
|
|
5516
|
+
* <code>"startsWith": \{ "key": "animal", "value": "ca" \}</code>
|
|
5517
|
+
* </p>
|
|
5518
|
+
* @public
|
|
5519
|
+
*/
|
|
5520
|
+
interface StartsWithMember {
|
|
5521
|
+
equals?: never;
|
|
5522
|
+
notEquals?: never;
|
|
5523
|
+
greaterThan?: never;
|
|
5524
|
+
greaterThanOrEquals?: never;
|
|
5525
|
+
lessThan?: never;
|
|
5526
|
+
lessThanOrEquals?: never;
|
|
5527
|
+
in?: never;
|
|
5528
|
+
notIn?: never;
|
|
5529
|
+
startsWith: FilterAttribute;
|
|
5530
|
+
listContains?: never;
|
|
5531
|
+
stringContains?: never;
|
|
5532
|
+
andAll?: never;
|
|
5533
|
+
orAll?: never;
|
|
5534
|
+
$unknown?: never;
|
|
5535
|
+
}
|
|
5536
|
+
/**
|
|
5537
|
+
* <p>Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key
|
|
5538
|
+
* and whose value is a list that contains the value as one of its members.</p>
|
|
5539
|
+
* <p>The following example would return data sources with an animals attribute that is a list containing a cat
|
|
5540
|
+
* member (for example, <code>["dog", "cat"]</code>): <code>"listContains": \{ "key": "animals", "value": "cat" \}</code>
|
|
5541
|
+
* </p>
|
|
5542
|
+
* @public
|
|
5543
|
+
*/
|
|
5544
|
+
interface ListContainsMember {
|
|
5545
|
+
equals?: never;
|
|
5546
|
+
notEquals?: never;
|
|
5547
|
+
greaterThan?: never;
|
|
5548
|
+
greaterThanOrEquals?: never;
|
|
5549
|
+
lessThan?: never;
|
|
5550
|
+
lessThanOrEquals?: never;
|
|
5551
|
+
in?: never;
|
|
5552
|
+
notIn?: never;
|
|
5553
|
+
startsWith?: never;
|
|
5554
|
+
listContains: FilterAttribute;
|
|
5555
|
+
stringContains?: never;
|
|
5556
|
+
andAll?: never;
|
|
5557
|
+
orAll?: never;
|
|
5558
|
+
$unknown?: never;
|
|
5559
|
+
}
|
|
5560
|
+
/**
|
|
5561
|
+
* <p>Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key
|
|
5562
|
+
* and whose value is one of the following:</p>
|
|
5563
|
+
* <p>A string that contains the value as a substring. The following example would return data sources with an
|
|
5564
|
+
* animal attribute that contains the substring at (for example, 'cat'):
|
|
5565
|
+
* <code>"stringContains": \{ "key": "animal", "value": "at" \}</code>
|
|
5566
|
+
* </p>
|
|
5567
|
+
* <p>A list with a member that contains the value as a substring. The following example would return data
|
|
5568
|
+
* sources with an animals attribute that is a list containing a member that contains the substring at
|
|
5569
|
+
* (for example, <code>["dog", "cat"]</code>): <code>"stringContains": \{ "key": "animals", "value": "at" \}</code>
|
|
5570
|
+
* </p>
|
|
5571
|
+
* @public
|
|
5572
|
+
*/
|
|
5573
|
+
interface StringContainsMember {
|
|
5574
|
+
equals?: never;
|
|
5575
|
+
notEquals?: never;
|
|
5576
|
+
greaterThan?: never;
|
|
5577
|
+
greaterThanOrEquals?: never;
|
|
5578
|
+
lessThan?: never;
|
|
5579
|
+
lessThanOrEquals?: never;
|
|
5580
|
+
in?: never;
|
|
5581
|
+
notIn?: never;
|
|
5582
|
+
startsWith?: never;
|
|
5583
|
+
listContains?: never;
|
|
5584
|
+
stringContains: FilterAttribute;
|
|
5585
|
+
andAll?: never;
|
|
5586
|
+
orAll?: never;
|
|
5587
|
+
$unknown?: never;
|
|
5588
|
+
}
|
|
5589
|
+
/**
|
|
5590
|
+
* <p>Knowledge base data sources are returned if their metadata attributes fulfill all the
|
|
5591
|
+
* filter conditions inside this list.</p>
|
|
5592
|
+
* @public
|
|
5593
|
+
*/
|
|
5594
|
+
interface AndAllMember {
|
|
5595
|
+
equals?: never;
|
|
5596
|
+
notEquals?: never;
|
|
5597
|
+
greaterThan?: never;
|
|
5598
|
+
greaterThanOrEquals?: never;
|
|
5599
|
+
lessThan?: never;
|
|
5600
|
+
lessThanOrEquals?: never;
|
|
5601
|
+
in?: never;
|
|
5602
|
+
notIn?: never;
|
|
5603
|
+
startsWith?: never;
|
|
5604
|
+
listContains?: never;
|
|
5605
|
+
stringContains?: never;
|
|
5606
|
+
andAll: RetrievalFilter[];
|
|
5607
|
+
orAll?: never;
|
|
5608
|
+
$unknown?: never;
|
|
5609
|
+
}
|
|
5610
|
+
/**
|
|
5611
|
+
* <p>Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter
|
|
5612
|
+
* conditions inside this list.</p>
|
|
5613
|
+
* @public
|
|
5614
|
+
*/
|
|
5615
|
+
interface OrAllMember {
|
|
5616
|
+
equals?: never;
|
|
5617
|
+
notEquals?: never;
|
|
5618
|
+
greaterThan?: never;
|
|
5619
|
+
greaterThanOrEquals?: never;
|
|
5620
|
+
lessThan?: never;
|
|
5621
|
+
lessThanOrEquals?: never;
|
|
5622
|
+
in?: never;
|
|
5623
|
+
notIn?: never;
|
|
5624
|
+
startsWith?: never;
|
|
5625
|
+
listContains?: never;
|
|
5626
|
+
stringContains?: never;
|
|
5627
|
+
andAll?: never;
|
|
5628
|
+
orAll: RetrievalFilter[];
|
|
5629
|
+
$unknown?: never;
|
|
5630
|
+
}
|
|
5631
|
+
/**
|
|
5632
|
+
* @public
|
|
5633
|
+
*/
|
|
5634
|
+
interface $UnknownMember {
|
|
5635
|
+
equals?: never;
|
|
5636
|
+
notEquals?: never;
|
|
5637
|
+
greaterThan?: never;
|
|
5638
|
+
greaterThanOrEquals?: never;
|
|
5639
|
+
lessThan?: never;
|
|
5640
|
+
lessThanOrEquals?: never;
|
|
5641
|
+
in?: never;
|
|
5642
|
+
notIn?: never;
|
|
5643
|
+
startsWith?: never;
|
|
5644
|
+
listContains?: never;
|
|
5645
|
+
stringContains?: never;
|
|
5646
|
+
andAll?: never;
|
|
5647
|
+
orAll?: never;
|
|
5648
|
+
$unknown: [string, any];
|
|
5649
|
+
}
|
|
5650
|
+
interface Visitor<T> {
|
|
5651
|
+
equals: (value: FilterAttribute) => T;
|
|
5652
|
+
notEquals: (value: FilterAttribute) => T;
|
|
5653
|
+
greaterThan: (value: FilterAttribute) => T;
|
|
5654
|
+
greaterThanOrEquals: (value: FilterAttribute) => T;
|
|
5655
|
+
lessThan: (value: FilterAttribute) => T;
|
|
5656
|
+
lessThanOrEquals: (value: FilterAttribute) => T;
|
|
5657
|
+
in: (value: FilterAttribute) => T;
|
|
5658
|
+
notIn: (value: FilterAttribute) => T;
|
|
5659
|
+
startsWith: (value: FilterAttribute) => T;
|
|
5660
|
+
listContains: (value: FilterAttribute) => T;
|
|
5661
|
+
stringContains: (value: FilterAttribute) => T;
|
|
5662
|
+
andAll: (value: RetrievalFilter[]) => T;
|
|
5663
|
+
orAll: (value: RetrievalFilter[]) => T;
|
|
5664
|
+
_: (name: string, value: any) => T;
|
|
5665
|
+
}
|
|
5666
|
+
const visit: <T>(value: RetrievalFilter, visitor: Visitor<T>) => T;
|
|
5667
|
+
}
|
|
5668
|
+
/**
|
|
5669
|
+
* <p>The configuration details for returning the results from the knowledge base vector search.</p>
|
|
5670
|
+
* @public
|
|
5671
|
+
*/
|
|
5672
|
+
export interface KnowledgeBaseVectorSearchConfiguration {
|
|
5673
|
+
/**
|
|
5674
|
+
* <p>The number of text chunks to retrieve; the number of results to return.</p>
|
|
5675
|
+
* @public
|
|
5676
|
+
*/
|
|
5677
|
+
numberOfResults?: number | undefined;
|
|
5678
|
+
/**
|
|
5679
|
+
* <p>By default, Amazon Bedrock decides a search strategy for you. If you're using an
|
|
5680
|
+
* Amazon OpenSearch Serverless vector store that contains a filterable text field, you
|
|
5681
|
+
* can specify whether to query the knowledge base with a <code>HYBRID</code> search
|
|
5682
|
+
* using both vector embeddings and raw text, or <code>SEMANTIC</code> search using
|
|
5683
|
+
* only vector embeddings. For other vector store configurations, only <code>SEMANTIC</code>
|
|
5684
|
+
* search is available.</p>
|
|
5685
|
+
* @public
|
|
5686
|
+
*/
|
|
5687
|
+
overrideSearchType?: SearchType | undefined;
|
|
5688
|
+
/**
|
|
5689
|
+
* <p>Specifies the filters to use on the metadata fields in the knowledge base data sources before returning results.</p>
|
|
5690
|
+
* @public
|
|
5691
|
+
*/
|
|
5692
|
+
filter?: RetrievalFilter | undefined;
|
|
5693
|
+
}
|
|
5694
|
+
/**
|
|
5695
|
+
* <p>Contains configuration details for retrieving information from a knowledge base.</p>
|
|
5696
|
+
* @public
|
|
5697
|
+
*/
|
|
5698
|
+
export interface KnowledgeBaseRetrievalConfiguration {
|
|
5699
|
+
/**
|
|
5700
|
+
* <p>Contains configuration details for returning the results from the vector search.</p>
|
|
5701
|
+
* @public
|
|
5702
|
+
*/
|
|
5703
|
+
vectorSearchConfiguration: KnowledgeBaseVectorSearchConfiguration | undefined;
|
|
5704
|
+
}
|
|
5705
|
+
/**
|
|
5706
|
+
* <p>Contains configuration details for retrieving information from a knowledge base and generating responses.</p>
|
|
5707
|
+
* @public
|
|
5708
|
+
*/
|
|
5709
|
+
export interface KnowledgeBaseRetrieveAndGenerateConfiguration {
|
|
5710
|
+
/**
|
|
5711
|
+
* <p>The unique identifier of the knowledge base.</p>
|
|
5712
|
+
* @public
|
|
5713
|
+
*/
|
|
5714
|
+
knowledgeBaseId: string | undefined;
|
|
5715
|
+
/**
|
|
5716
|
+
* <p>The Amazon Resource Name (ARN) of the foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a>
|
|
5717
|
+
* used to generate responses.</p>
|
|
5718
|
+
* @public
|
|
5719
|
+
*/
|
|
5720
|
+
modelArn: string | undefined;
|
|
5721
|
+
/**
|
|
5722
|
+
* <p>Contains configuration details for retrieving text chunks.</p>
|
|
5723
|
+
* @public
|
|
5724
|
+
*/
|
|
5725
|
+
retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration | undefined;
|
|
5726
|
+
/**
|
|
5727
|
+
* <p>Contains configurations details for response generation based on retrieved text chunks.</p>
|
|
5728
|
+
* @public
|
|
5729
|
+
*/
|
|
5730
|
+
generationConfiguration?: GenerationConfiguration | undefined;
|
|
5731
|
+
/**
|
|
5732
|
+
* <p>Contains configuration details for the model to process the prompt prior to retrieval and response generation.</p>
|
|
5733
|
+
* @public
|
|
5734
|
+
*/
|
|
5735
|
+
orchestrationConfiguration?: OrchestrationConfiguration | undefined;
|
|
5736
|
+
}
|
|
5737
|
+
/**
|
|
5738
|
+
* <p>The configuration details for retrieving information from a knowledge base.</p>
|
|
5739
|
+
* @public
|
|
5740
|
+
*/
|
|
5741
|
+
export interface RetrieveConfig {
|
|
5742
|
+
/**
|
|
5743
|
+
* <p>The unique identifier of the knowledge base.</p>
|
|
5744
|
+
* @public
|
|
5745
|
+
*/
|
|
5746
|
+
knowledgeBaseId: string | undefined;
|
|
5747
|
+
/**
|
|
5748
|
+
* <p>Contains configuration details for knowledge base retrieval.</p>
|
|
5749
|
+
* @public
|
|
5750
|
+
*/
|
|
5751
|
+
knowledgeBaseRetrievalConfiguration: KnowledgeBaseRetrievalConfiguration | undefined;
|
|
5752
|
+
}
|
|
5753
|
+
/**
|
|
5754
|
+
* <p>Contains configuration details for a knowledge base retrieval and response generation.</p>
|
|
5755
|
+
* @public
|
|
5756
|
+
*/
|
|
5757
|
+
export interface RetrieveAndGenerateConfiguration {
|
|
5758
|
+
/**
|
|
5759
|
+
* <p>The type of resource that contains your data for retrieving information and generating responses.</p>
|
|
5760
|
+
* <p>If you choose to use <code>EXTERNAL_SOURCES</code>, then currently only Claude 3 Sonnet models for knowledge bases are supported.</p>
|
|
5761
|
+
* @public
|
|
5762
|
+
*/
|
|
5763
|
+
type: RetrieveAndGenerateType | undefined;
|
|
5764
|
+
/**
|
|
5765
|
+
* <p>Contains configuration details for the knowledge base retrieval and response generation.</p>
|
|
5766
|
+
* @public
|
|
5767
|
+
*/
|
|
5768
|
+
knowledgeBaseConfiguration?: KnowledgeBaseRetrieveAndGenerateConfiguration | undefined;
|
|
5769
|
+
/**
|
|
5770
|
+
* <p>The configuration for the external source wrapper object in the
|
|
5771
|
+
* <code>retrieveAndGenerate</code> function.</p>
|
|
5772
|
+
* @public
|
|
5773
|
+
*/
|
|
5774
|
+
externalSourcesConfiguration?: ExternalSourcesRetrieveAndGenerateConfiguration | undefined;
|
|
5775
|
+
}
|
|
5776
|
+
/**
|
|
5777
|
+
* <p>The configuration details for retrieving information from a knowledge base and generating responses.</p>
|
|
5778
|
+
* @public
|
|
5779
|
+
*/
|
|
5780
|
+
export type KnowledgeBaseConfig = KnowledgeBaseConfig.RetrieveAndGenerateConfigMember | KnowledgeBaseConfig.RetrieveConfigMember | KnowledgeBaseConfig.$UnknownMember;
|
|
5781
|
+
/**
|
|
5782
|
+
* @public
|
|
5783
|
+
*/
|
|
5784
|
+
export declare namespace KnowledgeBaseConfig {
|
|
5785
|
+
/**
|
|
5786
|
+
* <p>Contains configuration details for retrieving information from a knowledge base.</p>
|
|
5787
|
+
* @public
|
|
5788
|
+
*/
|
|
5789
|
+
interface RetrieveConfigMember {
|
|
5790
|
+
retrieveConfig: RetrieveConfig;
|
|
5791
|
+
retrieveAndGenerateConfig?: never;
|
|
5792
|
+
$unknown?: never;
|
|
5793
|
+
}
|
|
5794
|
+
/**
|
|
5795
|
+
* <p>Contains configuration details for retrieving information from a knowledge base and generating responses.</p>
|
|
5796
|
+
* @public
|
|
5797
|
+
*/
|
|
5798
|
+
interface RetrieveAndGenerateConfigMember {
|
|
5799
|
+
retrieveConfig?: never;
|
|
5800
|
+
retrieveAndGenerateConfig: RetrieveAndGenerateConfiguration;
|
|
5801
|
+
$unknown?: never;
|
|
5802
|
+
}
|
|
5803
|
+
/**
|
|
5804
|
+
* @public
|
|
5805
|
+
*/
|
|
5806
|
+
interface $UnknownMember {
|
|
5807
|
+
retrieveConfig?: never;
|
|
5808
|
+
retrieveAndGenerateConfig?: never;
|
|
5809
|
+
$unknown: [string, any];
|
|
5810
|
+
}
|
|
5811
|
+
interface Visitor<T> {
|
|
5812
|
+
retrieveConfig: (value: RetrieveConfig) => T;
|
|
5813
|
+
retrieveAndGenerateConfig: (value: RetrieveAndGenerateConfiguration) => T;
|
|
5814
|
+
_: (name: string, value: any) => T;
|
|
5815
|
+
}
|
|
5816
|
+
const visit: <T>(value: KnowledgeBaseConfig, visitor: Visitor<T>) => T;
|
|
5817
|
+
}
|
|
5818
|
+
/**
|
|
5819
|
+
* <p>Contains configuration details for retrieval of information and response generation.</p>
|
|
5820
|
+
* @public
|
|
5821
|
+
*/
|
|
5822
|
+
export type RAGConfig = RAGConfig.KnowledgeBaseConfigMember | RAGConfig.$UnknownMember;
|
|
5823
|
+
/**
|
|
5824
|
+
* @public
|
|
5825
|
+
*/
|
|
5826
|
+
export declare namespace RAGConfig {
|
|
5827
|
+
/**
|
|
5828
|
+
* <p>Contains configuration details for knowledge base retrieval and response generation.</p>
|
|
5829
|
+
* @public
|
|
5830
|
+
*/
|
|
5831
|
+
interface KnowledgeBaseConfigMember {
|
|
5832
|
+
knowledgeBaseConfig: KnowledgeBaseConfig;
|
|
5833
|
+
$unknown?: never;
|
|
5834
|
+
}
|
|
5835
|
+
/**
|
|
5836
|
+
* @public
|
|
5837
|
+
*/
|
|
5838
|
+
interface $UnknownMember {
|
|
5839
|
+
knowledgeBaseConfig?: never;
|
|
5840
|
+
$unknown: [string, any];
|
|
5841
|
+
}
|
|
5842
|
+
interface Visitor<T> {
|
|
5843
|
+
knowledgeBaseConfig: (value: KnowledgeBaseConfig) => T;
|
|
5844
|
+
_: (name: string, value: any) => T;
|
|
5845
|
+
}
|
|
5846
|
+
const visit: <T>(value: RAGConfig, visitor: Visitor<T>) => T;
|
|
5847
|
+
}
|
|
5848
|
+
/**
|
|
5849
|
+
* <p>The configuration details of the inference model for an evaluation job.</p>
|
|
5850
|
+
* <p>For automated model evaluation jobs, only a single model is supported.</p>
|
|
5851
|
+
* <p>For human-based model evaluation jobs, your annotator can compare the responses for up to two different models.</p>
|
|
5852
|
+
* @public
|
|
5853
|
+
*/
|
|
5854
|
+
export type EvaluationInferenceConfig = EvaluationInferenceConfig.ModelsMember | EvaluationInferenceConfig.RagConfigsMember | EvaluationInferenceConfig.$UnknownMember;
|
|
5855
|
+
/**
|
|
5856
|
+
* @public
|
|
5857
|
+
*/
|
|
5858
|
+
export declare namespace EvaluationInferenceConfig {
|
|
5859
|
+
/**
|
|
5860
|
+
* <p>Specifies the inference models.</p>
|
|
5861
|
+
* @public
|
|
5862
|
+
*/
|
|
5863
|
+
interface ModelsMember {
|
|
5864
|
+
models: EvaluationModelConfig[];
|
|
5865
|
+
ragConfigs?: never;
|
|
5866
|
+
$unknown?: never;
|
|
5867
|
+
}
|
|
5868
|
+
/**
|
|
5869
|
+
* <p>Contains the configuration details of the inference for a knowledge base evaluation
|
|
5870
|
+
* job, including either the retrieval only configuration or the retrieval with response
|
|
5871
|
+
* generation configuration.</p>
|
|
5872
|
+
* @public
|
|
5873
|
+
*/
|
|
5874
|
+
interface RagConfigsMember {
|
|
5875
|
+
models?: never;
|
|
5876
|
+
ragConfigs: RAGConfig[];
|
|
5877
|
+
$unknown?: never;
|
|
5878
|
+
}
|
|
5879
|
+
/**
|
|
5880
|
+
* @public
|
|
5881
|
+
*/
|
|
5882
|
+
interface $UnknownMember {
|
|
5883
|
+
models?: never;
|
|
5884
|
+
ragConfigs?: never;
|
|
5885
|
+
$unknown: [string, any];
|
|
5886
|
+
}
|
|
5887
|
+
interface Visitor<T> {
|
|
5888
|
+
models: (value: EvaluationModelConfig[]) => T;
|
|
5889
|
+
ragConfigs: (value: RAGConfig[]) => T;
|
|
5890
|
+
_: (name: string, value: any) => T;
|
|
5891
|
+
}
|
|
5892
|
+
const visit: <T>(value: EvaluationInferenceConfig, visitor: Visitor<T>) => T;
|
|
5893
|
+
}
|
|
5894
|
+
/**
|
|
5895
|
+
* @public
|
|
5896
|
+
*/
|
|
5897
|
+
export interface CreateEvaluationJobRequest {
|
|
5898
|
+
/**
|
|
5899
|
+
* <p>A name for the evaluation job. Names must unique with your Amazon Web Services account,
|
|
5900
|
+
* and your account's Amazon Web Services region.</p>
|
|
5901
|
+
* @public
|
|
5902
|
+
*/
|
|
5903
|
+
jobName: string | undefined;
|
|
5904
|
+
/**
|
|
5905
|
+
* <p>A description of the evaluation job.</p>
|
|
5906
|
+
* @public
|
|
5907
|
+
*/
|
|
5908
|
+
jobDescription?: string | undefined;
|
|
5909
|
+
/**
|
|
5910
|
+
* <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request,
|
|
5911
|
+
* Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
|
|
5912
|
+
* @public
|
|
5913
|
+
*/
|
|
5914
|
+
clientRequestToken?: string | undefined;
|
|
5915
|
+
/**
|
|
5916
|
+
* <p>The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock can
|
|
5917
|
+
* assume to perform tasks on your behalf. To learn more about the required permissions,
|
|
5918
|
+
* see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-security.html">Required
|
|
5919
|
+
* permissions for model evaluations</a>.</p>
|
|
5920
|
+
* @public
|
|
5921
|
+
*/
|
|
5922
|
+
roleArn: string | undefined;
|
|
5923
|
+
/**
|
|
5924
|
+
* <p>Specify your customer managed encryption key Amazon Resource Name (ARN) that will be used to encrypt your evaluation job.</p>
|
|
5925
|
+
* @public
|
|
5926
|
+
*/
|
|
5927
|
+
customerEncryptionKeyId?: string | undefined;
|
|
5928
|
+
/**
|
|
5929
|
+
* <p>Tags to attach to the model evaluation job.</p>
|
|
5930
|
+
* @public
|
|
5931
|
+
*/
|
|
5932
|
+
jobTags?: Tag[] | undefined;
|
|
5933
|
+
/**
|
|
5934
|
+
* <p>Specifies whether the evaluation job is for evaluating a model or evaluating a knowledge base
|
|
5935
|
+
* (retrieval and response generation).</p>
|
|
5936
|
+
* @public
|
|
5937
|
+
*/
|
|
5938
|
+
applicationType?: ApplicationType | undefined;
|
|
5939
|
+
/**
|
|
5940
|
+
* <p>Contains the configuration details of either an automated or human-based evaluation job.</p>
|
|
5941
|
+
* @public
|
|
5942
|
+
*/
|
|
5943
|
+
evaluationConfig: EvaluationConfig | undefined;
|
|
5944
|
+
/**
|
|
5945
|
+
* <p>Contains the configuration details of the inference model for the evaluation job.</p>
|
|
5946
|
+
* <p>For model evaluation jobs, automated jobs support a single model or
|
|
5947
|
+
* <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference profile</a>, and jobs that use human workers support
|
|
5948
|
+
* two models or inference profiles.</p>
|
|
5949
|
+
* @public
|
|
5950
|
+
*/
|
|
5951
|
+
inferenceConfig: EvaluationInferenceConfig | undefined;
|
|
5952
|
+
/**
|
|
5953
|
+
* <p>Contains the configuration details of the Amazon S3 bucket for storing the results
|
|
5954
|
+
* of the evaluation job.</p>
|
|
5955
|
+
* @public
|
|
5956
|
+
*/
|
|
5957
|
+
outputDataConfig: EvaluationOutputDataConfig | undefined;
|
|
5958
|
+
}
|
|
5959
|
+
/**
|
|
5960
|
+
* @public
|
|
5961
|
+
*/
|
|
5962
|
+
export interface GetEvaluationJobResponse {
|
|
5963
|
+
/**
|
|
5964
|
+
* <p>The name for the evaluation job.</p>
|
|
5965
|
+
* @public
|
|
5966
|
+
*/
|
|
5967
|
+
jobName: string | undefined;
|
|
5968
|
+
/**
|
|
5969
|
+
* <p>The current status of the evaluation job.</p>
|
|
5970
|
+
* @public
|
|
5971
|
+
*/
|
|
5972
|
+
status: EvaluationJobStatus | undefined;
|
|
5973
|
+
/**
|
|
5974
|
+
* <p>The Amazon Resource Name (ARN) of the evaluation job.</p>
|
|
5975
|
+
* @public
|
|
5976
|
+
*/
|
|
5977
|
+
jobArn: string | undefined;
|
|
5978
|
+
/**
|
|
5979
|
+
* <p>The description of the evaluation job.</p>
|
|
5980
|
+
* @public
|
|
5981
|
+
*/
|
|
5982
|
+
jobDescription?: string | undefined;
|
|
5983
|
+
/**
|
|
5984
|
+
* <p>The Amazon Resource Name (ARN) of the IAM service role used in the evaluation job.</p>
|
|
5985
|
+
* @public
|
|
5986
|
+
*/
|
|
5987
|
+
roleArn: string | undefined;
|
|
5988
|
+
/**
|
|
5989
|
+
* <p>The Amazon Resource Name (ARN) of the customer managed encryption key specified when the evaluation job was created.</p>
|
|
5990
|
+
* @public
|
|
5991
|
+
*/
|
|
5992
|
+
customerEncryptionKeyId?: string | undefined;
|
|
5993
|
+
/**
|
|
5994
|
+
* <p>Specifies whether the evaluation job is automated or human-based.</p>
|
|
5995
|
+
* @public
|
|
5996
|
+
*/
|
|
5997
|
+
jobType: EvaluationJobType | undefined;
|
|
5998
|
+
/**
|
|
5999
|
+
* <p>Specifies whether the evaluation job is for evaluating a model or evaluating a knowledge base (retrieval and response generation).</p>
|
|
6000
|
+
* @public
|
|
6001
|
+
*/
|
|
6002
|
+
applicationType?: ApplicationType | undefined;
|
|
6003
|
+
/**
|
|
6004
|
+
* <p>Contains the configuration details of either an automated or human-based evaluation job.</p>
|
|
6005
|
+
* @public
|
|
6006
|
+
*/
|
|
6007
|
+
evaluationConfig: EvaluationConfig | undefined;
|
|
6008
|
+
/**
|
|
6009
|
+
* <p>Contains the configuration details of the inference model used for the evaluation job. </p>
|
|
6010
|
+
* @public
|
|
6011
|
+
*/
|
|
6012
|
+
inferenceConfig: EvaluationInferenceConfig | undefined;
|
|
6013
|
+
/**
|
|
6014
|
+
* <p>Contains the configuration details of the Amazon S3 bucket for
|
|
6015
|
+
* storing the results of the evaluation job.</p>
|
|
6016
|
+
* @public
|
|
6017
|
+
*/
|
|
6018
|
+
outputDataConfig: EvaluationOutputDataConfig | undefined;
|
|
6019
|
+
/**
|
|
6020
|
+
* <p>The time the evaluation job was created.</p>
|
|
6021
|
+
* @public
|
|
6022
|
+
*/
|
|
6023
|
+
creationTime: Date | undefined;
|
|
6024
|
+
/**
|
|
6025
|
+
* <p>The time the evaluation job was last modified.</p>
|
|
6026
|
+
* @public
|
|
6027
|
+
*/
|
|
6028
|
+
lastModifiedTime?: Date | undefined;
|
|
6029
|
+
/**
|
|
6030
|
+
* <p>A list of strings that specify why the evaluation job failed to create.</p>
|
|
6031
|
+
* @public
|
|
6032
|
+
*/
|
|
6033
|
+
failureMessages?: string[] | undefined;
|
|
6034
|
+
}
|
|
6035
|
+
/**
|
|
6036
|
+
* @internal
|
|
5068
6037
|
*/
|
|
5069
6038
|
export declare const BatchDeleteEvaluationJobRequestFilterSensitiveLog: (obj: BatchDeleteEvaluationJobRequest) => any;
|
|
5070
6039
|
/**
|
|
@@ -5118,19 +6087,31 @@ export declare const EvaluationModelConfigFilterSensitiveLog: (obj: EvaluationMo
|
|
|
5118
6087
|
/**
|
|
5119
6088
|
* @internal
|
|
5120
6089
|
*/
|
|
5121
|
-
export declare const
|
|
6090
|
+
export declare const PromptTemplateFilterSensitiveLog: (obj: PromptTemplate) => any;
|
|
5122
6091
|
/**
|
|
5123
6092
|
* @internal
|
|
5124
6093
|
*/
|
|
5125
|
-
export declare const
|
|
6094
|
+
export declare const ExternalSourcesGenerationConfigurationFilterSensitiveLog: (obj: ExternalSourcesGenerationConfiguration) => any;
|
|
5126
6095
|
/**
|
|
5127
6096
|
* @internal
|
|
5128
6097
|
*/
|
|
5129
|
-
export declare const
|
|
6098
|
+
export declare const ByteContentDocFilterSensitiveLog: (obj: ByteContentDoc) => any;
|
|
5130
6099
|
/**
|
|
5131
6100
|
* @internal
|
|
5132
6101
|
*/
|
|
5133
|
-
export declare const
|
|
6102
|
+
export declare const ExternalSourceFilterSensitiveLog: (obj: ExternalSource) => any;
|
|
6103
|
+
/**
|
|
6104
|
+
* @internal
|
|
6105
|
+
*/
|
|
6106
|
+
export declare const ExternalSourcesRetrieveAndGenerateConfigurationFilterSensitiveLog: (obj: ExternalSourcesRetrieveAndGenerateConfiguration) => any;
|
|
6107
|
+
/**
|
|
6108
|
+
* @internal
|
|
6109
|
+
*/
|
|
6110
|
+
export declare const GenerationConfigurationFilterSensitiveLog: (obj: GenerationConfiguration) => any;
|
|
6111
|
+
/**
|
|
6112
|
+
* @internal
|
|
6113
|
+
*/
|
|
6114
|
+
export declare const GetEvaluationJobRequestFilterSensitiveLog: (obj: GetEvaluationJobRequest) => any;
|
|
5134
6115
|
/**
|
|
5135
6116
|
* @internal
|
|
5136
6117
|
*/
|
|
@@ -5203,3 +6184,47 @@ export declare const ModelInvocationJobSummaryFilterSensitiveLog: (obj: ModelInv
|
|
|
5203
6184
|
* @internal
|
|
5204
6185
|
*/
|
|
5205
6186
|
export declare const ListModelInvocationJobsResponseFilterSensitiveLog: (obj: ListModelInvocationJobsResponse) => any;
|
|
6187
|
+
/**
|
|
6188
|
+
* @internal
|
|
6189
|
+
*/
|
|
6190
|
+
export declare const RetrievalFilterFilterSensitiveLog: (obj: RetrievalFilter) => any;
|
|
6191
|
+
/**
|
|
6192
|
+
* @internal
|
|
6193
|
+
*/
|
|
6194
|
+
export declare const KnowledgeBaseVectorSearchConfigurationFilterSensitiveLog: (obj: KnowledgeBaseVectorSearchConfiguration) => any;
|
|
6195
|
+
/**
|
|
6196
|
+
* @internal
|
|
6197
|
+
*/
|
|
6198
|
+
export declare const KnowledgeBaseRetrievalConfigurationFilterSensitiveLog: (obj: KnowledgeBaseRetrievalConfiguration) => any;
|
|
6199
|
+
/**
|
|
6200
|
+
* @internal
|
|
6201
|
+
*/
|
|
6202
|
+
export declare const KnowledgeBaseRetrieveAndGenerateConfigurationFilterSensitiveLog: (obj: KnowledgeBaseRetrieveAndGenerateConfiguration) => any;
|
|
6203
|
+
/**
|
|
6204
|
+
* @internal
|
|
6205
|
+
*/
|
|
6206
|
+
export declare const RetrieveConfigFilterSensitiveLog: (obj: RetrieveConfig) => any;
|
|
6207
|
+
/**
|
|
6208
|
+
* @internal
|
|
6209
|
+
*/
|
|
6210
|
+
export declare const RetrieveAndGenerateConfigurationFilterSensitiveLog: (obj: RetrieveAndGenerateConfiguration) => any;
|
|
6211
|
+
/**
|
|
6212
|
+
* @internal
|
|
6213
|
+
*/
|
|
6214
|
+
export declare const KnowledgeBaseConfigFilterSensitiveLog: (obj: KnowledgeBaseConfig) => any;
|
|
6215
|
+
/**
|
|
6216
|
+
* @internal
|
|
6217
|
+
*/
|
|
6218
|
+
export declare const RAGConfigFilterSensitiveLog: (obj: RAGConfig) => any;
|
|
6219
|
+
/**
|
|
6220
|
+
* @internal
|
|
6221
|
+
*/
|
|
6222
|
+
export declare const EvaluationInferenceConfigFilterSensitiveLog: (obj: EvaluationInferenceConfig) => any;
|
|
6223
|
+
/**
|
|
6224
|
+
* @internal
|
|
6225
|
+
*/
|
|
6226
|
+
export declare const CreateEvaluationJobRequestFilterSensitiveLog: (obj: CreateEvaluationJobRequest) => any;
|
|
6227
|
+
/**
|
|
6228
|
+
* @internal
|
|
6229
|
+
*/
|
|
6230
|
+
export declare const GetEvaluationJobResponseFilterSensitiveLog: (obj: GetEvaluationJobResponse) => any;
|