Class SearchRequest.SessionSpec.Builder

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

public static final class SearchRequest.SessionSpec.Builder extends com.google.protobuf.GeneratedMessage.Builder<SearchRequest.SessionSpec.Builder> 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
  • 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.Builder<SearchRequest.SessionSpec.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<SearchRequest.SessionSpec.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<SearchRequest.SessionSpec.Builder>
    • getDefaultInstanceForType

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

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

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

      public SearchRequest.SessionSpec.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SearchRequest.SessionSpec.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<SearchRequest.SessionSpec.Builder>
    • mergeFrom

      public SearchRequest.SessionSpec.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SearchRequest.SessionSpec.Builder>
      Throws:
      IOException
    • 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.
    • setQueryId

      public SearchRequest.SessionSpec.Builder setQueryId(String value)
       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;
      Parameters:
      value - The queryId to set.
      Returns:
      This builder for chaining.
    • clearQueryId

      public SearchRequest.SessionSpec.Builder clearQueryId()
       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:
      This builder for chaining.
    • setQueryIdBytes

      public SearchRequest.SessionSpec.Builder setQueryIdBytes(com.google.protobuf.ByteString value)
       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;
      Parameters:
      value - The bytes for queryId to set.
      Returns:
      This builder for chaining.
    • 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.
    • setSearchResultPersistenceCount

      public SearchRequest.SessionSpec.Builder setSearchResultPersistenceCount(int value)
       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;
      Parameters:
      value - The searchResultPersistenceCount to set.
      Returns:
      This builder for chaining.
    • clearSearchResultPersistenceCount

      public SearchRequest.SessionSpec.Builder clearSearchResultPersistenceCount()
       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;
      Returns:
      This builder for chaining.