Class SearchRequest.SessionSpec

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.discoveryengine.v1beta.SearchRequest.SessionSpec
All Implemented Interfaces:
SearchRequest.SessionSpecOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable
Enclosing class:
SearchRequest

public static final class SearchRequest.SessionSpec extends com.google.protobuf.GeneratedMessage 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
See Also:
  • Field Details

    • QUERY_ID_FIELD_NUMBER

      public static final int QUERY_ID_FIELD_NUMBER
      See Also:
    • SEARCH_RESULT_PERSISTENCE_COUNT_FIELD_NUMBER

      public static final int SEARCH_RESULT_PERSISTENCE_COUNT_FIELD_NUMBER
      See Also:
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • 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;
      Specified by:
      getQueryId in interface SearchRequest.SessionSpecOrBuilder
      Returns:
      The queryId.
    • getQueryIdBytes

      public com.google.protobuf.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;
      Specified by:
      getQueryIdBytes in interface SearchRequest.SessionSpecOrBuilder
      Returns:
      The bytes for queryId.
    • 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][google.cloud.discoveryengine.v1beta.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;
      Specified by:
      hasSearchResultPersistenceCount in interface SearchRequest.SessionSpecOrBuilder
      Returns:
      Whether the searchResultPersistenceCount field is set.
    • 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][google.cloud.discoveryengine.v1beta.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;
      Specified by:
      getSearchResultPersistenceCount in interface SearchRequest.SessionSpecOrBuilder
      Returns:
      The searchResultPersistenceCount.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static SearchRequest.SessionSpec parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static SearchRequest.SessionSpec parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static SearchRequest.SessionSpec parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static SearchRequest.SessionSpec parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static SearchRequest.SessionSpec parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static SearchRequest.SessionSpec parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static SearchRequest.SessionSpec parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static SearchRequest.SessionSpec parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static SearchRequest.SessionSpec parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static SearchRequest.SessionSpec parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static SearchRequest.SessionSpec parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static SearchRequest.SessionSpec parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public SearchRequest.SessionSpec.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static SearchRequest.SessionSpec.Builder newBuilder()
    • newBuilder

      public static SearchRequest.SessionSpec.Builder newBuilder(SearchRequest.SessionSpec prototype)
    • toBuilder

      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected SearchRequest.SessionSpec.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static SearchRequest.SessionSpec getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<SearchRequest.SessionSpec> parser()
    • getParserForType

      public com.google.protobuf.Parser<SearchRequest.SessionSpec> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public SearchRequest.SessionSpec getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder