Class SearchRequest.SessionSpec (0.51.0)

public static final class SearchRequest.SessionSpec extends GeneratedMessageV3 implements SearchRequest.SessionSpecOrBuilder

Session specification.

Multi-turn Search feature is currently at private GA stage. Please use v1alpha or v1beta version instead before we launch this feature to public GA. Or ask for allowlisting through Google Support team.

Protobuf type google.cloud.discoveryengine.v1beta.SearchRequest.SessionSpec

Static Fields

QUERY_ID_FIELD_NUMBER

public static final int QUERY_ID_FIELD_NUMBER
Field Value
Type Description
int

SEARCH_RESULT_PERSISTENCE_COUNT_FIELD_NUMBER

public static final int SEARCH_RESULT_PERSISTENCE_COUNT_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static SearchRequest.SessionSpec getDefaultInstance()
Returns
Type Description
SearchRequest.SessionSpec

getDescriptor()

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

newBuilder()

public static SearchRequest.SessionSpec.Builder newBuilder()
Returns
Type Description
SearchRequest.SessionSpec.Builder

newBuilder(SearchRequest.SessionSpec prototype)

public static SearchRequest.SessionSpec.Builder newBuilder(SearchRequest.SessionSpec prototype)
Parameter
Name Description
prototype SearchRequest.SessionSpec
Returns
Type Description
SearchRequest.SessionSpec.Builder

parseDelimitedFrom(InputStream input)

public static SearchRequest.SessionSpec parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.SessionSpec parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static SearchRequest.SessionSpec parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.SessionSpec parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static SearchRequest.SessionSpec parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.SessionSpec parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static SearchRequest.SessionSpec parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.SessionSpec parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static SearchRequest.SessionSpec parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.SessionSpec parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static SearchRequest.SessionSpec parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static SearchRequest.SessionSpec parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
SearchRequest.SessionSpec
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<SearchRequest.SessionSpec> parser()
Returns
Type Description
Parser<SessionSpec>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public SearchRequest.SessionSpec getDefaultInstanceForType()
Returns
Type Description
SearchRequest.SessionSpec

getParserForType()

public Parser<SearchRequest.SessionSpec> getParserForType()
Returns
Type Description
Parser<SessionSpec>
Overrides

getQueryId()

public String getQueryId()

If set, the search result gets stored to the "turn" specified by this query ID.

Example: Let's say the session looks like this: session { name: ".../sessions/xxx" turns { query { text: "What is foo?" query_id: ".../questions/yyy" } answer: "Foo is ..." } turns { query { text: "How about bar then?" query_id: ".../questions/zzz" } } }

The user can call /search API with a request like this:

session: ".../sessions/xxx"
session_spec { query_id: ".../questions/zzz" }

Then, the API stores the search result, associated with the last turn. The stored search result can be used by a subsequent /answer API call (with the session ID and the query ID specified). Also, it is possible to call /search and /answer in parallel with the same session ID & query ID.

string query_id = 1;

Returns
Type Description
String

The queryId.

getQueryIdBytes()

public ByteString getQueryIdBytes()

If set, the search result gets stored to the "turn" specified by this query ID.

Example: Let's say the session looks like this: session { name: ".../sessions/xxx" turns { query { text: "What is foo?" query_id: ".../questions/yyy" } answer: "Foo is ..." } turns { query { text: "How about bar then?" query_id: ".../questions/zzz" } } }

The user can call /search API with a request like this:

session: ".../sessions/xxx"
session_spec { query_id: ".../questions/zzz" }

Then, the API stores the search result, associated with the last turn. The stored search result can be used by a subsequent /answer API call (with the session ID and the query ID specified). Also, it is possible to call /search and /answer in parallel with the same session ID & query ID.

string query_id = 1;

Returns
Type Description
ByteString

The bytes for queryId.

getSearchResultPersistenceCount()

public int getSearchResultPersistenceCount()

The number of top search results to persist. The persisted search results can be used for the subsequent /answer api call.

This field is simliar to the summary_result_count field in SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count.

At most 10 results for documents mode, or 50 for chunks mode.

optional int32 search_result_persistence_count = 2;

Returns
Type Description
int

The searchResultPersistenceCount.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hasSearchResultPersistenceCount()

public boolean hasSearchResultPersistenceCount()

The number of top search results to persist. The persisted search results can be used for the subsequent /answer api call.

This field is simliar to the summary_result_count field in SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count.

At most 10 results for documents mode, or 50 for chunks mode.

optional int32 search_result_persistence_count = 2;

Returns
Type Description
boolean

Whether the searchResultPersistenceCount field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public SearchRequest.SessionSpec.Builder newBuilderForType()
Returns
Type Description
SearchRequest.SessionSpec.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected SearchRequest.SessionSpec.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
SearchRequest.SessionSpec.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public SearchRequest.SessionSpec.Builder toBuilder()
Returns
Type Description
SearchRequest.SessionSpec.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException