Class: AWSCDK::Bedrock::CfnFlow::PromptModelInferenceConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_flow.rb

Overview

Contains inference configurations related to model inference for a prompt.

For more information, see Inference parameters .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_tokens: nil, stop_sequences: nil, temperature: nil, top_p: nil) ⇒ PromptModelInferenceConfigurationProperty

Returns a new instance of PromptModelInferenceConfigurationProperty.

Parameters:

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

    The maximum number of tokens to return in the response.

  • stop_sequences (Array<String>, nil) (defaults to: nil)

    A list of strings that define sequences after which the model will stop generating.

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

    Controls the randomness of the response.

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

    The percentage of most-likely candidates that the model considers for the next token.



2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
# File 'bedrock/cfn_flow.rb', line 2331

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_tokensNumeric? (readonly)

The maximum number of tokens to return in the response.



2346
2347
2348
# File 'bedrock/cfn_flow.rb', line 2346

def max_tokens
  @max_tokens
end

#stop_sequencesArray<String>? (readonly)

A list of strings that define sequences after which the model will stop generating.



2351
2352
2353
# File 'bedrock/cfn_flow.rb', line 2351

def stop_sequences
  @stop_sequences
end

#temperatureNumeric? (readonly)

Controls the randomness of the response.

Choose a lower value for more predictable outputs and a higher value for more surprising outputs.



2358
2359
2360
# File 'bedrock/cfn_flow.rb', line 2358

def temperature
  @temperature
end

#top_pNumeric? (readonly)

The percentage of most-likely candidates that the model considers for the next token.



2363
2364
2365
# File 'bedrock/cfn_flow.rb', line 2363

def top_p
  @top_p
end

Class Method Details

.jsii_propertiesObject



2365
2366
2367
2368
2369
2370
2371
2372
# File 'bedrock/cfn_flow.rb', line 2365

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

Instance Method Details

#to_jsiiObject



2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
# File 'bedrock/cfn_flow.rb', line 2374

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