Specifies whether to include citation metadata in the answer. The default value is false.
↳ answer_language_code
string
Language code for Answer. Use language tags defined by BCP47. Note: This is an experimental feature.
↳ ignore_adversarial_query
bool
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.
↳ ignore_non_answer_seeking_query
bool
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.
↳ ignore_low_relevant_content
bool
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.
↳ ignore_jail_breaking_query
bool
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.
Specifies whether to include citation metadata in the answer. The default
value is false.
Returns
Type
Description
bool
setIncludeCitations
Specifies whether to include citation metadata in the answer. The default
value is false.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getAnswerLanguageCode
Language code for Answer. Use language tags defined by
BCP47.
Note: This is an experimental feature.
Returns
Type
Description
string
setAnswerLanguageCode
Language code for Answer. Use language tags defined by
BCP47.
Note: This is an experimental feature.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getIgnoreAdversarialQuery
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.
Returns
Type
Description
bool
setIgnoreAdversarialQuery
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.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getIgnoreNonAnswerSeekingQuery
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.
Returns
Type
Description
bool
setIgnoreNonAnswerSeekingQuery
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.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getIgnoreLowRelevantContent
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.
Returns
Type
Description
bool
hasIgnoreLowRelevantContent
clearIgnoreLowRelevantContent
setIgnoreLowRelevantContent
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.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getIgnoreJailBreakingQuery
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.
Returns
Type
Description
bool
setIgnoreJailBreakingQuery
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.
[[["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-09-04 UTC."],[],[],null,["# Google Cloud Discovery Engine V1 Client - Class AnswerGenerationSpec (1.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.0 (latest)](/php/docs/reference/cloud-discoveryengine/latest/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [1.6.1](/php/docs/reference/cloud-discoveryengine/1.6.1/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [1.5.1](/php/docs/reference/cloud-discoveryengine/1.5.1/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [1.4.0](/php/docs/reference/cloud-discoveryengine/1.4.0/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [1.3.3](/php/docs/reference/cloud-discoveryengine/1.3.3/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [1.2.0](/php/docs/reference/cloud-discoveryengine/1.2.0/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [1.1.0](/php/docs/reference/cloud-discoveryengine/1.1.0/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [1.0.0](/php/docs/reference/cloud-discoveryengine/1.0.0/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [0.11.3](/php/docs/reference/cloud-discoveryengine/0.11.3/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [0.8.0](/php/docs/reference/cloud-discoveryengine/0.8.0/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [0.7.1](/php/docs/reference/cloud-discoveryengine/0.7.1/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [0.6.0](/php/docs/reference/cloud-discoveryengine/0.6.0/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [0.5.0](/php/docs/reference/cloud-discoveryengine/0.5.0/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [0.4.0](/php/docs/reference/cloud-discoveryengine/0.4.0/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [0.3.0](/php/docs/reference/cloud-discoveryengine/0.3.0/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [0.2.0](/php/docs/reference/cloud-discoveryengine/0.2.0/V1.AnswerQueryRequest.AnswerGenerationSpec)\n- [0.1.1](/php/docs/reference/cloud-discoveryengine/0.1.1/V1.AnswerQueryRequest.AnswerGenerationSpec) \nReference documentation and code samples for the Google Cloud Discovery Engine V1 Client class AnswerGenerationSpec.\n\nAnswer generation specification.\n\nGenerated from protobuf message `google.cloud.discoveryengine.v1.AnswerQueryRequest.AnswerGenerationSpec`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ DiscoveryEngine \\\\ V1 \\\\ AnswerQueryRequest\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getModelSpec\n\nAnswer generation model specification.\n\n### hasModelSpec\n\n### clearModelSpec\n\n### setModelSpec\n\nAnswer generation model specification.\n\n### getPromptSpec\n\nAnswer generation prompt specification.\n\n### hasPromptSpec\n\n### clearPromptSpec\n\n### setPromptSpec\n\nAnswer generation prompt specification.\n\n### getIncludeCitations\n\nSpecifies whether to include citation metadata in the answer. The default\nvalue is `false`.\n\n### setIncludeCitations\n\nSpecifies whether to include citation metadata in the answer. The default\nvalue is `false`.\n\n### getAnswerLanguageCode\n\nLanguage code for Answer. Use language tags defined by\n[BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).\n\nNote: This is an experimental feature.\n\n### setAnswerLanguageCode\n\nLanguage code for Answer. Use language tags defined by\n[BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).\n\nNote: This is an experimental feature.\n\n### getIgnoreAdversarialQuery\n\nSpecifies whether to filter out adversarial queries. The default value\nis `false`.\n\nGoogle employs search-query classification to detect adversarial\nqueries. No answer is returned if the search query is classified as an\nadversarial query. For example, a user might ask a question regarding\nnegative comments about the company or submit a query designed to\ngenerate unsafe, policy-violating output. If this field is set to\n`true`, we skip generating answers for adversarial queries and return\nfallback messages instead.\n\n### setIgnoreAdversarialQuery\n\nSpecifies whether to filter out adversarial queries. The default value\nis `false`.\n\nGoogle employs search-query classification to detect adversarial\nqueries. No answer is returned if the search query is classified as an\nadversarial query. For example, a user might ask a question regarding\nnegative comments about the company or submit a query designed to\ngenerate unsafe, policy-violating output. If this field is set to\n`true`, we skip generating answers for adversarial queries and return\nfallback messages instead.\n\n### getIgnoreNonAnswerSeekingQuery\n\nSpecifies whether to filter out queries that are not answer-seeking.\n\nThe default value is `false`.\nGoogle employs search-query classification to detect answer-seeking\nqueries. No answer is returned if the search query is classified as a\nnon-answer seeking query. If this field is set to `true`, we skip\ngenerating answers for non-answer seeking queries and return\nfallback messages instead.\n\n### setIgnoreNonAnswerSeekingQuery\n\nSpecifies whether to filter out queries that are not answer-seeking.\n\nThe default value is `false`.\nGoogle employs search-query classification to detect answer-seeking\nqueries. No answer is returned if the search query is classified as a\nnon-answer seeking query. If this field is set to `true`, we skip\ngenerating answers for non-answer seeking queries and return\nfallback messages instead.\n\n### getIgnoreLowRelevantContent\n\nSpecifies whether to filter out queries that have low relevance.\n\nIf this field is set to `false`, all search results are used regardless\nof relevance to generate answers. If set to `true` or unset, the behavior\nwill be determined automatically by the service.\n\n### hasIgnoreLowRelevantContent\n\n### clearIgnoreLowRelevantContent\n\n### setIgnoreLowRelevantContent\n\nSpecifies whether to filter out queries that have low relevance.\n\nIf this field is set to `false`, all search results are used regardless\nof relevance to generate answers. If set to `true` or unset, the behavior\nwill be determined automatically by the service.\n\n### getIgnoreJailBreakingQuery\n\nOptional. Specifies whether to filter out jail-breaking queries. The\ndefault value is `false`.\n\nGoogle employs search-query classification to detect jail-breaking\nqueries. No summary is returned if the search query is classified as a\njail-breaking query. A user might add instructions to the query to\nchange the tone, style, language, content of the answer, or ask the\nmodel to act as a different entity, e.g. \"Reply in the tone of a\ncompeting company's CEO\". If this field is set to `true`, we skip\ngenerating summaries for jail-breaking queries and return fallback\nmessages instead.\n\n### setIgnoreJailBreakingQuery\n\nOptional. Specifies whether to filter out jail-breaking queries. The\ndefault value is `false`.\n\nGoogle employs search-query classification to detect jail-breaking\nqueries. No summary is returned if the search query is classified as a\njail-breaking query. A user might add instructions to the query to\nchange the tone, style, language, content of the answer, or ask the\nmodel to act as a different entity, e.g. \"Reply in the tone of a\ncompeting company's CEO\". If this field is set to `true`, we skip\ngenerating summaries for jail-breaking queries and return fallback\nmessages instead."]]