Class RankRequest.Builder (0.40.0)

public static final class RankRequest.Builder extends GeneratedMessageV3.Builder<RankRequest.Builder> implements RankRequestOrBuilder

Request message for RankService.Rank method.

Protobuf type google.cloud.discoveryengine.v1beta.RankRequest

Static Methods

getDescriptor()

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

Methods

addAllRecords(Iterable<? extends RankingRecord> values)

public RankRequest.Builder addAllRecords(Iterable<? extends RankingRecord> values)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<? extends com.google.cloud.discoveryengine.v1beta.RankingRecord>
Returns
Type Description
RankRequest.Builder

addRecords(RankingRecord value)

public RankRequest.Builder addRecords(RankingRecord value)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value RankingRecord
Returns
Type Description
RankRequest.Builder

addRecords(RankingRecord.Builder builderForValue)

public RankRequest.Builder addRecords(RankingRecord.Builder builderForValue)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue RankingRecord.Builder
Returns
Type Description
RankRequest.Builder

addRecords(int index, RankingRecord value)

public RankRequest.Builder addRecords(int index, RankingRecord value)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
value RankingRecord
Returns
Type Description
RankRequest.Builder

addRecords(int index, RankingRecord.Builder builderForValue)

public RankRequest.Builder addRecords(int index, RankingRecord.Builder builderForValue)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
builderForValue RankingRecord.Builder
Returns
Type Description
RankRequest.Builder

addRecordsBuilder()

public RankingRecord.Builder addRecordsBuilder()

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
RankingRecord.Builder

addRecordsBuilder(int index)

public RankingRecord.Builder addRecordsBuilder(int index)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
RankingRecord.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public RankRequest build()
Returns
Type Description
RankRequest

buildPartial()

public RankRequest buildPartial()
Returns
Type Description
RankRequest

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearIgnoreRecordDetailsInResponse()

public RankRequest.Builder clearIgnoreRecordDetailsInResponse()

If true, the response will contain only record ID and score. By default, it is false, the response will contain record details.

bool ignore_record_details_in_response = 6;

Returns
Type Description
RankRequest.Builder

This builder for chaining.

clearModel()

public RankRequest.Builder clearModel()

The identifier of the model to use. It is one of:

  • semantic-ranker-512@latest: Semantic ranking model with maxiumn input token size 512.

    It is set to semantic-ranker-512@latest by default if unspecified.

string model = 2;

Returns
Type Description
RankRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearQuery()

public RankRequest.Builder clearQuery()

The query to use.

string query = 4;

Returns
Type Description
RankRequest.Builder

This builder for chaining.

clearRankingConfig()

public RankRequest.Builder clearRankingConfig()

Required. The resource name of the rank service config, such as projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config.

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

Returns
Type Description
RankRequest.Builder

This builder for chaining.

clearRecords()

public RankRequest.Builder clearRecords()

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
RankRequest.Builder

clearTopN()

public RankRequest.Builder clearTopN()

The number of results to return. If this is unset or no bigger than zero, returns all results.

int32 top_n = 3;

Returns
Type Description
RankRequest.Builder

This builder for chaining.

clone()

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

getDefaultInstanceForType()

public RankRequest getDefaultInstanceForType()
Returns
Type Description
RankRequest

getDescriptorForType()

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

getIgnoreRecordDetailsInResponse()

public boolean getIgnoreRecordDetailsInResponse()

If true, the response will contain only record ID and score. By default, it is false, the response will contain record details.

bool ignore_record_details_in_response = 6;

Returns
Type Description
boolean

The ignoreRecordDetailsInResponse.

getModel()

public String getModel()

The identifier of the model to use. It is one of:

  • semantic-ranker-512@latest: Semantic ranking model with maxiumn input token size 512.

    It is set to semantic-ranker-512@latest by default if unspecified.

string model = 2;

Returns
Type Description
String

The model.

getModelBytes()

public ByteString getModelBytes()

The identifier of the model to use. It is one of:

  • semantic-ranker-512@latest: Semantic ranking model with maxiumn input token size 512.

    It is set to semantic-ranker-512@latest by default if unspecified.

string model = 2;

Returns
Type Description
ByteString

The bytes for model.

getQuery()

public String getQuery()

The query to use.

string query = 4;

Returns
Type Description
String

The query.

getQueryBytes()

public ByteString getQueryBytes()

The query to use.

string query = 4;

Returns
Type Description
ByteString

The bytes for query.

getRankingConfig()

public String getRankingConfig()

Required. The resource name of the rank service config, such as projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config.

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

Returns
Type Description
String

The rankingConfig.

getRankingConfigBytes()

public ByteString getRankingConfigBytes()

Required. The resource name of the rank service config, such as projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config.

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

Returns
Type Description
ByteString

The bytes for rankingConfig.

getRecords(int index)

public RankingRecord getRecords(int index)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
RankingRecord

getRecordsBuilder(int index)

public RankingRecord.Builder getRecordsBuilder(int index)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
RankingRecord.Builder

getRecordsBuilderList()

public List<RankingRecord.Builder> getRecordsBuilderList()

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<Builder>

getRecordsCount()

public int getRecordsCount()

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

getRecordsList()

public List<RankingRecord> getRecordsList()

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<RankingRecord>

getRecordsOrBuilder(int index)

public RankingRecordOrBuilder getRecordsOrBuilder(int index)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
RankingRecordOrBuilder

getRecordsOrBuilderList()

public List<? extends RankingRecordOrBuilder> getRecordsOrBuilderList()

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<? extends com.google.cloud.discoveryengine.v1beta.RankingRecordOrBuilder>

getTopN()

public int getTopN()

The number of results to return. If this is unset or no bigger than zero, returns all results.

int32 top_n = 3;

Returns
Type Description
int

The topN.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(RankRequest other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

removeRecords(int index)

public RankRequest.Builder removeRecords(int index)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
RankRequest.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setIgnoreRecordDetailsInResponse(boolean value)

public RankRequest.Builder setIgnoreRecordDetailsInResponse(boolean value)

If true, the response will contain only record ID and score. By default, it is false, the response will contain record details.

bool ignore_record_details_in_response = 6;

Parameter
Name Description
value boolean

The ignoreRecordDetailsInResponse to set.

Returns
Type Description
RankRequest.Builder

This builder for chaining.

setModel(String value)

public RankRequest.Builder setModel(String value)

The identifier of the model to use. It is one of:

  • semantic-ranker-512@latest: Semantic ranking model with maxiumn input token size 512.

    It is set to semantic-ranker-512@latest by default if unspecified.

string model = 2;

Parameter
Name Description
value String

The model to set.

Returns
Type Description
RankRequest.Builder

This builder for chaining.

setModelBytes(ByteString value)

public RankRequest.Builder setModelBytes(ByteString value)

The identifier of the model to use. It is one of:

  • semantic-ranker-512@latest: Semantic ranking model with maxiumn input token size 512.

    It is set to semantic-ranker-512@latest by default if unspecified.

string model = 2;

Parameter
Name Description
value ByteString

The bytes for model to set.

Returns
Type Description
RankRequest.Builder

This builder for chaining.

setQuery(String value)

public RankRequest.Builder setQuery(String value)

The query to use.

string query = 4;

Parameter
Name Description
value String

The query to set.

Returns
Type Description
RankRequest.Builder

This builder for chaining.

setQueryBytes(ByteString value)

public RankRequest.Builder setQueryBytes(ByteString value)

The query to use.

string query = 4;

Parameter
Name Description
value ByteString

The bytes for query to set.

Returns
Type Description
RankRequest.Builder

This builder for chaining.

setRankingConfig(String value)

public RankRequest.Builder setRankingConfig(String value)

Required. The resource name of the rank service config, such as projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config.

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

Parameter
Name Description
value String

The rankingConfig to set.

Returns
Type Description
RankRequest.Builder

This builder for chaining.

setRankingConfigBytes(ByteString value)

public RankRequest.Builder setRankingConfigBytes(ByteString value)

Required. The resource name of the rank service config, such as projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config.

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

Parameter
Name Description
value ByteString

The bytes for rankingConfig to set.

Returns
Type Description
RankRequest.Builder

This builder for chaining.

setRecords(int index, RankingRecord value)

public RankRequest.Builder setRecords(int index, RankingRecord value)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
value RankingRecord
Returns
Type Description
RankRequest.Builder

setRecords(int index, RankingRecord.Builder builderForValue)

public RankRequest.Builder setRecords(int index, RankingRecord.Builder builderForValue)

Required. A list of records to rank. At most 200 records to rank.

repeated .google.cloud.discoveryengine.v1beta.RankingRecord records = 5 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int
builderForValue RankingRecord.Builder
Returns
Type Description
RankRequest.Builder

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

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

setTopN(int value)

public RankRequest.Builder setTopN(int value)

The number of results to return. If this is unset or no bigger than zero, returns all results.

int32 top_n = 3;

Parameter
Name Description
value int

The topN to set.

Returns
Type Description
RankRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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