public sealed class AnswerQueryRequest : IMessage<AnswerQueryRequest>, IEquatable<AnswerQueryRequest>, IDeepCloneable<AnswerQueryRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Discovery Engine v1 API class AnswerQueryRequest.
Request message for
[ConversationalSearchService.AnswerQuery][google.cloud.discoveryengine.v1.ConversationalSearchService.AnswerQuery]
method.
Deprecated: This field is deprecated. Streaming Answer API will be
supported.
Asynchronous mode control.
If enabled, the response will be returned with answer/session resource
name without final answer. The API users need to do the polling to get
the latest status of answer/session by calling
[ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer]
or
[ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession]
method.
Required. The resource name of the Search serving config, such as
projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config,
or
projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config.
This field is used to identify the serving configuration name, set
of models used to make the search.
public MapField<string, string> UserLabels { get; }
The user labels applied to a resource must meet the following requirements:
Each resource can have multiple labels, up to a maximum of 64.
Each label must be a key-value pair.
Keys have a minimum length of 1 character and a maximum length of 63
characters and cannot be empty. Values can be empty and have a maximum
length of 63 characters.
Keys and values can contain only lowercase letters, numeric characters,
underscores, and dashes. All characters must use UTF-8 encoding, and
international characters are allowed.
The key portion of a label must be unique. However, you can use the same
key with multiple resources.
Keys must start with a lowercase letter or international character.
A unique identifier for tracking visitors. For example, this could be
implemented with an HTTP cookie, which should be able to uniquely identify
a visitor on a single device. This unique identifier should not change if
the visitor logs in or out of the website.
This field should NOT have a fixed value such as unknown_visitor.
The field must be a UTF-8 encoded string with a length limit of 128
characters. Otherwise, an INVALID_ARGUMENT error is returned.
[[["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-08-28 UTC."],[[["\u003cp\u003eThis page provides documentation for the \u003ccode\u003eAnswerQueryRequest\u003c/code\u003e class within the Google Cloud Discovery Engine v1 API, with the latest version being 1.6.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAnswerQueryRequest\u003c/code\u003e class is used to structure requests for the \u003ccode\u003eConversationalSearchService.AnswerQuery\u003c/code\u003e method, enabling conversational search capabilities.\u003c/p\u003e\n"],["\u003cp\u003eIt includes properties like \u003ccode\u003eQuery\u003c/code\u003e, \u003ccode\u003eServingConfig\u003c/code\u003e, \u003ccode\u003eSession\u003c/code\u003e, and various specifications for answer generation, query understanding, related questions, safety, and search.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e and inherits from the \u003ccode\u003eobject\u003c/code\u003e class, indicating its integration within the .NET environment.\u003c/p\u003e\n"],["\u003cp\u003eThere are multiple versions available, from 1.0.0-beta06 up to the latest 1.6.0, showcasing the continuous evolution of the API.\u003c/p\u003e\n"]]],[],null,["# Discovery Engine v1 API - Class AnswerQueryRequest (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)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.8.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.7.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.6.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.5.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.4.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.3.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.2.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.1.0/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/1.0.0-beta06/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest) \n\n public sealed class AnswerQueryRequest : IMessage\u003cAnswerQueryRequest\u003e, IEquatable\u003cAnswerQueryRequest\u003e, IDeepCloneable\u003cAnswerQueryRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Discovery Engine v1 API class AnswerQueryRequest.\n\nRequest message for\n\\[ConversationalSearchService.AnswerQuery\\]\\[google.cloud.discoveryengine.v1.ConversationalSearchService.AnswerQuery\\]\nmethod. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AnswerQueryRequest \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), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AnswerQueryRequest](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest), [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), [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### AnswerQueryRequest()\n\n public AnswerQueryRequest()\n\n### AnswerQueryRequest(AnswerQueryRequest)\n\n public AnswerQueryRequest(AnswerQueryRequest other)\n\nProperties\n----------\n\n### AnswerGenerationSpec\n\n public AnswerQueryRequest.Types.AnswerGenerationSpec AnswerGenerationSpec { get; set; }\n\nAnswer generation specification.\n\n### AsynchronousMode\n\n [Obsolete]\n public bool AsynchronousMode { get; set; }\n\nDeprecated: This field is deprecated. Streaming Answer API will be\nsupported.\n\nAsynchronous mode control.\n\nIf enabled, the response will be returned with answer/session resource\nname without final answer. The API users need to do the polling to get\nthe latest status of answer/session by calling\n\\[ConversationalSearchService.GetAnswer\\]\\[google.cloud.discoveryengine.v1.ConversationalSearchService.GetAnswer\\]\nor\n\\[ConversationalSearchService.GetSession\\]\\[google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession\\]\nmethod.\n\n### EndUserSpec\n\n public AnswerQueryRequest.Types.EndUserSpec EndUserSpec { get; set; }\n\nOptional. End user specification.\n\n### GroundingSpec\n\n public AnswerQueryRequest.Types.GroundingSpec GroundingSpec { get; set; }\n\nOptional. Grounding specification.\n\n### Query\n\n public Query Query { get; set; }\n\nRequired. Current user query.\n\n### QueryUnderstandingSpec\n\n public AnswerQueryRequest.Types.QueryUnderstandingSpec QueryUnderstandingSpec { get; set; }\n\nQuery understanding specification.\n\n### RelatedQuestionsSpec\n\n public AnswerQueryRequest.Types.RelatedQuestionsSpec RelatedQuestionsSpec { get; set; }\n\nRelated questions specification.\n\n### SafetySpec\n\n public AnswerQueryRequest.Types.SafetySpec SafetySpec { get; set; }\n\nModel specification.\n\n### SearchSpec\n\n public AnswerQueryRequest.Types.SearchSpec SearchSpec { get; set; }\n\nSearch specification.\n\n### ServingConfig\n\n public string ServingConfig { get; set; }\n\nRequired. The resource name of the Search serving config, such as\n`projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`,\nor\n`projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`.\nThis field is used to identify the serving configuration name, set\nof models used to make the search.\n\n### ServingConfigAsServingConfigName\n\n public ServingConfigName ServingConfigAsServingConfigName { get; set; }\n\n[ServingConfigName](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.ServingConfigName)-typed view over the [ServingConfig](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest#Google_Cloud_DiscoveryEngine_V1_AnswerQueryRequest_ServingConfig) resource name property.\n\n### Session\n\n public string Session { get; set; }\n\nThe session resource name. Not required.\n\nWhen session field is not set, the API is in sessionless mode.\n\nWe support auto session mode: users can use the wildcard symbol `-` as\nsession ID. A new ID will be automatically generated and assigned.\n\n### SessionAsSessionName\n\n public SessionName SessionAsSessionName { get; set; }\n\n[SessionName](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.SessionName)-typed view over the [Session](/dotnet/docs/reference/Google.Cloud.DiscoveryEngine.V1/latest/Google.Cloud.DiscoveryEngine.V1.AnswerQueryRequest#Google_Cloud_DiscoveryEngine_V1_AnswerQueryRequest_Session) resource name property.\n\n### UserLabels\n\n public MapField\u003cstring, string\u003e UserLabels { get; }\n\nThe user labels applied to a resource must meet the following requirements:\n\n- Each resource can have multiple labels, up to a maximum of 64.\n- Each label must be a key-value pair.\n- Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.\n- Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.\n- The key portion of a label must be unique. However, you can use the same key with multiple resources.\n- Keys must start with a lowercase letter or international character.\n\nSee [Google Cloud\nDocument](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)\nfor more details.\n\n### UserPseudoId\n\n public string UserPseudoId { get; set; }\n\nA unique identifier for tracking visitors. For example, this could be\nimplemented with an HTTP cookie, which should be able to uniquely identify\na visitor on a single device. This unique identifier should not change if\nthe visitor logs in or out of the website.\n\nThis field should NOT have a fixed value such as `unknown_visitor`.\n\nThe field must be a UTF-8 encoded string with a length limit of 128\ncharacters. Otherwise, an `INVALID_ARGUMENT` error is returned."]]