# Vertex AI V1 API - Class Google::Cloud::AIPlatform::V1::GenerationConfig (v1.44.0)

1.43.0 (latest) 1.42.0 1.41.0 1.40.0 1.39.0 1.38.0 1.37.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.1 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.24.0 1.23.1 1.22.0 1.21.0 1.20.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.0 1.14.0 1.13.0 1.12.0 1.11.0 1.10.0 1.9.0 1.8.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0 0.64.0 0.63.0 0.62.0 0.61.0 0.60.0 0.59.0 0.58.0 0.57.0 0.56.0 0.55.0 0.54.0 0.53.0 0.52.0 0.51.0 0.50.0 0.49.0 0.48.0 0.47.0 0.46.0 0.45.0 0.44.0 0.43.0 0.42.0 0.41.0 0.40.0 0.39.0 0.38.0 0.37.0 0.36.0 0.35.0 0.34.0 0.33.0 0.32.0 0.31.0 0.30.0 0.29.0 0.28.0 0.27.0 0.26.0 0.25.0 0.24.0 0.23.0 0.22.0 0.21.0 0.20.0 0.19.0 0.18.0 0.17.0 0.16.0 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.0 0.9.1 0.8.0 0.7.0 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Vertex AI V1 API class Google::Cloud::AIPlatform::V1::GenerationConfig.

Generation config.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #audio_timestamp

    def audio_timestamp() -> ::Boolean

**Returns**

- (::Boolean) --- 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.

### #audio_timestamp=

    def audio_timestamp=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- 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.
**Returns**

- (::Boolean) --- 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.

### #candidate_count

    def candidate_count() -> ::Integer

**Returns**

- (::Integer) --- Optional. Number of candidates to generate.

### #candidate_count=

    def candidate_count=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Optional. Number of candidates to generate.
**Returns**

- (::Integer) --- Optional. Number of candidates to generate.

### #frequency_penalty

    def frequency_penalty() -> ::Float

**Returns**

- (::Float) --- Optional. Frequency penalties.

### #frequency_penalty=

    def frequency_penalty=(value) -> ::Float

**Parameter**

- **value** (::Float) --- Optional. Frequency penalties.
**Returns**

- (::Float) --- Optional. Frequency penalties.

### #image_config

    def image_config() -> ::Google::Cloud::AIPlatform::V1::ImageConfig

**Returns**

- ([::Google::Cloud::AIPlatform::V1::ImageConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ImageConfig)) --- Optional. Config for image generation features.

### #image_config=

    def image_config=(value) -> ::Google::Cloud::AIPlatform::V1::ImageConfig

**Parameter**

- **value** ([::Google::Cloud::AIPlatform::V1::ImageConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ImageConfig)) --- Optional. Config for image generation features.
**Returns**

- ([::Google::Cloud::AIPlatform::V1::ImageConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-ImageConfig)) --- Optional. Config for image generation features.

### #logprobs

    def logprobs() -> ::Integer

**Returns**

- (::Integer) --- Optional. Logit probabilities.

### #logprobs=

    def logprobs=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Optional. Logit probabilities.
**Returns**

- (::Integer) --- Optional. Logit probabilities.

### #max_output_tokens

    def max_output_tokens() -> ::Integer

**Returns**

- (::Integer) --- Optional. The maximum number of output tokens to generate per message.

### #max_output_tokens=

    def max_output_tokens=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Optional. The maximum number of output tokens to generate per message.
**Returns**

- (::Integer) --- Optional. The maximum number of output tokens to generate per message.

### #media_resolution

    def media_resolution() -> ::Google::Cloud::AIPlatform::V1::GenerationConfig::MediaResolution

**Returns**

- ([::Google::Cloud::AIPlatform::V1::GenerationConfig::MediaResolution](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-MediaResolution)) --- 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.

### #media_resolution=

    def media_resolution=(value) -> ::Google::Cloud::AIPlatform::V1::GenerationConfig::MediaResolution

**Parameter**

- **value** ([::Google::Cloud::AIPlatform::V1::GenerationConfig::MediaResolution](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-MediaResolution)) --- 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.
**Returns**

- ([::Google::Cloud::AIPlatform::V1::GenerationConfig::MediaResolution](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-MediaResolution)) --- 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.

### #presence_penalty

    def presence_penalty() -> ::Float

**Returns**

- (::Float) --- Optional. Positive penalties.

### #presence_penalty=

    def presence_penalty=(value) -> ::Float

**Parameter**

- **value** (::Float) --- Optional. Positive penalties.
**Returns**

- (::Float) --- Optional. Positive penalties.

### #response_json_schema

    def response_json_schema() -> ::Google::Protobuf::Value

**Returns**

- ([::Google::Protobuf::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Protobuf-Value)) --- Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/).


  If set, `response_schema` must be omitted, but `response_mime_type` 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.

### #response_json_schema=

    def response_json_schema=(value) -> ::Google::Protobuf::Value

**Parameter**

- **value** ([::Google::Protobuf::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Protobuf-Value)) --- Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/).


  If set, `response_schema` must be omitted, but `response_mime_type` 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.
**Returns**

- ([::Google::Protobuf::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Protobuf-Value)) --- Optional. Output schema of the generated response. This is an alternative to `response_schema` that accepts [JSON Schema](https://json-schema.org/).


  If set, `response_schema` must be omitted, but `response_mime_type` 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.

### #response_logprobs

    def response_logprobs() -> ::Boolean

**Returns**

- (::Boolean) --- Optional. If true, export the logprobs results in response.

### #response_logprobs=

    def response_logprobs=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Optional. If true, export the logprobs results in response.
**Returns**

- (::Boolean) --- Optional. If true, export the logprobs results in response.

### #response_mime_type

    def response_mime_type() -> ::String

**Returns**

- (::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_mime_type=

    def response_mime_type=(value) -> ::String

**Parameter**

- **value** (::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.
**Returns**

- (::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_modalities

    def response_modalities() -> ::Array<::Google::Cloud::AIPlatform::V1::GenerationConfig::Modality>

**Returns**

- (::Array\<[::Google::Cloud::AIPlatform::V1::GenerationConfig::Modality](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-Modality)\>) --- 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.

### #response_modalities=

    def response_modalities=(value) -> ::Array<::Google::Cloud::AIPlatform::V1::GenerationConfig::Modality>

**Parameter**

- **value** (::Array\<[::Google::Cloud::AIPlatform::V1::GenerationConfig::Modality](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-Modality)\>) --- 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.
**Returns**

- (::Array\<[::Google::Cloud::AIPlatform::V1::GenerationConfig::Modality](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-Modality)\>) --- 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.

### #response_schema

    def response_schema() -> ::Google::Cloud::AIPlatform::V1::Schema

**Returns**

- ([::Google::Cloud::AIPlatform::V1::Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/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](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response.

### #response_schema=

    def response_schema=(value) -> ::Google::Cloud::AIPlatform::V1::Schema

**Parameter**

- **value** ([::Google::Cloud::AIPlatform::V1::Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/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](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response.
**Returns**

- ([::Google::Cloud::AIPlatform::V1::Schema](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/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](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response.

### #routing_config

    def routing_config() -> ::Google::Cloud::AIPlatform::V1::GenerationConfig::RoutingConfig

**Returns**

- ([::Google::Cloud::AIPlatform::V1::GenerationConfig::RoutingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-RoutingConfig)) --- Optional. Routing configuration.

### #routing_config=

    def routing_config=(value) -> ::Google::Cloud::AIPlatform::V1::GenerationConfig::RoutingConfig

**Parameter**

- **value** ([::Google::Cloud::AIPlatform::V1::GenerationConfig::RoutingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-RoutingConfig)) --- Optional. Routing configuration.
**Returns**

- ([::Google::Cloud::AIPlatform::V1::GenerationConfig::RoutingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-RoutingConfig)) --- Optional. Routing configuration.

### #seed

    def seed() -> ::Integer

**Returns**

- (::Integer) --- Optional. Seed.

### #seed=

    def seed=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Optional. Seed.
**Returns**

- (::Integer) --- Optional. Seed.

### #speech_config

    def speech_config() -> ::Google::Cloud::AIPlatform::V1::SpeechConfig

**Returns**

- ([::Google::Cloud::AIPlatform::V1::SpeechConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-SpeechConfig)) --- Optional. The speech generation config.

### #speech_config=

    def speech_config=(value) -> ::Google::Cloud::AIPlatform::V1::SpeechConfig

**Parameter**

- **value** ([::Google::Cloud::AIPlatform::V1::SpeechConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-SpeechConfig)) --- Optional. The speech generation config.
**Returns**

- ([::Google::Cloud::AIPlatform::V1::SpeechConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-SpeechConfig)) --- Optional. The speech generation config.

### #stop_sequences

    def stop_sequences() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Optional. Stop sequences.

### #stop_sequences=

    def stop_sequences=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Optional. Stop sequences.
**Returns**

- (::Array\<::String\>) --- Optional. Stop sequences.

### #temperature

    def temperature() -> ::Float

**Returns**

- (::Float) --- Optional. Controls the randomness of predictions.

### #temperature=

    def temperature=(value) -> ::Float

**Parameter**

- **value** (::Float) --- Optional. Controls the randomness of predictions.
**Returns**

- (::Float) --- Optional. Controls the randomness of predictions.

### #thinking_config

    def thinking_config() -> ::Google::Cloud::AIPlatform::V1::GenerationConfig::ThinkingConfig

**Returns**

- ([::Google::Cloud::AIPlatform::V1::GenerationConfig::ThinkingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-ThinkingConfig)) --- Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.

### #thinking_config=

    def thinking_config=(value) -> ::Google::Cloud::AIPlatform::V1::GenerationConfig::ThinkingConfig

**Parameter**

- **value** ([::Google::Cloud::AIPlatform::V1::GenerationConfig::ThinkingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-ThinkingConfig)) --- Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.
**Returns**

- ([::Google::Cloud::AIPlatform::V1::GenerationConfig::ThinkingConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-ai_platform-v1/latest/Google-Cloud-AIPlatform-V1-GenerationConfig-ThinkingConfig)) --- Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.

### #top_k

    def top_k() -> ::Float

**Returns**

- (::Float) --- Optional. If specified, top-k sampling will be used.

### #top_k=

    def top_k=(value) -> ::Float

**Parameter**

- **value** (::Float) --- Optional. If specified, top-k sampling will be used.
**Returns**

- (::Float) --- Optional. If specified, top-k sampling will be used.

### #top_p

    def top_p() -> ::Float

**Returns**

- (::Float) --- Optional. If specified, nucleus sampling will be used.

### #top_p=

    def top_p=(value) -> ::Float

**Parameter**

- **value** (::Float) --- Optional. If specified, nucleus sampling will be used.
**Returns**

- (::Float) --- Optional. If specified, nucleus sampling will be used.