public sealed class AnswerQueryRequest.Types.AnswerGenerationSpec : IMessage<AnswerQueryRequest.Types.AnswerGenerationSpec>, IEquatable<AnswerQueryRequest.Types.AnswerGenerationSpec>, IDeepCloneable<AnswerQueryRequest.Types.AnswerGenerationSpec>, IBufferMessage, IMessage
Reference documentation and code samples for the Discovery Engine v1 API class AnswerQueryRequest.Types.AnswerGenerationSpec.
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.
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.
public bool IgnoreLowRelevantContent { get; set; }
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.
public bool IgnoreNonAnswerSeekingQuery { get; set; }
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eAnswerQueryRequest.Types.AnswerGenerationSpec\u003c/code\u003e API class is 1.6.0, with previous versions ranging from 1.5.0 down to 1.0.0-beta06 also available.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAnswerQueryRequest.Types.AnswerGenerationSpec\u003c/code\u003e is an answer generation specification class within the Discovery Engine v1 API, used to control various aspects of the answer generation process.\u003c/p\u003e\n"],["\u003cp\u003eThis class allows for the customization of answer generation, including language code, filtering options for adversarial, jail-breaking, and non-answer-seeking queries, and the inclusion of citations, and includes the ability to ignore queries with low relevance.\u003c/p\u003e\n"],["\u003cp\u003eThe class \u003ccode\u003eAnswerQueryRequest.Types.AnswerGenerationSpec\u003c/code\u003e implements multiple interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing a range of functionalities.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAnswerQueryRequest.Types.AnswerGenerationSpec\u003c/code\u003e class includes properties to control model and prompt specifications related to answer generation using \u003ccode\u003eModelSpec\u003c/code\u003e and \u003ccode\u003ePromptSpec\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1 API - Class AnswerQueryRequest.Types.AnswerGenerationSpec (1.9.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.9.0 (latest)](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.8.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.7.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.6.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.5.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.4.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.3.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.2.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.1.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.0.0-beta06/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec) \n\n public sealed class AnswerQueryRequest.Types.AnswerGenerationSpec : IMessage\u003cAnswerQueryRequest.Types.AnswerGenerationSpec\u003e, IEquatable\u003cAnswerQueryRequest.Types.AnswerGenerationSpec\u003e, IDeepCloneable\u003cAnswerQueryRequest.Types.AnswerGenerationSpec\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Discovery Engine v1 API class AnswerQueryRequest.Types.AnswerGenerationSpec.\n\nAnswer generation specification. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AnswerQueryRequest.Types.AnswerGenerationSpec \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AnswerQueryRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types)[AnswerGenerationSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AnswerQueryRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types)[AnswerGenerationSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AnswerQueryRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)[Types](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types)[AnswerGenerationSpec](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest.Types.AnswerGenerationSpec), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.DiscoveryEngine.V1](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.DiscoveryEngine.V1.dll\n\nConstructors\n------------\n\n### AnswerGenerationSpec()\n\n public AnswerGenerationSpec()\n\n### AnswerGenerationSpec(AnswerGenerationSpec)\n\n public AnswerGenerationSpec(AnswerQueryRequest.Types.AnswerGenerationSpec other)\n\nProperties\n----------\n\n### AnswerLanguageCode\n\n public string AnswerLanguageCode { get; set; }\n\nLanguage code for Answer. Use language tags defined by\n[BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).\nNote: This is an experimental feature.\n\n### HasIgnoreLowRelevantContent\n\n public bool HasIgnoreLowRelevantContent { get; }\n\nGets whether the \"ignore_low_relevant_content\" field is set\n\n### IgnoreAdversarialQuery\n\n public bool IgnoreAdversarialQuery { get; set; }\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### IgnoreJailBreakingQuery\n\n public bool IgnoreJailBreakingQuery { get; set; }\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### IgnoreLowRelevantContent\n\n public bool IgnoreLowRelevantContent { get; set; }\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### IgnoreNonAnswerSeekingQuery\n\n public bool IgnoreNonAnswerSeekingQuery { get; set; }\n\nSpecifies whether to filter out queries that are not answer-seeking.\nThe default value is `false`.\n\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### IncludeCitations\n\n public bool IncludeCitations { get; set; }\n\nSpecifies whether to include citation metadata in the answer. The default\nvalue is `false`.\n\n### ModelSpec\n\n public AnswerQueryRequest.Types.AnswerGenerationSpec.Types.ModelSpec ModelSpec { get; set; }\n\nAnswer generation model specification.\n\n### PromptSpec\n\n public AnswerQueryRequest.Types.AnswerGenerationSpec.Types.PromptSpec PromptSpec { get; set; }\n\nAnswer generation prompt specification."]]