Generation config.
stopSequences[]string
Optional. Stop sequences.
responseMimeTypestring
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.
Optional. The modalities of the response.
Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.
Optional. Config for model selection.
temperaturenumber
Optional. Controls the randomness of predictions.
topPnumber
Optional. If specified, nucleus sampling will be used.
topKnumber
Optional. If specified, top-k sampling will be used.
candidateCountinteger
Optional. Number of candidates to generate.
maxOutputTokensinteger
Optional. The maximum number of output tokens to generate per message.
responseLogprobsboolean
Optional. If true, export the logprobs results in response.
logprobsinteger
Optional. Logit probabilities.
presencePenaltynumber
Optional. Positive penalties.
frequencyPenaltynumber
Optional. Frequency penalties.
seedinteger
Optional. Seed.
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 responseMimeType must also be set. Compatible mimetypes: application/json: Schema for JSON response.
Optional. Output schema of the generated response. This is an alternative to responseSchema that accepts JSON Schema.
If set, responseSchema must be omitted, but responseMimeType is required.
While the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported:
$id$defs$ref$anchortypeformattitledescriptionenum(for strings and numbers)itemsprefixItemsminItemsmaxItemsminimummaximumanyOfoneOf(interpreted the same asanyOf)propertiesadditionalPropertiesrequired
The non-standard propertyOrdering property may also be set.
Cyclic references are unrolled to a limited degree and, as such, may only be used within non-required properties. (Nullable properties are not sufficient.) If $ref is set on a sub-schema, no other properties, except for than those starting as a $, may be set.
Optional. Routing configuration.
audioTimestampboolean
Optional. If enabled, audio timestamp will be included in the request to the model.
Optional. If specified, the media resolution specified will be used.
Optional. The speech generation config.
enableAffectiveDialogboolean
Optional. If enabled, the model will detect emotions and adapt its responses accordingly.
Optional. Config for image generation features.
| JSON representation |
|---|
{ "stopSequences": [ string ], "responseMimeType": string, "responseModalities": [ enum ( |
RoutingConfig
The configuration for routing the request to a specific model.
routing_configUnion type
routing_config can be only one of the following:Automated routing.
Manual routing.
| JSON representation |
|---|
{ // routing_config "autoMode": { object ( |
AutoRoutingMode
When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
The model routing preference.
| JSON representation |
|---|
{
"modelRoutingPreference": enum ( |
ModelRoutingPreference
The model routing preference.
| Enums | |
|---|---|
UNKNOWN |
Unspecified model routing preference. |
PRIORITIZE_QUALITY |
Prefer higher quality over low cost. |
BALANCED |
Balanced model routing preference. |
PRIORITIZE_COST |
Prefer lower cost over higher quality. |
ManualRoutingMode
When manual routing is set, the specified model will be used directly.
modelNamestring
The model name to use. Only the public LLM models are accepted. See Supported models.
| JSON representation |
|---|
{ "modelName": string } |
Modality
The modalities of the response.
| Enums | |
|---|---|
MODALITY_UNSPECIFIED |
Unspecified modality. Will be processed as text. |
TEXT |
Text modality. |
IMAGE |
Image modality. |
AUDIO |
Audio modality. |
MediaResolution
Media resolution for the input media.
| Enums | |
|---|---|
MEDIA_RESOLUTION_UNSPECIFIED |
Media resolution has not been set. |
MEDIA_RESOLUTION_LOW |
Media resolution set to low (64 tokens). |
MEDIA_RESOLUTION_MEDIUM |
Media resolution set to medium (256 tokens). |
MEDIA_RESOLUTION_HIGH |
Media resolution set to high (zoomed reframing with 256 tokens). |
SpeechConfig
The speech generation config.
The configuration for the speaker to use.
languageCodestring
Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization.
The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with voiceConfig.
| JSON representation |
|---|
{ "voiceConfig": { object ( |
VoiceConfig
The configuration for the voice to use.
voice_configUnion type
voice_config can be only one of the following:The configuration for the prebuilt voice to use.
| JSON representation |
|---|
{
// voice_config
"prebuiltVoiceConfig": {
object ( |
PrebuiltVoiceConfig
The configuration for the prebuilt speaker to use.
voiceNamestring
The name of the preset voice to use.
| JSON representation |
|---|
{ "voiceName": string } |
MultiSpeakerVoiceConfig
Configuration for a multi-speaker text-to-speech setup. Enables the use of up to two distinct voices in a single synthesis request.
Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.
| JSON representation |
|---|
{
"speakerVoiceConfigs": [
{
object ( |
SpeakerVoiceConfig
Configuration for a single speaker in a multi speaker setup.
speakerstring
Required. The name of the speaker. This should be the same as the speaker name used in the prompt.
Required. The configuration for the voice of this speaker.
| JSON representation |
|---|
{
"speaker": string,
"voiceConfig": {
object ( |
ThinkingConfig
Config for thinking features.
includeThoughtsboolean
Optional. Indicates whether to include thoughts in the response. If true, thoughts are returned only when available.
thinkingBudgetinteger
Optional. Indicates the thinking budget in tokens.
| JSON representation |
|---|
{ "includeThoughts": boolean, "thinkingBudget": integer } |
ModelConfig
Config for model selection.
Required. feature selection preference.
| JSON representation |
|---|
{
"featureSelectionPreference": enum ( |
FeatureSelectionPreference
Options for feature selection preference.
| Enums | |
|---|---|
FEATURE_SELECTION_PREFERENCE_UNSPECIFIED |
Unspecified feature selection preference. |
PRIORITIZE_QUALITY |
Prefer higher quality over lower cost. |
BALANCED |
Balanced feature selection preference. |
PRIORITIZE_COST |
Prefer lower cost over higher quality. |
ImageConfig
Config for image generation features.
Optional. The image output format for generated images.
aspectRatiostring
Optional. The desired aspect ratio for the generated images. The following aspect ratios are supported:
"1:1" "2:3", "3:2" "3:4", "4:3" "4:5", "5:4" "9:16", "16:9" "21:9"
Optional. Controls whether the model can generate people.
| JSON representation |
|---|
{ "imageOutputOptions": { object ( |
ImageOutputOptions
The image output format for generated images.
mimeTypestring
Optional. The image format that the output should be saved as.
compressionQualityinteger
Optional. The compression quality of the output image.
| JSON representation |
|---|
{ "mimeType": string, "compressionQuality": integer } |
PersonGeneration
Enum that controls the generation of people.
| Enums | |
|---|---|
PERSON_GENERATION_UNSPECIFIED |
Generation images of people unspecified. |
ALLOW_ALL |
Generate images that include adults and children. |
ALLOW_ADULT |
Generate images of adults, but not children. |
ALLOW_NONE |
Block generation of images of people. |