Class: AWSCDK::BedrockAgentCore::EvaluatorProps

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

Overview

Properties for creating an Evaluator.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(evaluator_config:, evaluator_name:, level:, description: nil, tags: nil) ⇒ EvaluatorProps

Returns a new instance of EvaluatorProps.

Parameters:

  • evaluator_config (AWSCDK::BedrockAgentCore::EvaluatorConfig)

    The configuration that defines how the evaluator assesses agent performance.

  • evaluator_name (String)

    The name of the evaluator.

  • level (AWSCDK::BedrockAgentCore::EvaluationLevel)

    The level at which the evaluator assesses agent performance.

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

    The description of the evaluator.

  • tags (Hash{String => String}, nil) (defaults to: nil)

    Tags for the evaluator.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'bedrock_agent_core/evaluator_props.rb', line 12

def initialize(evaluator_config:, evaluator_name:, level:, description: nil, tags: nil)
  @evaluator_config = evaluator_config
  Jsii::Type.check_type(@evaluator_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5FdmFsdWF0b3JDb25maWcifQ==")), "evaluatorConfig")
  @evaluator_name = evaluator_name
  Jsii::Type.check_type(@evaluator_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "evaluatorName")
  @level = level
  Jsii::Type.check_type(@level, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9ja2FnZW50Y29yZS5FdmFsdWF0aW9uTGV2ZWwifQ==")), "level")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @tags = tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "tags") unless @tags.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

Note:

Default: - No description

The description of the evaluator.

Returns:

  • (String, nil)


50
51
52
# File 'bedrock_agent_core/evaluator_props.rb', line 50

def description
  @description
end

#evaluator_configAWSCDK::BedrockAgentCore::EvaluatorConfig (readonly)

The configuration that defines how the evaluator assesses agent performance.

Use EvaluatorConfig.llmAsAJudge() for model-based evaluation or EvaluatorConfig.codeBased() for Lambda-based evaluation.



31
32
33
# File 'bedrock_agent_core/evaluator_props.rb', line 31

def evaluator_config
  @evaluator_config
end

#evaluator_nameString (readonly)

The name of the evaluator.

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)


38
39
40
# File 'bedrock_agent_core/evaluator_props.rb', line 38

def evaluator_name
  @evaluator_name
end

#levelAWSCDK::BedrockAgentCore::EvaluationLevel (readonly)

The level at which the evaluator assesses agent performance.

Determines what granularity of data the evaluator operates on: tool call, trace (single request-response), or session (full conversation).



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

def level
  @level
end

#tagsHash{String => String}? (readonly)

Note:

Default: - No tags

Tags for the evaluator.

A list of key:value pairs of tags to apply to this Evaluator resource.

Returns:

  • (Hash{String => String}, nil)


57
58
59
# File 'bedrock_agent_core/evaluator_props.rb', line 57

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



59
60
61
62
63
64
65
66
67
# File 'bedrock_agent_core/evaluator_props.rb', line 59

def self.jsii_properties
  {
    :evaluator_config => "evaluatorConfig",
    :evaluator_name => "evaluatorName",
    :level => "level",
    :description => "description",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



69
70
71
72
73
74
75
76
77
78
79
# File 'bedrock_agent_core/evaluator_props.rb', line 69

def to_jsii
  result = {}
  result.merge!({
    "evaluatorConfig" => @evaluator_config,
    "evaluatorName" => @evaluator_name,
    "level" => @level,
    "description" => @description,
    "tags" => @tags,
  })
  result.compact
end