Class SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder (0.37.0)

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

A specification for configuring the extractive content in a search response.

Protobuf type google.cloud.discoveryengine.v1alpha.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 maximum number of extractive answers returned in each search result.

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

If the number of matching answers is less than the max_extractive_answer_count, return all of the answers. Otherwise, return the max_extractive_answer_count.

At most five answers are 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. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT.

An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive 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 max_extractive_segment_count, return all of the segments. Otherwise, return the max_extractive_segment_count.

int32 max_extractive_segment_count = 2;

Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

This builder for chaining.

clearNumNextSegments()

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder clearNumNextSegments()

Return at most num_next_segments segments after each selected segments.

int32 num_next_segments = 5;

Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

This builder for chaining.

clearNumPreviousSegments()

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder clearNumPreviousSegments()

Specifies whether to also include the adjacent from each selected segments. Return at most num_previous_segments segments before each selected segments.

int32 num_previous_segments = 4;

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

clearReturnExtractiveSegmentScore()

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder clearReturnExtractiveSegmentScore()

Specifies whether to return the confidence score from the extractive segments in each search result. The default value is false.

Note: this is a priavte preview feature and only works for allowlisted users, please reach out to Cloud Support team if you want to use it.

bool return_extractive_segment_score = 3;

Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

This builder for chaining.

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 maximum number of extractive answers returned in each search result.

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

If the number of matching answers is less than the max_extractive_answer_count, return all of the answers. Otherwise, return the max_extractive_answer_count.

At most five answers are 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. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT.

An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive 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 max_extractive_segment_count, return all of the segments. Otherwise, return the max_extractive_segment_count.

int32 max_extractive_segment_count = 2;

Returns
TypeDescription
int

The maxExtractiveSegmentCount.

getNumNextSegments()

public int getNumNextSegments()

Return at most num_next_segments segments after each selected segments.

int32 num_next_segments = 5;

Returns
TypeDescription
int

The numNextSegments.

getNumPreviousSegments()

public int getNumPreviousSegments()

Specifies whether to also include the adjacent from each selected segments. Return at most num_previous_segments segments before each selected segments.

int32 num_previous_segments = 4;

Returns
TypeDescription
int

The numPreviousSegments.

getReturnExtractiveSegmentScore()

public boolean getReturnExtractiveSegmentScore()

Specifies whether to return the confidence score from the extractive segments in each search result. The default value is false.

Note: this is a priavte preview feature and only works for allowlisted users, please reach out to Cloud Support team if you want to use it.

bool return_extractive_segment_score = 3;

Returns
TypeDescription
boolean

The returnExtractiveSegmentScore.

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 maximum number of extractive answers returned in each search result.

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

If the number of matching answers is less than the max_extractive_answer_count, return all of the answers. Otherwise, return the max_extractive_answer_count.

At most five answers are 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. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT.

An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive 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 max_extractive_segment_count, return all of the segments. Otherwise, return the max_extractive_segment_count.

int32 max_extractive_segment_count = 2;

Parameter
NameDescription
valueint

The maxExtractiveSegmentCount to set.

Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

This builder for chaining.

setNumNextSegments(int value)

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

Return at most num_next_segments segments after each selected segments.

int32 num_next_segments = 5;

Parameter
NameDescription
valueint

The numNextSegments to set.

Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

This builder for chaining.

setNumPreviousSegments(int value)

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

Specifies whether to also include the adjacent from each selected segments. Return at most num_previous_segments segments before each selected segments.

int32 num_previous_segments = 4;

Parameter
NameDescription
valueint

The numPreviousSegments 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

setReturnExtractiveSegmentScore(boolean value)

public SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder setReturnExtractiveSegmentScore(boolean value)

Specifies whether to return the confidence score from the extractive segments in each search result. The default value is false.

Note: this is a priavte preview feature and only works for allowlisted users, please reach out to Cloud Support team if you want to use it.

bool return_extractive_segment_score = 3;

Parameter
NameDescription
valueboolean

The returnExtractiveSegmentScore to set.

Returns
TypeDescription
SearchRequest.ContentSearchSpec.ExtractiveContentSpec.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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