Class: AWSCDK::BedrockAgentCore::CfnEvaluator::InferenceConfigurationProperty

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

Overview

The inference configuration parameters that control model behavior during evaluation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of InferenceConfigurationProperty.

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.



818
819
820
821
822
823
824
825
# File 'bedrock_agent_core/cfn_evaluator.rb', line 818

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)

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



831
832
833
# File 'bedrock_agent_core/cfn_evaluator.rb', line 831

def max_tokens
  @max_tokens
end

#temperatureNumeric? (readonly)

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



836
837
838
# File 'bedrock_agent_core/cfn_evaluator.rb', line 836

def temperature
  @temperature
end

#top_pNumeric? (readonly)

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



841
842
843
# File 'bedrock_agent_core/cfn_evaluator.rb', line 841

def top_p
  @top_p
end

Class Method Details

.jsii_propertiesObject



843
844
845
846
847
848
849
# File 'bedrock_agent_core/cfn_evaluator.rb', line 843

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

Instance Method Details

#to_jsiiObject



851
852
853
854
855
856
857
858
859
# File 'bedrock_agent_core/cfn_evaluator.rb', line 851

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