Class: Google::Apis::FirebasemlV2beta::GenerationConfig

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/firebaseml_v2beta/classes.rb,
lib/google/apis/firebaseml_v2beta/representations.rb,
lib/google/apis/firebaseml_v2beta/representations.rb

Overview

Generation config.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GenerationConfig

Returns a new instance of GenerationConfig.



634
635
636
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 634

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#candidate_countFixnum

Optional. Number of candidates to generate. Corresponds to the JSON property candidateCount

Returns:

  • (Fixnum)


581
582
583
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 581

def candidate_count
  @candidate_count
end

#frequency_penaltyFloat

Optional. Frequency penalties. Corresponds to the JSON property frequencyPenalty

Returns:

  • (Float)


586
587
588
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 586

def frequency_penalty
  @frequency_penalty
end

#max_output_tokensFixnum

Optional. The maximum number of output tokens to generate per message. Corresponds to the JSON property maxOutputTokens

Returns:

  • (Fixnum)


591
592
593
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 591

def max_output_tokens
  @max_output_tokens
end

#presence_penaltyFloat

Optional. Positive penalties. Corresponds to the JSON property presencePenalty

Returns:

  • (Float)


596
597
598
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 596

def presence_penalty
  @presence_penalty
end

#response_mime_typeString

Optional. Output response mimetype of the generated candidate text. Supported mimetype: - text/plain: (default) Text output. - application/json: JSON response in the candidates. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature. Corresponds to the JSON property responseMimeType

Returns:

  • (String)


605
606
607
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 605

def response_mime_type
  @response_mime_type
end

#response_schemaGoogle::Apis::FirebasemlV2beta::Schema

Schema is used to define the format of input/output data. Represents a select subset of an OpenAPI 3.0 schema object. More fields may be added in the future as needed. Corresponds to the JSON property responseSchema



612
613
614
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 612

def response_schema
  @response_schema
end

#stop_sequencesArray<String>

Optional. Stop sequences. Corresponds to the JSON property stopSequences

Returns:

  • (Array<String>)


617
618
619
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 617

def stop_sequences
  @stop_sequences
end

#temperatureFloat

Optional. Controls the randomness of predictions. Corresponds to the JSON property temperature

Returns:

  • (Float)


622
623
624
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 622

def temperature
  @temperature
end

#top_kFloat

Optional. If specified, top-k sampling will be used. Corresponds to the JSON property topK

Returns:

  • (Float)


627
628
629
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 627

def top_k
  @top_k
end

#top_pFloat

Optional. If specified, nucleus sampling will be used. Corresponds to the JSON property topP

Returns:

  • (Float)


632
633
634
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 632

def top_p
  @top_p
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



639
640
641
642
643
644
645
646
647
648
649
650
# File 'lib/google/apis/firebaseml_v2beta/classes.rb', line 639

def update!(**args)
  @candidate_count = args[:candidate_count] if args.key?(:candidate_count)
  @frequency_penalty = args[:frequency_penalty] if args.key?(:frequency_penalty)
  @max_output_tokens = args[:max_output_tokens] if args.key?(:max_output_tokens)
  @presence_penalty = args[:presence_penalty] if args.key?(:presence_penalty)
  @response_mime_type = args[:response_mime_type] if args.key?(:response_mime_type)
  @response_schema = args[:response_schema] if args.key?(:response_schema)
  @stop_sequences = args[:stop_sequences] if args.key?(:stop_sequences)
  @temperature = args[:temperature] if args.key?(:temperature)
  @top_k = args[:top_k] if args.key?(:top_k)
  @top_p = args[:top_p] if args.key?(:top_p)
end