Class GenerationConfig (1.48.0)

GenerationConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Attributes

NameDescription
temperature float
Optional. Controls the randomness of predictions. This field is a member of oneof_ _temperature.
top_p float
Optional. If specified, nucleus sampling will be used. This field is a member of oneof_ _top_p.
top_k float
Optional. If specified, top-k sampling will be used. This field is a member of oneof_ _top_k.
candidate_count int
Optional. Number of candidates to generate. This field is a member of oneof_ _candidate_count.
max_output_tokens int
Optional. The maximum number of output tokens to generate per message. This field is a member of oneof_ _max_output_tokens.
stop_sequences MutableSequence[str]
Optional. Stop sequences.
presence_penalty float
Optional. Positive penalties. This field is a member of oneof_ _presence_penalty.
frequency_penalty float
Optional. Frequency penalties. This field is a member of oneof_ _frequency_penalty.
response_mime_type str
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.

Methods

GenerationConfig

GenerationConfig(mapping=None, *, ignore_unknown_fields=False, **kwargs)