Class AnswerQueryRequest.Builder (0.50.0)

public static final class AnswerQueryRequest.Builder extends GeneratedMessageV3.Builder<AnswerQueryRequest.Builder> implements AnswerQueryRequestOrBuilder

Request message for ConversationalSearchService.AnswerQuery method.

Protobuf type google.cloud.discoveryengine.v1beta.AnswerQueryRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public AnswerQueryRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AnswerQueryRequest.Builder
Overrides

build()

public AnswerQueryRequest build()
Returns
Type Description
AnswerQueryRequest

buildPartial()

public AnswerQueryRequest buildPartial()
Returns
Type Description
AnswerQueryRequest

clear()

public AnswerQueryRequest.Builder clear()
Returns
Type Description
AnswerQueryRequest.Builder
Overrides

clearAnswerGenerationSpec()

public AnswerQueryRequest.Builder clearAnswerGenerationSpec()

Answer generation specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7;

Returns
Type Description
AnswerQueryRequest.Builder

clearAsynchronousMode() (deprecated)

public AnswerQueryRequest.Builder clearAsynchronousMode()

Deprecated. google.cloud.discoveryengine.v1beta.AnswerQueryRequest.asynchronous_mode is deprecated. See google/cloud/discoveryengine/v1beta/conversational_search_service.proto;l=861

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 or ConversationalSearchService.GetSession method.

bool asynchronous_mode = 10 [deprecated = true];

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public AnswerQueryRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
AnswerQueryRequest.Builder
Overrides

clearGroundingSpec()

public AnswerQueryRequest.Builder clearGroundingSpec()

Optional. Grounding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.GroundingSpec grounding_spec = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AnswerQueryRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public AnswerQueryRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AnswerQueryRequest.Builder
Overrides

clearQuery()

public AnswerQueryRequest.Builder clearQuery()

Required. Current user query.

.google.cloud.discoveryengine.v1beta.Query query = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
AnswerQueryRequest.Builder

clearQueryUnderstandingSpec()

public AnswerQueryRequest.Builder clearQueryUnderstandingSpec()

Query understanding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9;

Returns
Type Description
AnswerQueryRequest.Builder

clearRelatedQuestionsSpec()

public AnswerQueryRequest.Builder clearRelatedQuestionsSpec()

Related questions specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5;

Returns
Type Description
AnswerQueryRequest.Builder

clearSafetySpec()

public AnswerQueryRequest.Builder clearSafetySpec()

Model specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SafetySpec safety_spec = 4;

Returns
Type Description
AnswerQueryRequest.Builder

clearSearchSpec()

public AnswerQueryRequest.Builder clearSearchSpec()

Search specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SearchSpec search_spec = 8;

Returns
Type Description
AnswerQueryRequest.Builder

clearServingConfig()

public AnswerQueryRequest.Builder clearServingConfig()

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.

string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.

clearSession()

public AnswerQueryRequest.Builder clearSession()

The session resource name. Not required.

When session field is not set, the API is in sessionless mode.

We support auto session mode: users can use the wildcard symbol - as session ID. A new ID will be automatically generated and assigned.

string session = 3 [(.google.api.resource_reference) = { ... }

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.

clearUserLabels()

public AnswerQueryRequest.Builder clearUserLabels()
Returns
Type Description
AnswerQueryRequest.Builder

clearUserPseudoId()

public AnswerQueryRequest.Builder clearUserPseudoId()

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.

string user_pseudo_id = 12;

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.

clone()

public AnswerQueryRequest.Builder clone()
Returns
Type Description
AnswerQueryRequest.Builder
Overrides

containsUserLabels(String key)

public boolean containsUserLabels(String key)

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.

    See Google Cloud Document for more details.

map<string, string> user_labels = 13;

Parameter
Name Description
key String
Returns
Type Description
boolean

getAnswerGenerationSpec()

public AnswerQueryRequest.AnswerGenerationSpec getAnswerGenerationSpec()

Answer generation specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7;

Returns
Type Description
AnswerQueryRequest.AnswerGenerationSpec

The answerGenerationSpec.

getAnswerGenerationSpecBuilder()

public AnswerQueryRequest.AnswerGenerationSpec.Builder getAnswerGenerationSpecBuilder()

Answer generation specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7;

Returns
Type Description
AnswerQueryRequest.AnswerGenerationSpec.Builder

getAnswerGenerationSpecOrBuilder()

public AnswerQueryRequest.AnswerGenerationSpecOrBuilder getAnswerGenerationSpecOrBuilder()

Answer generation specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7;

Returns
Type Description
AnswerQueryRequest.AnswerGenerationSpecOrBuilder

getAsynchronousMode() (deprecated)

public boolean getAsynchronousMode()

Deprecated. google.cloud.discoveryengine.v1beta.AnswerQueryRequest.asynchronous_mode is deprecated. See google/cloud/discoveryengine/v1beta/conversational_search_service.proto;l=861

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 or ConversationalSearchService.GetSession method.

bool asynchronous_mode = 10 [deprecated = true];

Returns
Type Description
boolean

The asynchronousMode.

getDefaultInstanceForType()

public AnswerQueryRequest getDefaultInstanceForType()
Returns
Type Description
AnswerQueryRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getGroundingSpec()

public AnswerQueryRequest.GroundingSpec getGroundingSpec()

Optional. Grounding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.GroundingSpec grounding_spec = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AnswerQueryRequest.GroundingSpec

The groundingSpec.

getGroundingSpecBuilder()

public AnswerQueryRequest.GroundingSpec.Builder getGroundingSpecBuilder()

Optional. Grounding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.GroundingSpec grounding_spec = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AnswerQueryRequest.GroundingSpec.Builder

getGroundingSpecOrBuilder()

public AnswerQueryRequest.GroundingSpecOrBuilder getGroundingSpecOrBuilder()

Optional. Grounding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.GroundingSpec grounding_spec = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AnswerQueryRequest.GroundingSpecOrBuilder

getMutableUserLabels() (deprecated)

public Map<String,String> getMutableUserLabels()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getQuery()

public Query getQuery()

Required. Current user query.

.google.cloud.discoveryengine.v1beta.Query query = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Query

The query.

getQueryBuilder()

public Query.Builder getQueryBuilder()

Required. Current user query.

.google.cloud.discoveryengine.v1beta.Query query = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Query.Builder

getQueryOrBuilder()

public QueryOrBuilder getQueryOrBuilder()

Required. Current user query.

.google.cloud.discoveryengine.v1beta.Query query = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
QueryOrBuilder

getQueryUnderstandingSpec()

public AnswerQueryRequest.QueryUnderstandingSpec getQueryUnderstandingSpec()

Query understanding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9;

Returns
Type Description
AnswerQueryRequest.QueryUnderstandingSpec

The queryUnderstandingSpec.

getQueryUnderstandingSpecBuilder()

public AnswerQueryRequest.QueryUnderstandingSpec.Builder getQueryUnderstandingSpecBuilder()

Query understanding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9;

Returns
Type Description
AnswerQueryRequest.QueryUnderstandingSpec.Builder

getQueryUnderstandingSpecOrBuilder()

public AnswerQueryRequest.QueryUnderstandingSpecOrBuilder getQueryUnderstandingSpecOrBuilder()

Query understanding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9;

Returns
Type Description
AnswerQueryRequest.QueryUnderstandingSpecOrBuilder

getRelatedQuestionsSpec()

public AnswerQueryRequest.RelatedQuestionsSpec getRelatedQuestionsSpec()

Related questions specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5;

Returns
Type Description
AnswerQueryRequest.RelatedQuestionsSpec

The relatedQuestionsSpec.

getRelatedQuestionsSpecBuilder()

public AnswerQueryRequest.RelatedQuestionsSpec.Builder getRelatedQuestionsSpecBuilder()

Related questions specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5;

Returns
Type Description
AnswerQueryRequest.RelatedQuestionsSpec.Builder

getRelatedQuestionsSpecOrBuilder()

public AnswerQueryRequest.RelatedQuestionsSpecOrBuilder getRelatedQuestionsSpecOrBuilder()

Related questions specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5;

Returns
Type Description
AnswerQueryRequest.RelatedQuestionsSpecOrBuilder

getSafetySpec()

public AnswerQueryRequest.SafetySpec getSafetySpec()

Model specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SafetySpec safety_spec = 4;

Returns
Type Description
AnswerQueryRequest.SafetySpec

The safetySpec.

getSafetySpecBuilder()

public AnswerQueryRequest.SafetySpec.Builder getSafetySpecBuilder()

Model specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SafetySpec safety_spec = 4;

Returns
Type Description
AnswerQueryRequest.SafetySpec.Builder

getSafetySpecOrBuilder()

public AnswerQueryRequest.SafetySpecOrBuilder getSafetySpecOrBuilder()

Model specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SafetySpec safety_spec = 4;

Returns
Type Description
AnswerQueryRequest.SafetySpecOrBuilder

getSearchSpec()

public AnswerQueryRequest.SearchSpec getSearchSpec()

Search specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SearchSpec search_spec = 8;

Returns
Type Description
AnswerQueryRequest.SearchSpec

The searchSpec.

getSearchSpecBuilder()

public AnswerQueryRequest.SearchSpec.Builder getSearchSpecBuilder()

Search specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SearchSpec search_spec = 8;

Returns
Type Description
AnswerQueryRequest.SearchSpec.Builder

getSearchSpecOrBuilder()

public AnswerQueryRequest.SearchSpecOrBuilder getSearchSpecOrBuilder()

Search specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SearchSpec search_spec = 8;

Returns
Type Description
AnswerQueryRequest.SearchSpecOrBuilder

getServingConfig()

public String getServingConfig()

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.

string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The servingConfig.

getServingConfigBytes()

public ByteString getServingConfigBytes()

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.

string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for servingConfig.

getSession()

public String getSession()

The session resource name. Not required.

When session field is not set, the API is in sessionless mode.

We support auto session mode: users can use the wildcard symbol - as session ID. A new ID will be automatically generated and assigned.

string session = 3 [(.google.api.resource_reference) = { ... }

Returns
Type Description
String

The session.

getSessionBytes()

public ByteString getSessionBytes()

The session resource name. Not required.

When session field is not set, the API is in sessionless mode.

We support auto session mode: users can use the wildcard symbol - as session ID. A new ID will be automatically generated and assigned.

string session = 3 [(.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for session.

getUserLabels() (deprecated)

public Map<String,String> getUserLabels()

Use #getUserLabelsMap() instead.

Returns
Type Description
Map<String,String>

getUserLabelsCount()

public int getUserLabelsCount()

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.

    See Google Cloud Document for more details.

map<string, string> user_labels = 13;

Returns
Type Description
int

getUserLabelsMap()

public Map<String,String> getUserLabelsMap()

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.

    See Google Cloud Document for more details.

map<string, string> user_labels = 13;

Returns
Type Description
Map<String,String>

getUserLabelsOrDefault(String key, String defaultValue)

public String getUserLabelsOrDefault(String key, String defaultValue)

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.

    See Google Cloud Document for more details.

map<string, string> user_labels = 13;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getUserLabelsOrThrow(String key)

public String getUserLabelsOrThrow(String key)

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.

    See Google Cloud Document for more details.

map<string, string> user_labels = 13;

Parameter
Name Description
key String
Returns
Type Description
String

getUserPseudoId()

public String getUserPseudoId()

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.

string user_pseudo_id = 12;

Returns
Type Description
String

The userPseudoId.

getUserPseudoIdBytes()

public ByteString getUserPseudoIdBytes()

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.

string user_pseudo_id = 12;

Returns
Type Description
ByteString

The bytes for userPseudoId.

hasAnswerGenerationSpec()

public boolean hasAnswerGenerationSpec()

Answer generation specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7;

Returns
Type Description
boolean

Whether the answerGenerationSpec field is set.

hasGroundingSpec()

public boolean hasGroundingSpec()

Optional. Grounding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.GroundingSpec grounding_spec = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the groundingSpec field is set.

hasQuery()

public boolean hasQuery()

Required. Current user query.

.google.cloud.discoveryengine.v1beta.Query query = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the query field is set.

hasQueryUnderstandingSpec()

public boolean hasQueryUnderstandingSpec()

Query understanding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9;

Returns
Type Description
boolean

Whether the queryUnderstandingSpec field is set.

hasRelatedQuestionsSpec()

public boolean hasRelatedQuestionsSpec()

Related questions specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5;

Returns
Type Description
boolean

Whether the relatedQuestionsSpec field is set.

hasSafetySpec()

public boolean hasSafetySpec()

Model specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SafetySpec safety_spec = 4;

Returns
Type Description
boolean

Whether the safetySpec field is set.

hasSearchSpec()

public boolean hasSearchSpec()

Search specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SearchSpec search_spec = 8;

Returns
Type Description
boolean

Whether the searchSpec field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeAnswerGenerationSpec(AnswerQueryRequest.AnswerGenerationSpec value)

public AnswerQueryRequest.Builder mergeAnswerGenerationSpec(AnswerQueryRequest.AnswerGenerationSpec value)

Answer generation specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7;

Parameter
Name Description
value AnswerQueryRequest.AnswerGenerationSpec
Returns
Type Description
AnswerQueryRequest.Builder

mergeFrom(AnswerQueryRequest other)

public AnswerQueryRequest.Builder mergeFrom(AnswerQueryRequest other)
Parameter
Name Description
other AnswerQueryRequest
Returns
Type Description
AnswerQueryRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public AnswerQueryRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AnswerQueryRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public AnswerQueryRequest.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
AnswerQueryRequest.Builder
Overrides

mergeGroundingSpec(AnswerQueryRequest.GroundingSpec value)

public AnswerQueryRequest.Builder mergeGroundingSpec(AnswerQueryRequest.GroundingSpec value)

Optional. Grounding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.GroundingSpec grounding_spec = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value AnswerQueryRequest.GroundingSpec
Returns
Type Description
AnswerQueryRequest.Builder

mergeQuery(Query value)

public AnswerQueryRequest.Builder mergeQuery(Query value)

Required. Current user query.

.google.cloud.discoveryengine.v1beta.Query query = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Query
Returns
Type Description
AnswerQueryRequest.Builder

mergeQueryUnderstandingSpec(AnswerQueryRequest.QueryUnderstandingSpec value)

public AnswerQueryRequest.Builder mergeQueryUnderstandingSpec(AnswerQueryRequest.QueryUnderstandingSpec value)

Query understanding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9;

Parameter
Name Description
value AnswerQueryRequest.QueryUnderstandingSpec
Returns
Type Description
AnswerQueryRequest.Builder

mergeRelatedQuestionsSpec(AnswerQueryRequest.RelatedQuestionsSpec value)

public AnswerQueryRequest.Builder mergeRelatedQuestionsSpec(AnswerQueryRequest.RelatedQuestionsSpec value)

Related questions specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5;

Parameter
Name Description
value AnswerQueryRequest.RelatedQuestionsSpec
Returns
Type Description
AnswerQueryRequest.Builder

mergeSafetySpec(AnswerQueryRequest.SafetySpec value)

public AnswerQueryRequest.Builder mergeSafetySpec(AnswerQueryRequest.SafetySpec value)

Model specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SafetySpec safety_spec = 4;

Parameter
Name Description
value AnswerQueryRequest.SafetySpec
Returns
Type Description
AnswerQueryRequest.Builder

mergeSearchSpec(AnswerQueryRequest.SearchSpec value)

public AnswerQueryRequest.Builder mergeSearchSpec(AnswerQueryRequest.SearchSpec value)

Search specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SearchSpec search_spec = 8;

Parameter
Name Description
value AnswerQueryRequest.SearchSpec
Returns
Type Description
AnswerQueryRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final AnswerQueryRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AnswerQueryRequest.Builder
Overrides

putAllUserLabels(Map<String,String> values)

public AnswerQueryRequest.Builder putAllUserLabels(Map<String,String> values)

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.

    See Google Cloud Document for more details.

map<string, string> user_labels = 13;

Parameter
Name Description
values Map<String,String>
Returns
Type Description
AnswerQueryRequest.Builder

putUserLabels(String key, String value)

public AnswerQueryRequest.Builder putUserLabels(String key, String value)

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.

    See Google Cloud Document for more details.

map<string, string> user_labels = 13;

Parameters
Name Description
key String
value String
Returns
Type Description
AnswerQueryRequest.Builder

removeUserLabels(String key)

public AnswerQueryRequest.Builder removeUserLabels(String key)

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.

    See Google Cloud Document for more details.

map<string, string> user_labels = 13;

Parameter
Name Description
key String
Returns
Type Description
AnswerQueryRequest.Builder

setAnswerGenerationSpec(AnswerQueryRequest.AnswerGenerationSpec value)

public AnswerQueryRequest.Builder setAnswerGenerationSpec(AnswerQueryRequest.AnswerGenerationSpec value)

Answer generation specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7;

Parameter
Name Description
value AnswerQueryRequest.AnswerGenerationSpec
Returns
Type Description
AnswerQueryRequest.Builder

setAnswerGenerationSpec(AnswerQueryRequest.AnswerGenerationSpec.Builder builderForValue)

public AnswerQueryRequest.Builder setAnswerGenerationSpec(AnswerQueryRequest.AnswerGenerationSpec.Builder builderForValue)

Answer generation specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.AnswerGenerationSpec answer_generation_spec = 7;

Parameter
Name Description
builderForValue AnswerQueryRequest.AnswerGenerationSpec.Builder
Returns
Type Description
AnswerQueryRequest.Builder

setAsynchronousMode(boolean value) (deprecated)

public AnswerQueryRequest.Builder setAsynchronousMode(boolean value)

Deprecated. google.cloud.discoveryengine.v1beta.AnswerQueryRequest.asynchronous_mode is deprecated. See google/cloud/discoveryengine/v1beta/conversational_search_service.proto;l=861

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 or ConversationalSearchService.GetSession method.

bool asynchronous_mode = 10 [deprecated = true];

Parameter
Name Description
value boolean

The asynchronousMode to set.

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public AnswerQueryRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AnswerQueryRequest.Builder
Overrides

setGroundingSpec(AnswerQueryRequest.GroundingSpec value)

public AnswerQueryRequest.Builder setGroundingSpec(AnswerQueryRequest.GroundingSpec value)

Optional. Grounding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.GroundingSpec grounding_spec = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value AnswerQueryRequest.GroundingSpec
Returns
Type Description
AnswerQueryRequest.Builder

setGroundingSpec(AnswerQueryRequest.GroundingSpec.Builder builderForValue)

public AnswerQueryRequest.Builder setGroundingSpec(AnswerQueryRequest.GroundingSpec.Builder builderForValue)

Optional. Grounding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.GroundingSpec grounding_spec = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue AnswerQueryRequest.GroundingSpec.Builder
Returns
Type Description
AnswerQueryRequest.Builder

setQuery(Query value)

public AnswerQueryRequest.Builder setQuery(Query value)

Required. Current user query.

.google.cloud.discoveryengine.v1beta.Query query = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Query
Returns
Type Description
AnswerQueryRequest.Builder

setQuery(Query.Builder builderForValue)

public AnswerQueryRequest.Builder setQuery(Query.Builder builderForValue)

Required. Current user query.

.google.cloud.discoveryengine.v1beta.Query query = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue Query.Builder
Returns
Type Description
AnswerQueryRequest.Builder

setQueryUnderstandingSpec(AnswerQueryRequest.QueryUnderstandingSpec value)

public AnswerQueryRequest.Builder setQueryUnderstandingSpec(AnswerQueryRequest.QueryUnderstandingSpec value)

Query understanding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9;

Parameter
Name Description
value AnswerQueryRequest.QueryUnderstandingSpec
Returns
Type Description
AnswerQueryRequest.Builder

setQueryUnderstandingSpec(AnswerQueryRequest.QueryUnderstandingSpec.Builder builderForValue)

public AnswerQueryRequest.Builder setQueryUnderstandingSpec(AnswerQueryRequest.QueryUnderstandingSpec.Builder builderForValue)

Query understanding specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.QueryUnderstandingSpec query_understanding_spec = 9;

Parameter
Name Description
builderForValue AnswerQueryRequest.QueryUnderstandingSpec.Builder
Returns
Type Description
AnswerQueryRequest.Builder

setRelatedQuestionsSpec(AnswerQueryRequest.RelatedQuestionsSpec value)

public AnswerQueryRequest.Builder setRelatedQuestionsSpec(AnswerQueryRequest.RelatedQuestionsSpec value)

Related questions specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5;

Parameter
Name Description
value AnswerQueryRequest.RelatedQuestionsSpec
Returns
Type Description
AnswerQueryRequest.Builder

setRelatedQuestionsSpec(AnswerQueryRequest.RelatedQuestionsSpec.Builder builderForValue)

public AnswerQueryRequest.Builder setRelatedQuestionsSpec(AnswerQueryRequest.RelatedQuestionsSpec.Builder builderForValue)

Related questions specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.RelatedQuestionsSpec related_questions_spec = 5;

Parameter
Name Description
builderForValue AnswerQueryRequest.RelatedQuestionsSpec.Builder
Returns
Type Description
AnswerQueryRequest.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public AnswerQueryRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
AnswerQueryRequest.Builder
Overrides

setSafetySpec(AnswerQueryRequest.SafetySpec value)

public AnswerQueryRequest.Builder setSafetySpec(AnswerQueryRequest.SafetySpec value)

Model specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SafetySpec safety_spec = 4;

Parameter
Name Description
value AnswerQueryRequest.SafetySpec
Returns
Type Description
AnswerQueryRequest.Builder

setSafetySpec(AnswerQueryRequest.SafetySpec.Builder builderForValue)

public AnswerQueryRequest.Builder setSafetySpec(AnswerQueryRequest.SafetySpec.Builder builderForValue)

Model specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SafetySpec safety_spec = 4;

Parameter
Name Description
builderForValue AnswerQueryRequest.SafetySpec.Builder
Returns
Type Description
AnswerQueryRequest.Builder

setSearchSpec(AnswerQueryRequest.SearchSpec value)

public AnswerQueryRequest.Builder setSearchSpec(AnswerQueryRequest.SearchSpec value)

Search specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SearchSpec search_spec = 8;

Parameter
Name Description
value AnswerQueryRequest.SearchSpec
Returns
Type Description
AnswerQueryRequest.Builder

setSearchSpec(AnswerQueryRequest.SearchSpec.Builder builderForValue)

public AnswerQueryRequest.Builder setSearchSpec(AnswerQueryRequest.SearchSpec.Builder builderForValue)

Search specification.

.google.cloud.discoveryengine.v1beta.AnswerQueryRequest.SearchSpec search_spec = 8;

Parameter
Name Description
builderForValue AnswerQueryRequest.SearchSpec.Builder
Returns
Type Description
AnswerQueryRequest.Builder

setServingConfig(String value)

public AnswerQueryRequest.Builder setServingConfig(String value)

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.

string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The servingConfig to set.

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.

setServingConfigBytes(ByteString value)

public AnswerQueryRequest.Builder setServingConfigBytes(ByteString value)

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.

string serving_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for servingConfig to set.

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.

setSession(String value)

public AnswerQueryRequest.Builder setSession(String value)

The session resource name. Not required.

When session field is not set, the API is in sessionless mode.

We support auto session mode: users can use the wildcard symbol - as session ID. A new ID will be automatically generated and assigned.

string session = 3 [(.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The session to set.

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.

setSessionBytes(ByteString value)

public AnswerQueryRequest.Builder setSessionBytes(ByteString value)

The session resource name. Not required.

When session field is not set, the API is in sessionless mode.

We support auto session mode: users can use the wildcard symbol - as session ID. A new ID will be automatically generated and assigned.

string session = 3 [(.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for session to set.

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final AnswerQueryRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AnswerQueryRequest.Builder
Overrides

setUserPseudoId(String value)

public AnswerQueryRequest.Builder setUserPseudoId(String value)

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.

string user_pseudo_id = 12;

Parameter
Name Description
value String

The userPseudoId to set.

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.

setUserPseudoIdBytes(ByteString value)

public AnswerQueryRequest.Builder setUserPseudoIdBytes(ByteString value)

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.

string user_pseudo_id = 12;

Parameter
Name Description
value ByteString

The bytes for userPseudoId to set.

Returns
Type Description
AnswerQueryRequest.Builder

This builder for chaining.