Starting April 29, 2025, Gemini 1.5 Pro and Gemini 1.5 Flash models are not available in projects that have no prior usage of these models, including new projects. For details, see Model versions and lifecycle.
Stay organized with collections
Save and categorize content based on your preferences.
Generation config.
Fields
stopSequences[]
string
Optional. Stop sequences.
responseMimeType
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.
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
$anchor
type
format
title
description
enum (for strings and numbers)
items
prefixItems
minItems
maxItems
minimum
maximum
anyOf
oneOf (interpreted the same as anyOf)
properties
additionalProperties
required
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-27 UTC."],[],[],null,["# GenerationConfig\n\nGeneration config.\nFields `stopSequences[]` `string` \nOptional. Stop sequences.\n`responseMimeType` `string` \nOptional. 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.\n`responseModalities[]` `enum (`[Modality](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#Modality)`)` \nOptional. The modalities of the response.\n`thinkingConfig` `object (`[ThinkingConfig](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#ThinkingConfig)`)` \nOptional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.\n`modelConfig` `object (`[ModelConfig](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#ModelConfig)`)` \nOptional. Config for model selection.\n`temperature` `number` \nOptional. Controls the randomness of predictions.\n`topP` `number` \nOptional. If specified, nucleus sampling will be used.\n`topK` `number` \nOptional. If specified, top-k sampling will be used.\n`candidateCount` `integer` \nOptional. Number of candidates to generate.\n`maxOutputTokens` `integer` \nOptional. The maximum number of output tokens to generate per message.\n`responseLogprobs` `boolean` \nOptional. If true, export the logprobs results in response.\n`logprobs` `integer` \nOptional. Logit probabilities.\n`presencePenalty` `number` \nOptional. Positive penalties.\n`frequencyPenalty` `number` \nOptional. Frequency penalties.\n`seed` `integer` \nOptional. Seed.\n`responseSchema` `object (`[Schema](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/FunctionDeclaration#Schema)`)` \nOptional. 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](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible responseMimeType must also be set. Compatible mimetypes: `application/json`: Schema for JSON response.\n`responseJsonSchema` `value (`[Value](https://protobuf.dev/reference/protobuf/google.protobuf/#value)` format)` \nOptional. Output schema of the generated response. This is an alternative to `responseSchema` that accepts [JSON Schema](https://json-schema.org/).\n\nIf set, `responseSchema` must be omitted, but `responseMimeType` is required.\n\nWhile the full JSON Schema may be sent, not all features are supported. Specifically, only the following properties are supported:\n\n- `$id`\n- `$defs`\n- `$ref`\n- `$anchor`\n- `type`\n- `format`\n- `title`\n- `description`\n- `enum` (for strings and numbers)\n- `items`\n- `prefixItems`\n- `minItems`\n- `maxItems`\n- `minimum`\n- `maximum`\n- `anyOf`\n- `oneOf` (interpreted the same as `anyOf`)\n- `properties`\n- `additionalProperties`\n- `required`\n\nThe non-standard `propertyOrdering` property may also be set.\n\nCyclic 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.\n`routingConfig` `object (`[RoutingConfig](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#RoutingConfig)`)` \nOptional. Routing configuration.\n`audioTimestamp` `boolean` \nOptional. If enabled, audio timestamp will be included in the request to the model.\n`mediaResolution` `enum (`[MediaResolution](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#MediaResolution)`)` \nOptional. If specified, the media resolution specified will be used.\n`speechConfig` `object (`[SpeechConfig](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#SpeechConfig)`)` \nOptional. The speech generation config.\n`enableAffectiveDialog` `boolean` \nOptional. If enabled, the model will detect emotions and adapt its responses accordingly. \n\nRoutingConfig\n-------------\n\nThe configuration for routing the request to a specific model.\nFields \n`routing_config` `Union type` \nRouting mode. `routing_config` can be only one of the following:\n`autoMode` `object (`[AutoRoutingMode](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#AutoRoutingMode)`)` \nAutomated routing.\n`manualMode` `object (`[ManualRoutingMode](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#ManualRoutingMode)`)` \nManual routing. \n\nAutoRoutingMode\n---------------\n\nWhen automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.\nFields `modelRoutingPreference` `enum (`[ModelRoutingPreference](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#ModelRoutingPreference)`)` \nThe model routing preference. \n\nModelRoutingPreference\n----------------------\n\nThe model routing preference.\n\nManualRoutingMode\n-----------------\n\nWhen manual routing is set, the specified model will be used directly.\nFields `modelName` `string` \nThe model name to use. Only the public LLM models are accepted. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models). \n\nModality\n--------\n\nThe modalities of the response.\n\nMediaResolution\n---------------\n\nMedia resolution for the input media.\n\nSpeechConfig\n------------\n\nThe speech generation config.\nFields `voiceConfig` `object (`[VoiceConfig](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#VoiceConfig)`)` \nThe configuration for the speaker to use.\n`languageCode` `string` \nOptional. Language code (ISO 639. e.g. en-US) for the speech synthesization. \n\nVoiceConfig\n-----------\n\nThe configuration for the voice to use.\nFields \n`voice_config` `Union type` \nThe configuration for the speaker to use. `voice_config` can be only one of the following:\n`prebuiltVoiceConfig` `object (`[PrebuiltVoiceConfig](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#PrebuiltVoiceConfig)`)` \nThe configuration for the prebuilt voice to use. \n\nPrebuiltVoiceConfig\n-------------------\n\nThe configuration for the prebuilt speaker to use.\nFields `voiceName` `string` \nThe name of the preset voice to use. \n\nThinkingConfig\n--------------\n\nConfig for thinking features.\nFields `includeThoughts` `boolean` \nOptional. Indicates whether to include thoughts in the response. If true, thoughts are returned only when available.\n`thinkingBudget` `integer` \nOptional. Indicates the thinking budget in tokens. \n\nModelConfig\n-----------\n\nConfig for model selection.\nFields `featureSelectionPreference` `enum (`[FeatureSelectionPreference](/vertex-ai/generative-ai/docs/reference/rest/v1beta1/GenerationConfig#FeatureSelectionPreference)`)` \nRequired. feature selection preference. \n\nFeatureSelectionPreference\n--------------------------\n\nOptions for feature selection preference."]]