Google Cloud Ai Platform V1 Client - Class GenerationConfig (1.5.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
Name Description
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.

↳ presence_penalty float

Optional. Positive penalties.

↳ frequency_penalty float

Optional. Frequency penalties.

↳ seed int

Optional. Seed.

↳ response_mime_type string

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.

↳ response_schema Google\Cloud\AIPlatform\V1\Schema

Optional. The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an OpenAPI 3.0 schema object. If set, a compatible response_mime_type must also be set. Compatible mimetypes: application/json: Schema for JSON response.

↳ routing_config Google\Cloud\AIPlatform\V1\GenerationConfig\RoutingConfig

Optional. Routing configuration.

getTemperature

Optional. Controls the randomness of predictions.

Returns
Type Description
float

hasTemperature

clearTemperature

setTemperature

Optional. Controls the randomness of predictions.

Parameter
Name Description
var float
Returns
Type Description
$this

getTopP

Optional. If specified, nucleus sampling will be used.

Returns
Type Description
float

hasTopP

clearTopP

setTopP

Optional. If specified, nucleus sampling will be used.

Parameter
Name Description
var float
Returns
Type Description
$this

getTopK

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

Returns
Type Description
float

hasTopK

clearTopK

setTopK

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

Parameter
Name Description
var float
Returns
Type Description
$this

getCandidateCount

Optional. Number of candidates to generate.

Returns
Type Description
int

hasCandidateCount

clearCandidateCount

setCandidateCount

Optional. Number of candidates to generate.

Parameter
Name Description
var int
Returns
Type Description
$this

getMaxOutputTokens

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

Returns
Type Description
int

hasMaxOutputTokens

clearMaxOutputTokens

setMaxOutputTokens

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

Parameter
Name Description
var int
Returns
Type Description
$this

getStopSequences

Optional. Stop sequences.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setStopSequences

Optional. Stop sequences.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getPresencePenalty

Optional. Positive penalties.

Returns
Type Description
float

hasPresencePenalty

clearPresencePenalty

setPresencePenalty

Optional. Positive penalties.

Parameter
Name Description
var float
Returns
Type Description
$this

getFrequencyPenalty

Optional. Frequency penalties.

Returns
Type Description
float

hasFrequencyPenalty

clearFrequencyPenalty

setFrequencyPenalty

Optional. Frequency penalties.

Parameter
Name Description
var float
Returns
Type Description
$this

getSeed

Optional. Seed.

Returns
Type Description
int

hasSeed

clearSeed

setSeed

Optional. Seed.

Parameter
Name Description
var int
Returns
Type Description
$this

getResponseMimeType

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.
Returns
Type Description
string

setResponseMimeType

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.
Parameter
Name Description
var string
Returns
Type Description
$this

getResponseSchema

Optional. The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.

Represents a select subset of an OpenAPI 3.0 schema object. If set, a compatible response_mime_type must also be set. Compatible mimetypes: application/json: Schema for JSON response.

Returns
Type Description
Google\Cloud\AIPlatform\V1\Schema|null

hasResponseSchema

clearResponseSchema

setResponseSchema

Optional. The Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays.

Represents a select subset of an OpenAPI 3.0 schema object. If set, a compatible response_mime_type must also be set. Compatible mimetypes: application/json: Schema for JSON response.

Parameter
Name Description
var Google\Cloud\AIPlatform\V1\Schema
Returns
Type Description
$this

getRoutingConfig

Optional. Routing configuration.

Returns
Type Description
Google\Cloud\AIPlatform\V1\GenerationConfig\RoutingConfig|null

hasRoutingConfig

clearRoutingConfig

setRoutingConfig

Optional. Routing configuration.

Parameter
Name Description
var Google\Cloud\AIPlatform\V1\GenerationConfig\RoutingConfig
Returns
Type Description
$this