Class: AWSCDK::Bedrock::CfnPromptVersion::PromptModelInferenceConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_prompt_version.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.



985
986
987
988
989
990
991
992
993
994
# File 'bedrock/cfn_prompt_version.rb', line 985

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.



1000
1001
1002
# File 'bedrock/cfn_prompt_version.rb', line 1000

def max_tokens
  @max_tokens
end

#stop_sequencesArray<String>? (readonly)

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



1005
1006
1007
# File 'bedrock/cfn_prompt_version.rb', line 1005

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.



1012
1013
1014
# File 'bedrock/cfn_prompt_version.rb', line 1012

def temperature
  @temperature
end

#top_pNumeric? (readonly)

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



1017
1018
1019
# File 'bedrock/cfn_prompt_version.rb', line 1017

def top_p
  @top_p
end

Class Method Details

.jsii_propertiesObject



1019
1020
1021
1022
1023
1024
1025
1026
# File 'bedrock/cfn_prompt_version.rb', line 1019

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

Instance Method Details

#to_jsiiObject



1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
# File 'bedrock/cfn_prompt_version.rb', line 1028

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