Class: AWSCDK::BedrockAgentCore::OnlineEvaluationBaseProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock_agent_core/online_evaluation_base_props.rb

Overview

Base properties for creating an OnlineEvaluationConfig.

The actual OnlineEvaluationProps is defined in online-evaluation-config.ts to avoid circular dependencies.

Direct Known Subclasses

OnlineEvaluationConfigProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(online_evaluation_config_name:, description: nil, execution_role: nil, execution_status: nil, filters: nil, sampling_percentage: nil, session_timeout: nil) ⇒ OnlineEvaluationBaseProps

Returns a new instance of OnlineEvaluationBaseProps.

Parameters:

  • online_evaluation_config_name (String)

    The name of the online evaluation configuration.

  • description (String, nil) (defaults to: nil)

    The description of the online evaluation configuration.

  • execution_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The IAM role that provides permissions for the evaluation to access AWS services.

  • execution_status (AWSCDK::BedrockAgentCore::ExecutionStatus, nil) (defaults to: nil)

    The execution status of the online evaluation configuration.

  • filters (Array<AWSCDK::BedrockAgentCore::FilterConfig>, nil) (defaults to: nil)

    The list of filters that determine which agent traces should be evaluated.

  • sampling_percentage (Numeric, nil) (defaults to: nil)

    The percentage of agent traces to sample for evaluation.

  • session_timeout (AWSCDK::Duration, nil) (defaults to: nil)

    The duration of inactivity after which an agent session is considered complete and ready for evaluation.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'bedrock_agent_core/online_evaluation_base_props.rb', line 17

def initialize(online_evaluation_config_name:, description: nil, execution_role: nil, execution_status: nil, filters: nil, sampling_percentage: nil, session_timeout: nil)
  @online_evaluation_config_name = online_evaluation_config_name
  Jsii::Type.check_type(@online_evaluation_config_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "onlineEvaluationConfigName")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @execution_role = execution_role
  Jsii::Type.check_type(@execution_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "executionRole") unless @execution_role.nil?
  @execution_status = execution_status
  Jsii::Type.check_type(@execution_status, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5FeGVjdXRpb25TdGF0dXMifQ==")), "executionStatus") unless @execution_status.nil?
  @filters = filters.is_a?(Array) ? filters.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::BedrockAgentCore::FilterConfig.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : filters
  Jsii::Type.check_type(@filters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrYWdlbnRjb3JlLkZpbHRlckNvbmZpZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "filters") unless @filters.nil?
  @sampling_percentage = sampling_percentage
  Jsii::Type.check_type(@sampling_percentage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "samplingPercentage") unless @sampling_percentage.nil?
  @session_timeout = session_timeout
  Jsii::Type.check_type(@session_timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "sessionTimeout") unless @session_timeout.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

Note:

Default: - No description

The description of the online evaluation configuration.

Returns:

  • (String, nil)


45
46
47
# File 'bedrock_agent_core/online_evaluation_base_props.rb', line 45

def description
  @description
end

#execution_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - A new role will be created

The IAM role that provides permissions for the evaluation to access AWS services.

If not provided, a role will be created automatically with the required permissions including cross-region Bedrock model invocation (to support cross-region inference profiles). For strict cost controls or data residency compliance, provide a custom role with region-scoped permissions.

Returns:



55
56
57
# File 'bedrock_agent_core/online_evaluation_base_props.rb', line 55

def execution_role
  @execution_role
end

#execution_statusAWSCDK::BedrockAgentCore::ExecutionStatus? (readonly)

Note:

Default: ExecutionStatus.ENABLED

The execution status of the online evaluation configuration.

Controls whether the evaluation actively processes agent traces.



62
63
64
# File 'bedrock_agent_core/online_evaluation_base_props.rb', line 62

def execution_status
  @execution_status
end

#filtersArray<AWSCDK::BedrockAgentCore::FilterConfig>? (readonly)

Note:

Default: - No filters (evaluate all sampled traces)

The list of filters that determine which agent traces should be evaluated.



67
68
69
# File 'bedrock_agent_core/online_evaluation_base_props.rb', line 67

def filters
  @filters
end

#online_evaluation_config_nameString (readonly)

The name of the online evaluation configuration.

Must be unique within your account. Valid characters are a-z, A-Z, 0-9, _ (underscore). Must start with a letter and can be up to 48 characters long.

Returns:

  • (String)


40
41
42
# File 'bedrock_agent_core/online_evaluation_base_props.rb', line 40

def online_evaluation_config_name
  @online_evaluation_config_name
end

#sampling_percentageNumeric? (readonly)

Note:

Default: 10

The percentage of agent traces to sample for evaluation.

Returns:

  • (Numeric, nil)


72
73
74
# File 'bedrock_agent_core/online_evaluation_base_props.rb', line 72

def sampling_percentage
  @sampling_percentage
end

#session_timeoutAWSCDK::Duration? (readonly)

Note:

Default: Duration.minutes(15)

The duration of inactivity after which an agent session is considered complete and ready for evaluation.

Must be between 1 minute and 1440 minutes (24 hours).

Returns:



79
80
81
# File 'bedrock_agent_core/online_evaluation_base_props.rb', line 79

def session_timeout
  @session_timeout
end

Class Method Details

.jsii_propertiesObject



81
82
83
84
85
86
87
88
89
90
91
# File 'bedrock_agent_core/online_evaluation_base_props.rb', line 81

def self.jsii_properties
  {
    :online_evaluation_config_name => "onlineEvaluationConfigName",
    :description => "description",
    :execution_role => "executionRole",
    :execution_status => "executionStatus",
    :filters => "filters",
    :sampling_percentage => "samplingPercentage",
    :session_timeout => "sessionTimeout",
  }
end

Instance Method Details

#to_jsiiObject



93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'bedrock_agent_core/online_evaluation_base_props.rb', line 93

def to_jsii
  result = {}
  result.merge!({
    "onlineEvaluationConfigName" => @online_evaluation_config_name,
    "description" => @description,
    "executionRole" => @execution_role,
    "executionStatus" => @execution_status,
    "filters" => @filters,
    "samplingPercentage" => @sampling_percentage,
    "sessionTimeout" => @session_timeout,
  })
  result.compact
end