Class: AWSCDK::BedrockAgentCore::EvaluatorInferenceConfig

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

Overview

Inference configuration for a custom LLM-as-a-Judge evaluator.

Controls how the foundation model generates evaluation responses.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_tokens: nil, temperature: nil, top_p: nil) ⇒ EvaluatorInferenceConfig

Returns a new instance of EvaluatorInferenceConfig.

Parameters:

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

    The maximum number of tokens to generate in the model response.

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

    The temperature value that controls randomness in the model's responses.

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

    The top-p sampling parameter that controls the diversity of the model's responses.



12
13
14
15
16
17
18
19
# File 'bedrock_agent_core/evaluator_inference_config.rb', line 12

def initialize(max_tokens: nil, temperature: nil, top_p: nil)
  @max_tokens = max_tokens
  Jsii::Type.check_type(@max_tokens, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxTokens") unless @max_tokens.nil?
  @temperature = temperature
  Jsii::Type.check_type(@temperature, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "temperature") unless @temperature.nil?
  @top_p = top_p
  Jsii::Type.check_type(@top_p, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "topP") unless @top_p.nil?
end

Instance Attribute Details

#max_tokensNumeric? (readonly)

Note:

Default: - The foundation model's default maximum token limit is used

The maximum number of tokens to generate in the model response.

Returns:

  • (Numeric, nil)


25
26
27
# File 'bedrock_agent_core/evaluator_inference_config.rb', line 25

def max_tokens
  @max_tokens
end

#temperatureNumeric? (readonly)

Note:

Default: - The foundation model's default temperature is used

The temperature value that controls randomness in the model's responses.

Higher values produce more diverse outputs. Range: 0.0 to 1.0.

Returns:

  • (Numeric, nil)


32
33
34
# File 'bedrock_agent_core/evaluator_inference_config.rb', line 32

def temperature
  @temperature
end

#top_pNumeric? (readonly)

Note:

Default: - The foundation model's default top-p value is used

The top-p sampling parameter that controls the diversity of the model's responses.

Range: 0.0 to 1.0.

Returns:

  • (Numeric, nil)


39
40
41
# File 'bedrock_agent_core/evaluator_inference_config.rb', line 39

def top_p
  @top_p
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
# File 'bedrock_agent_core/evaluator_inference_config.rb', line 41

def self.jsii_properties
  {
    :max_tokens => "maxTokens",
    :temperature => "temperature",
    :top_p => "topP",
  }
end

Instance Method Details

#to_jsiiObject



49
50
51
52
53
54
55
56
57
# File 'bedrock_agent_core/evaluator_inference_config.rb', line 49

def to_jsii
  result = {}
  result.merge!({
    "maxTokens" => @max_tokens,
    "temperature" => @temperature,
    "topP" => @top_p,
  })
  result.compact
end