Google Cloud Ai Platform V1 Client - Class GenerationConfig (0.32.0)

Reference documentation and code samples for the Google Cloud Ai Platform V1 Client class GenerationConfig.

Generation config.

Generated from protobuf message google.cloud.aiplatform.v1.GenerationConfig

Namespace

Google \ Cloud \ AIPlatform \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ temperature float

Optional. Controls the randomness of predictions.

↳ top_p float

Optional. If specified, nucleus sampling will be used.

↳ top_k float

Optional. If specified, top-k sampling will be used.

↳ candidate_count int

Optional. Number of candidates to generate.

↳ max_output_tokens int

Optional. The maximum number of output tokens to generate per message.

↳ stop_sequences array

Optional. Stop sequences.

getTemperature

Optional. Controls the randomness of predictions.

Returns
TypeDescription
float

hasTemperature

clearTemperature

setTemperature

Optional. Controls the randomness of predictions.

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getTopP

Optional. If specified, nucleus sampling will be used.

Returns
TypeDescription
float

hasTopP

clearTopP

setTopP

Optional. If specified, nucleus sampling will be used.

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getTopK

Optional. If specified, top-k sampling will be used.

Returns
TypeDescription
float

hasTopK

clearTopK

setTopK

Optional. If specified, top-k sampling will be used.

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getCandidateCount

Optional. Number of candidates to generate.

Returns
TypeDescription
int

hasCandidateCount

clearCandidateCount

setCandidateCount

Optional. Number of candidates to generate.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getMaxOutputTokens

Optional. The maximum number of output tokens to generate per message.

Returns
TypeDescription
int

hasMaxOutputTokens

clearMaxOutputTokens

setMaxOutputTokens

Optional. The maximum number of output tokens to generate per message.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getStopSequences

Optional. Stop sequences.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setStopSequences

Optional. Stop sequences.

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this