Class SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder (0.17.0)

public static final class SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder extends GeneratedMessageV3.Builder<SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder> implements SearchRequest.ContentSearchSpec.ExtractiveContentSpecOrBuilder

The specification that configs the extractive content in search results.

Protobuf type google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ExtractiveContentSpec

Inheritance

Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides

build()

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec build()
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec

buildPartial()

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec buildPartial()
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec

clear()

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder clear()
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides

clearMaxExtractiveAnswerCount()

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder clearMaxExtractiveAnswerCount()

The max number of extractive answers returned in each search result.

An extractive answer is a verbatim answer extracted from the original document, which provides precise and contextually relevant answer to the search query.

If the number of matching answers is less than the extractive_answer_count, return all of the answers; otherwise, return the extractive_answer_count.

At most 5 answers will be returned for each SearchResult.

int32 max_extractive_answer_count = 1;

Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

This builder for chaining.

clearMaxExtractiveSegmentCount()

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder clearMaxExtractiveSegmentCount()

The max number of extractive segments returned in each search result.

An extractive segment is a text segment extracted from the original document which is relevant to the search query and in general more verbose than an extrative answer. The segment could then be used as input for LLMs to generate summaries and answers.

If the number of matching segments is less than the max_extractive_segment_count, return all of the segments; otherwise, return the max_extractive_segment_count.

Currently one segment will be returned for each SearchResult.

int32 max_extractive_segment_count = 2;

Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides

clone()

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder clone()
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides

getDefaultInstanceForType()

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec getDefaultInstanceForType()
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMaxExtractiveAnswerCount()

public int getMaxExtractiveAnswerCount()

The max number of extractive answers returned in each search result.

An extractive answer is a verbatim answer extracted from the original document, which provides precise and contextually relevant answer to the search query.

If the number of matching answers is less than the extractive_answer_count, return all of the answers; otherwise, return the extractive_answer_count.

At most 5 answers will be returned for each SearchResult.

int32 max_extractive_answer_count = 1;

Returns
TypeDescription
int

The maxExtractiveAnswerCount.

getMaxExtractiveSegmentCount()

public int getMaxExtractiveSegmentCount()

The max number of extractive segments returned in each search result.

An extractive segment is a text segment extracted from the original document which is relevant to the search query and in general more verbose than an extrative answer. The segment could then be used as input for LLMs to generate summaries and answers.

If the number of matching segments is less than the max_extractive_segment_count, return all of the segments; otherwise, return the max_extractive_segment_count.

Currently one segment will be returned for each SearchResult.

int32 max_extractive_segment_count = 2;

Returns
TypeDescription
int

The maxExtractiveSegmentCount.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(SearchRequest.ContentSearchSpec.ExtractiveContentSpec other)

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder mergeFrom(SearchRequest.ContentSearchSpec.ExtractiveContentSpec other)
Parameter
NameDescription
otherSearchRequest.ContentSearchSpec.ExtractiveContentSpec
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides

setMaxExtractiveAnswerCount(int value)

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder setMaxExtractiveAnswerCount(int value)

The max number of extractive answers returned in each search result.

An extractive answer is a verbatim answer extracted from the original document, which provides precise and contextually relevant answer to the search query.

If the number of matching answers is less than the extractive_answer_count, return all of the answers; otherwise, return the extractive_answer_count.

At most 5 answers will be returned for each SearchResult.

int32 max_extractive_answer_count = 1;

Parameter
NameDescription
valueint

The maxExtractiveAnswerCount to set.

Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

This builder for chaining.

setMaxExtractiveSegmentCount(int value)

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder setMaxExtractiveSegmentCount(int value)

The max number of extractive segments returned in each search result.

An extractive segment is a text segment extracted from the original document which is relevant to the search query and in general more verbose than an extrative answer. The segment could then be used as input for LLMs to generate summaries and answers.

If the number of matching segments is less than the max_extractive_segment_count, return all of the segments; otherwise, return the max_extractive_segment_count.

Currently one segment will be returned for each SearchResult.

int32 max_extractive_segment_count = 2;

Parameter
NameDescription
valueint

The maxExtractiveSegmentCount to set.

Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

This builder for chaining.

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

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder
Overrides