Configuration for content generation.
This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output.
stopSequences[]string
                  
                Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use ["\n", "###"] to stop generation at a new line or a specific marker.
responseMimeTypestring
                  
                Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include 'text/plain' (default) and 'application/json'. 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. The model will generate a response that includes all the specified modalities. For example, if this is set to [TEXT, IMAGE], the response will include both text and an image.
Optional. Configuration 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 the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0].
topPnumber
                  
                Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least topP. This helps generate more diverse and less repetitive responses. For example, a topP of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It's recommended to adjust either temperature or topP, but not both.
topKnumber
                  
                Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a topK of 40 means the model will choose the next word from the 40 most likely words.
candidateCountinteger
                  
                Optional. The number of candidate responses to generate.
A higher candidateCount can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one.
maxOutputTokensinteger
                  
                Optional. The maximum number of tokens to generate in the response.
A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses.
responseLogprobsboolean
                  
                Optional. If set to true, the log probabilities of the output tokens are returned.
log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model's confidence in its own output and for debugging.
logprobsinteger
                  
                Optional. The number of top log probabilities to return for each token.
This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response.
presencePenaltynumber
                  
                Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0].
frequencyPenaltynumber
                  
                Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0].
seedinteger
                  
                Optional. A seed for the random number generator.
By setting a seed, you can make the model's output mostly deterministic. For a given prompt and parameters (like temperature, topP, etc.), the model will produce the same response every time. However, it's not a guaranteed absolute deterministic behavior. This is different from parameters like temperature, which control the level of randomness. seed ensures that the "random" choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results.
Optional. Lets you to specify a schema for the model's response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the OpenAPI 3.0 schema object object.
When this field is set, you must also set the responseMimeType to application/json.
Optional. When this field is set, responseSchema must be omitted and responseMimeType must be set to application/json.
Optional. Routing configuration.
audioTimestampboolean
                  
                Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response.
Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model.
Optional. The speech generation config.
enableAffectiveDialogboolean
                  
                Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response.
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. This can be used to control which model is used for the generation, either automatically or by specifying a model name.
routing_configUnion type
                  
                routing_config can be only one of the following:In this mode, the model is selected automatically based on the content of the request.
In this mode, the model is specified manually.
| JSON representation | 
|---|
| { // routing_config "autoMode": { object ( | 
AutoRoutingMode
The configuration for automated routing.
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 | The model will be selected to prioritize the quality of the response. | 
| BALANCED | The model will be selected to balance quality and cost. | 
| PRIORITIZE_COST | The model will be selected to prioritize the cost of the request. | 
ManualRoutingMode
The configuration for manual routing.
When manual routing is specified, the model will be selected based on the model name provided.
modelNamestring
                  
                The name of the model to use. Only public LLM models are accepted.
| 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
Configuration for speech generation.
The configuration for the voice to use.
languageCodestring
                  
                Optional. The language code (ISO 639-1) for the speech synthesis.
The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with voiceConfig.
| JSON representation | 
|---|
| { "voiceConfig": { object ( | 
VoiceConfig
Configuration for a voice.
voice_configUnion type
                  
                voice_config can be only one of the following:The configuration for a prebuilt voice.
| JSON representation | 
|---|
| {
  // voice_config
  "prebuiltVoiceConfig": {
    object ( | 
PrebuiltVoiceConfig
Configuration for a prebuilt voice.
voiceNamestring
                  
                The name of the prebuilt voice to use.
| JSON representation | 
|---|
| { "voiceName": string } | 
MultiSpeakerVoiceConfig
Configuration for a multi-speaker text-to-speech 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
Configuration for the model's thinking features.
"Thinking" is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response.
includeThoughtsboolean
                  
                Optional. If true, the model will include its thoughts in the response. "Thoughts" are the intermediate steps the model takes to arrive at the final response. They can provide insights into the model's reasoning process and help with debugging. If this is true, thoughts are returned only when available.
thinkingBudgetinteger
                  
                Optional. The token budget for the model's thinking process. The model will make a best effort to stay within this budget. This can be used to control the trade-off between response quality and latency.
| 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
Configuration for image generation.
This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people.
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 for controlling the generation of people in images.
| Enums | |
|---|---|
| PERSON_GENERATION_UNSPECIFIED | The default behavior is unspecified. The model will decide whether to generate images of people. | 
| ALLOW_ALL | Allows the model to generate images of people, including adults and children. | 
| ALLOW_ADULT | Allows the model to generate images of adults, but not children. | 
| ALLOW_NONE | Prevents the model from generating images of people. |