@aws-cdk/aws-bedrock-agentcore-alpha 2.252.0-alpha.0 → 2.253.0-alpha.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/.jsii +11191 -7249
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +30 -0
- package/README.md +422 -0
- package/lib/evaluation/custom-evaluator.d.ts +153 -0
- package/lib/evaluation/custom-evaluator.js +256 -0
- package/lib/evaluation/data-source.d.ts +106 -0
- package/lib/evaluation/data-source.js +156 -0
- package/lib/evaluation/evaluator-base.d.ts +82 -0
- package/lib/evaluation/evaluator-base.js +55 -0
- package/lib/evaluation/evaluator-config.d.ts +195 -0
- package/lib/evaluation/evaluator-config.js +184 -0
- package/lib/evaluation/evaluator.d.ts +68 -0
- package/lib/evaluation/evaluator.js +90 -0
- package/lib/evaluation/online-evaluation-base.d.ts +96 -0
- package/lib/evaluation/online-evaluation-base.js +55 -0
- package/lib/evaluation/online-evaluation.d.ts +134 -0
- package/lib/evaluation/online-evaluation.js +388 -0
- package/lib/evaluation/perms.d.ts +34 -0
- package/lib/evaluation/perms.js +53 -0
- package/lib/evaluation/types.d.ts +461 -0
- package/lib/evaluation/types.js +229 -0
- package/lib/evaluation/validation-helpers.d.ts +133 -0
- package/lib/evaluation/validation-helpers.js +349 -0
- package/lib/gateway/gateway-base.js +1 -1
- package/lib/gateway/gateway.js +2 -2
- package/lib/gateway/inbound-auth/authorizer.js +4 -4
- package/lib/gateway/inbound-auth/custom-claim.js +1 -1
- package/lib/gateway/interceptor.js +1 -1
- package/lib/gateway/outbound-auth/api-key.js +1 -1
- package/lib/gateway/outbound-auth/credential-provider.js +1 -1
- package/lib/gateway/protocol.js +2 -2
- package/lib/gateway/targets/schema/api-schema.js +4 -4
- package/lib/gateway/targets/schema/tool-schema.js +4 -4
- package/lib/gateway/targets/target-base.js +1 -1
- package/lib/gateway/targets/target-configuration.js +6 -6
- package/lib/gateway/targets/target.js +1 -1
- package/lib/index.d.ts +9 -0
- package/lib/index.js +13 -1
- package/lib/memory/memory-strategy.js +1 -1
- package/lib/memory/memory.js +2 -2
- package/lib/memory/strategies/managed-strategy.js +1 -1
- package/lib/memory/strategies/self-managed-strategy.js +8 -5
- package/lib/network/network-configuration.js +4 -4
- package/lib/policy/policy-base.js +1 -1
- package/lib/policy/policy-engine-base.js +1 -1
- package/lib/policy/policy-engine.js +1 -1
- package/lib/policy/policy-statement.js +5 -5
- package/lib/policy/policy-types.js +1 -1
- package/lib/policy/policy.js +1 -1
- package/lib/runtime/inbound-auth/custom-claim.js +1 -1
- package/lib/runtime/inbound-auth/runtime-authorizer-configuration.js +1 -1
- package/lib/runtime/observability.js +2 -2
- package/lib/runtime/runtime-artifact.js +1 -1
- package/lib/runtime/runtime-base.js +1 -1
- package/lib/runtime/runtime-endpoint-base.js +1 -1
- package/lib/runtime/runtime-endpoint.js +1 -1
- package/lib/runtime/runtime.js +1 -1
- package/lib/tools/browser.js +2 -2
- package/lib/tools/code-interpreter.js +2 -2
- package/package.json +10 -9
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
5
|
+
* with the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
10
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
import { Resource, type IResource, type ResourceProps } from 'aws-cdk-lib';
|
|
14
|
+
import type { IOnlineEvaluationConfigRef, OnlineEvaluationConfigReference } from 'aws-cdk-lib/aws-bedrockagentcore';
|
|
15
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
16
|
+
import type { Construct } from 'constructs';
|
|
17
|
+
/**
|
|
18
|
+
* Interface for OnlineEvaluationConfig resources.
|
|
19
|
+
*/
|
|
20
|
+
export interface IOnlineEvaluationConfig extends IResource, iam.IGrantable, IOnlineEvaluationConfigRef {
|
|
21
|
+
/**
|
|
22
|
+
* The ARN of the online evaluation configuration.
|
|
23
|
+
* @attribute
|
|
24
|
+
*/
|
|
25
|
+
readonly onlineEvaluationConfigArn: string;
|
|
26
|
+
/**
|
|
27
|
+
* The unique identifier of the online evaluation configuration.
|
|
28
|
+
* @attribute
|
|
29
|
+
*/
|
|
30
|
+
readonly onlineEvaluationConfigId: string;
|
|
31
|
+
/**
|
|
32
|
+
* The name of the online evaluation configuration.
|
|
33
|
+
* @attribute
|
|
34
|
+
*/
|
|
35
|
+
readonly onlineEvaluationConfigName: string;
|
|
36
|
+
/**
|
|
37
|
+
* The IAM execution role for the evaluation.
|
|
38
|
+
*/
|
|
39
|
+
readonly executionRole?: iam.IRole;
|
|
40
|
+
/**
|
|
41
|
+
* The lifecycle status of the configuration (CREATING, ACTIVE, FAILED, DELETING).
|
|
42
|
+
* @attribute
|
|
43
|
+
*/
|
|
44
|
+
readonly status?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The execution status of the evaluation (ENABLED or DISABLED).
|
|
47
|
+
*/
|
|
48
|
+
readonly executionStatus?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The timestamp when the configuration was created.
|
|
51
|
+
* @attribute
|
|
52
|
+
*/
|
|
53
|
+
readonly createdAt?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The timestamp when the configuration was last updated.
|
|
56
|
+
* @attribute
|
|
57
|
+
*/
|
|
58
|
+
readonly updatedAt?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Grant the given principal identity permissions to perform actions on this configuration.
|
|
61
|
+
*/
|
|
62
|
+
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Abstract base class for OnlineEvaluationConfig.
|
|
66
|
+
* Contains methods and attributes valid for configurations either created with CDK or imported.
|
|
67
|
+
*/
|
|
68
|
+
export declare abstract class OnlineEvaluationBase extends Resource implements IOnlineEvaluationConfig {
|
|
69
|
+
abstract readonly onlineEvaluationConfigArn: string;
|
|
70
|
+
abstract readonly onlineEvaluationConfigId: string;
|
|
71
|
+
abstract readonly onlineEvaluationConfigName: string;
|
|
72
|
+
abstract readonly executionRole?: iam.IRole;
|
|
73
|
+
abstract readonly status?: string;
|
|
74
|
+
abstract readonly executionStatus?: string;
|
|
75
|
+
abstract readonly createdAt?: string;
|
|
76
|
+
abstract readonly updatedAt?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The principal to grant permissions to.
|
|
79
|
+
*/
|
|
80
|
+
abstract readonly grantPrincipal: iam.IPrincipal;
|
|
81
|
+
constructor(scope: Construct, id: string, props?: ResourceProps);
|
|
82
|
+
/**
|
|
83
|
+
* A reference to this OnlineEvaluationConfig resource.
|
|
84
|
+
*/
|
|
85
|
+
get onlineEvaluationConfigRef(): OnlineEvaluationConfigReference;
|
|
86
|
+
/**
|
|
87
|
+
* Grants IAM actions to the IAM Principal.
|
|
88
|
+
*
|
|
89
|
+
* [disable-awslint:no-grants]
|
|
90
|
+
*
|
|
91
|
+
* @param grantee - The IAM principal to grant permissions to
|
|
92
|
+
* @param actions - The actions to grant
|
|
93
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
94
|
+
*/
|
|
95
|
+
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
|
|
96
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OnlineEvaluationBase = void 0;
|
|
4
|
+
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
5
|
+
/**
|
|
6
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
9
|
+
* with the License. A copy of the License is located at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
14
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
15
|
+
* and limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
18
|
+
const iam = require("aws-cdk-lib/aws-iam");
|
|
19
|
+
/**
|
|
20
|
+
* Abstract base class for OnlineEvaluationConfig.
|
|
21
|
+
* Contains methods and attributes valid for configurations either created with CDK or imported.
|
|
22
|
+
*/
|
|
23
|
+
class OnlineEvaluationBase extends aws_cdk_lib_1.Resource {
|
|
24
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/aws-bedrock-agentcore-alpha.OnlineEvaluationBase", version: "2.253.0-alpha.0" };
|
|
25
|
+
constructor(scope, id, props = {}) {
|
|
26
|
+
super(scope, id, props);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A reference to this OnlineEvaluationConfig resource.
|
|
30
|
+
*/
|
|
31
|
+
get onlineEvaluationConfigRef() {
|
|
32
|
+
return {
|
|
33
|
+
onlineEvaluationConfigArn: this.onlineEvaluationConfigArn,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Grants IAM actions to the IAM Principal.
|
|
38
|
+
*
|
|
39
|
+
* [disable-awslint:no-grants]
|
|
40
|
+
*
|
|
41
|
+
* @param grantee - The IAM principal to grant permissions to
|
|
42
|
+
* @param actions - The actions to grant
|
|
43
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
44
|
+
*/
|
|
45
|
+
grant(grantee, ...actions) {
|
|
46
|
+
return iam.Grant.addToPrincipal({
|
|
47
|
+
grantee,
|
|
48
|
+
actions,
|
|
49
|
+
resourceArns: [this.onlineEvaluationConfigArn],
|
|
50
|
+
scope: this,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.OnlineEvaluationBase = OnlineEvaluationBase;
|
|
55
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib25saW5lLWV2YWx1YXRpb24tYmFzZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm9ubGluZS1ldmFsdWF0aW9uLWJhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBOzs7Ozs7Ozs7OztHQVdHO0FBRUgsNkNBQTJFO0FBRTNFLDJDQUEyQztBQTJEM0M7OztHQUdHO0FBQ0gsTUFBc0Isb0JBQXFCLFNBQVEsc0JBQVE7O0lBZXpELFlBQVksS0FBZ0IsRUFBRSxFQUFVLEVBQUUsUUFBdUIsRUFBRTtRQUNqRSxLQUFLLENBQUMsS0FBSyxFQUFFLEVBQUUsRUFBRSxLQUFLLENBQUMsQ0FBQztLQUN6QjtJQUVEOztPQUVHO0lBQ0gsSUFBVyx5QkFBeUI7UUFDbEMsT0FBTztZQUNMLHlCQUF5QixFQUFFLElBQUksQ0FBQyx5QkFBeUI7U0FDMUQsQ0FBQztLQUNIO0lBRUQ7Ozs7Ozs7O09BUUc7SUFDSSxLQUFLLENBQUMsT0FBdUIsRUFBRSxHQUFHLE9BQWlCO1FBQ3hELE9BQU8sR0FBRyxDQUFDLEtBQUssQ0FBQyxjQUFjLENBQUM7WUFDOUIsT0FBTztZQUNQLE9BQU87WUFDUCxZQUFZLEVBQUUsQ0FBQyxJQUFJLENBQUMseUJBQXlCLENBQUM7WUFDOUMsS0FBSyxFQUFFLElBQUk7U0FDWixDQUFDLENBQUM7S0FDSjs7QUE1Q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iliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
5
|
+
* with the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
10
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
14
|
+
import type { Construct } from 'constructs';
|
|
15
|
+
import type { DataSourceConfig } from './data-source';
|
|
16
|
+
import type { EvaluatorReference } from './evaluator';
|
|
17
|
+
import { type IOnlineEvaluationConfig, OnlineEvaluationBase } from './online-evaluation-base';
|
|
18
|
+
import { type OnlineEvaluationBaseProps, type OnlineEvaluationConfigAttributes } from './types';
|
|
19
|
+
/**
|
|
20
|
+
* Properties for creating an OnlineEvaluationConfig.
|
|
21
|
+
*/
|
|
22
|
+
export interface OnlineEvaluationConfigProps extends OnlineEvaluationBaseProps {
|
|
23
|
+
/**
|
|
24
|
+
* The list of evaluators to apply during online evaluation.
|
|
25
|
+
*
|
|
26
|
+
* Can include both built-in evaluators and custom evaluators.
|
|
27
|
+
*
|
|
28
|
+
* @minimum 1
|
|
29
|
+
* @maximum 10
|
|
30
|
+
*/
|
|
31
|
+
readonly evaluators: EvaluatorReference[];
|
|
32
|
+
/**
|
|
33
|
+
* The data source configuration that specifies where to read agent traces from.
|
|
34
|
+
*/
|
|
35
|
+
readonly dataSource: DataSourceConfig;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Online evaluation configuration for Amazon Bedrock AgentCore.
|
|
39
|
+
*
|
|
40
|
+
* Enables continuous evaluation of agent performance using built-in or custom evaluators.
|
|
41
|
+
* Supports CloudWatch Logs and Agent Endpoint data sources.
|
|
42
|
+
*
|
|
43
|
+
* @resource AWS::BedrockAgentCore::OnlineEvaluationConfig
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* // Basic usage with built-in evaluators
|
|
47
|
+
* const evaluation = new agentcore.OnlineEvaluationConfig(this, 'MyEvaluation', {
|
|
48
|
+
* onlineEvaluationConfigName: 'my_evaluation',
|
|
49
|
+
* evaluators: [
|
|
50
|
+
* agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.HELPFULNESS),
|
|
51
|
+
* agentcore.EvaluatorReference.builtin(agentcore.BuiltinEvaluator.CORRECTNESS),
|
|
52
|
+
* ],
|
|
53
|
+
* dataSource: agentcore.DataSourceConfig.fromCloudWatchLogs({
|
|
54
|
+
* logGroupNames: ['/aws/bedrock-agentcore/my-agent'],
|
|
55
|
+
* serviceNames: ['my-agent.default'],
|
|
56
|
+
* }),
|
|
57
|
+
* });
|
|
58
|
+
*/
|
|
59
|
+
export declare class OnlineEvaluationConfig extends OnlineEvaluationBase {
|
|
60
|
+
/** Uniquely identifies this class. */
|
|
61
|
+
static readonly PROPERTY_INJECTION_ID: string;
|
|
62
|
+
/**
|
|
63
|
+
* Import an existing OnlineEvaluationConfig by its ID.
|
|
64
|
+
*
|
|
65
|
+
* @param scope - The construct scope
|
|
66
|
+
* @param id - Construct identifier
|
|
67
|
+
* @param onlineEvaluationConfigId - The configuration ID to import
|
|
68
|
+
* @returns An IOnlineEvaluationConfig reference
|
|
69
|
+
*/
|
|
70
|
+
static fromOnlineEvaluationConfigId(scope: Construct, id: string, onlineEvaluationConfigId: string): IOnlineEvaluationConfig;
|
|
71
|
+
/**
|
|
72
|
+
* Import an existing OnlineEvaluationConfig by its ARN.
|
|
73
|
+
*
|
|
74
|
+
* @param scope - The construct scope
|
|
75
|
+
* @param id - Construct identifier
|
|
76
|
+
* @param onlineEvaluationConfigArn - The configuration ARN to import
|
|
77
|
+
* @returns An IOnlineEvaluationConfig reference
|
|
78
|
+
*/
|
|
79
|
+
static fromOnlineEvaluationConfigArn(scope: Construct, id: string, onlineEvaluationConfigArn: string): IOnlineEvaluationConfig;
|
|
80
|
+
/**
|
|
81
|
+
* Import an existing OnlineEvaluationConfig from its attributes.
|
|
82
|
+
*
|
|
83
|
+
* @param scope - The construct scope
|
|
84
|
+
* @param id - Construct identifier
|
|
85
|
+
* @param attrs - The configuration attributes
|
|
86
|
+
* @returns An IOnlineEvaluationConfig reference
|
|
87
|
+
*/
|
|
88
|
+
static fromOnlineEvaluationConfigAttributes(scope: Construct, id: string, attrs: OnlineEvaluationConfigAttributes): IOnlineEvaluationConfig;
|
|
89
|
+
/**
|
|
90
|
+
* The ARN of the online evaluation configuration.
|
|
91
|
+
* @attribute
|
|
92
|
+
*/
|
|
93
|
+
readonly onlineEvaluationConfigArn: string;
|
|
94
|
+
/**
|
|
95
|
+
* The unique identifier of the online evaluation configuration.
|
|
96
|
+
* @attribute
|
|
97
|
+
*/
|
|
98
|
+
readonly onlineEvaluationConfigId: string;
|
|
99
|
+
/**
|
|
100
|
+
* The name of the online evaluation configuration.
|
|
101
|
+
* @attribute
|
|
102
|
+
*/
|
|
103
|
+
readonly onlineEvaluationConfigName: string;
|
|
104
|
+
/**
|
|
105
|
+
* The IAM execution role for the evaluation.
|
|
106
|
+
*/
|
|
107
|
+
readonly executionRole?: iam.IRole;
|
|
108
|
+
/**
|
|
109
|
+
* The lifecycle status of the configuration.
|
|
110
|
+
* @attribute
|
|
111
|
+
*/
|
|
112
|
+
readonly status?: string;
|
|
113
|
+
/**
|
|
114
|
+
* The execution status of the evaluation (ENABLED or DISABLED).
|
|
115
|
+
*/
|
|
116
|
+
readonly executionStatus?: string;
|
|
117
|
+
/**
|
|
118
|
+
* The timestamp when the configuration was created.
|
|
119
|
+
* @attribute
|
|
120
|
+
*/
|
|
121
|
+
readonly createdAt?: string;
|
|
122
|
+
/**
|
|
123
|
+
* The timestamp when the configuration was last updated.
|
|
124
|
+
* @attribute
|
|
125
|
+
*/
|
|
126
|
+
readonly updatedAt?: string;
|
|
127
|
+
/**
|
|
128
|
+
* The principal to grant permissions to.
|
|
129
|
+
*/
|
|
130
|
+
readonly grantPrincipal: iam.IPrincipal;
|
|
131
|
+
constructor(scope: Construct, id: string, props: OnlineEvaluationConfigProps);
|
|
132
|
+
private createExecutionRole;
|
|
133
|
+
private buildRuleConfig;
|
|
134
|
+
}
|