Class: AWSCDK::Bedrock::CfnFlowVersion::PromptModelInferenceConfigurationProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Bedrock::CfnFlowVersion::PromptModelInferenceConfigurationProperty
- Defined in:
- bedrock/cfn_flow_version.rb
Overview
Contains inference configurations related to model inference for a prompt.
For more information, see Inference parameters .
Instance Attribute Summary collapse
-
#max_tokens ⇒ Numeric?
readonly
The maximum number of tokens to return in the response.
-
#stop_sequences ⇒ Array<String>?
readonly
A list of strings that define sequences after which the model will stop generating.
-
#temperature ⇒ Numeric?
readonly
Controls the randomness of the response.
-
#top_p ⇒ Numeric?
readonly
The percentage of most-likely candidates that the model considers for the next token.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(max_tokens: nil, stop_sequences: nil, temperature: nil, top_p: nil) ⇒ PromptModelInferenceConfigurationProperty
constructor
A new instance of PromptModelInferenceConfigurationProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(max_tokens: nil, stop_sequences: nil, temperature: nil, top_p: nil) ⇒ PromptModelInferenceConfigurationProperty
Returns a new instance of PromptModelInferenceConfigurationProperty.
2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 |
# File 'bedrock/cfn_flow_version.rb', line 2152 def initialize(max_tokens: nil, stop_sequences: 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? @stop_sequences = stop_sequences Jsii::Type.check_type(@stop_sequences, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "stopSequences") unless @stop_sequences.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_tokens ⇒ Numeric? (readonly)
The maximum number of tokens to return in the response.
2167 2168 2169 |
# File 'bedrock/cfn_flow_version.rb', line 2167 def max_tokens @max_tokens end |
#stop_sequences ⇒ Array<String>? (readonly)
A list of strings that define sequences after which the model will stop generating.
2172 2173 2174 |
# File 'bedrock/cfn_flow_version.rb', line 2172 def stop_sequences @stop_sequences end |
#temperature ⇒ Numeric? (readonly)
Controls the randomness of the response.
Choose a lower value for more predictable outputs and a higher value for more surprising outputs.
2179 2180 2181 |
# File 'bedrock/cfn_flow_version.rb', line 2179 def temperature @temperature end |
#top_p ⇒ Numeric? (readonly)
The percentage of most-likely candidates that the model considers for the next token.
2184 2185 2186 |
# File 'bedrock/cfn_flow_version.rb', line 2184 def top_p @top_p end |
Class Method Details
.jsii_properties ⇒ Object
2186 2187 2188 2189 2190 2191 2192 2193 |
# File 'bedrock/cfn_flow_version.rb', line 2186 def self.jsii_properties { :max_tokens => "maxTokens", :stop_sequences => "stopSequences", :temperature => "temperature", :top_p => "topP", } end |
Instance Method Details
#to_jsii ⇒ Object
2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 |
# File 'bedrock/cfn_flow_version.rb', line 2195 def to_jsii result = {} result.merge!({ "maxTokens" => @max_tokens, "stopSequences" => @stop_sequences, "temperature" => @temperature, "topP" => @top_p, }) result.compact end |