# AnswerGenerationSpec

- [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#SCHEMA_REPRESENTATION)
- [ModelSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#ModelSpec)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#ModelSpec.SCHEMA_REPRESENTATION)
- [PromptSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#PromptSpec)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#PromptSpec.SCHEMA_REPRESENTATION)
- [MultimodalSpec](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#MultimodalSpec)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#MultimodalSpec.SCHEMA_REPRESENTATION)
- [ImageSource](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#ImageSource)

Answer generation specification.

| JSON representation |
|---|
| ``` { "modelSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#ModelSpec`) }, "promptSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#PromptSpec`) }, "includeCitations": boolean, "answerLanguageCode": string, "ignoreAdversarialQuery": boolean, "ignoreNonAnswerSeekingQuery": boolean, "ignoreJailBreakingQuery": boolean, "multimodalSpec": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#MultimodalSpec`) }, "ignoreLowRelevantContent": boolean } ``` |

| Fields ||
|---|---|
| `modelSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#ModelSpec`)`` Answer generation model specification. |
| `promptSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#PromptSpec`)`` Answer generation prompt specification. |
| `includeCitations` | `boolean` Specifies whether to include citation metadata in the answer. The default value is `false`. |
| `answerLanguageCode` | `string` Language code for Answer. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature. |
| `ignoreAdversarialQuery` | `boolean` Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No answer is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating answers for adversarial queries and return fallback messages instead. |
| `ignoreNonAnswerSeekingQuery` | `boolean` Specifies whether to filter out queries that are not answer-seeking. The default value is `false`. Google employs search-query classification to detect answer-seeking queries. No answer is returned if the search query is classified as a non-answer seeking query. If this field is set to `true`, we skip generating answers for non-answer seeking queries and return fallback messages instead. |
| `ignoreJailBreakingQuery` | `boolean` Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. "Reply in the tone of a competing company's CEO". If this field is set to `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead. |
| `multimodalSpec` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#MultimodalSpec`)`` Optional. Multimodal specification. |
| `ignoreLowRelevantContent` | `boolean` Specifies whether to filter out queries that have low relevance. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true` or unset, the behavior will be determined automatically by the service. |

## ModelSpec

Answer Generation Model specification.

| JSON representation |
|---|
| ``` { "modelVersion": string } ``` |

| Fields ||
|---|---|
| `modelVersion` | `string` Model version. If not set, it will use the default stable model. Allowed values are: stable, preview. |

## PromptSpec

Answer generation prompt specification.

| JSON representation |
|---|
| ``` { "preamble": string } ``` |

| Fields ||
|---|---|
| `preamble` | `string` Customized preamble. |

## MultimodalSpec

Multimodal specification: Will return an image from specified source. If multiple sources are specified, the pick is a quality based decision.

| JSON representation |
|---|
| ``` { "imageSource": enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#ImageSource`) } ``` |

| Fields ||
|---|---|
| `imageSource` | ``enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/AnswerGenerationSpec#ImageSource`)`` Optional. Source of image returned in the answer. |

## ImageSource

Specifies the image source.

| Enums ||
|---|---|
| `IMAGE_SOURCE_UNSPECIFIED` | Unspecified image source (multimodal feature is disabled by default). |
| `ALL_AVAILABLE_SOURCES` | Behavior when service determines the pick from all available sources. |
| `CORPUS_IMAGE_ONLY` | Includes image from corpus in the answer. |
| `FIGURE_GENERATION_ONLY` | Triggers figure generation in the answer. |