Class Session.Turn

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.discoveryengine.v1.Session.Turn
All Implemented Interfaces:
Session.TurnOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable
Enclosing class:
Session

public static final class Session.Turn extends com.google.protobuf.GeneratedMessage implements Session.TurnOrBuilder
 Represents a turn, including a query from the user and a
 answer from service.
 
Protobuf type google.cloud.discoveryengine.v1.Session.Turn
See Also:
  • Field Details

    • QUERY_FIELD_NUMBER

      public static final int QUERY_FIELD_NUMBER
      See Also:
    • ANSWER_FIELD_NUMBER

      public static final int ANSWER_FIELD_NUMBER
      See Also:
    • DETAILED_ANSWER_FIELD_NUMBER

      public static final int DETAILED_ANSWER_FIELD_NUMBER
      See Also:
    • DETAILED_ASSIST_ANSWER_FIELD_NUMBER

      public static final int DETAILED_ASSIST_ANSWER_FIELD_NUMBER
      See Also:
    • QUERY_CONFIG_FIELD_NUMBER

      public static final int QUERY_CONFIG_FIELD_NUMBER
      See Also:
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • hasQuery

      public boolean hasQuery()
       Optional. The user query. May not be set if this turn is merely
       regenerating an answer to a different turn
       
      .google.cloud.discoveryengine.v1.Query query = 1 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasQuery in interface Session.TurnOrBuilder
      Returns:
      Whether the query field is set.
    • getQuery

      public Query getQuery()
       Optional. The user query. May not be set if this turn is merely
       regenerating an answer to a different turn
       
      .google.cloud.discoveryengine.v1.Query query = 1 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getQuery in interface Session.TurnOrBuilder
      Returns:
      The query.
    • getQueryOrBuilder

      public QueryOrBuilder getQueryOrBuilder()
       Optional. The user query. May not be set if this turn is merely
       regenerating an answer to a different turn
       
      .google.cloud.discoveryengine.v1.Query query = 1 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getQueryOrBuilder in interface Session.TurnOrBuilder
    • getAnswer

      public String getAnswer()
       Optional. The resource name of the answer to the user query.
      
       Only set if the answer generation (/answer API call) happened in this
       turn.
       
      string answer = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
      Specified by:
      getAnswer in interface Session.TurnOrBuilder
      Returns:
      The answer.
    • getAnswerBytes

      public com.google.protobuf.ByteString getAnswerBytes()
       Optional. The resource name of the answer to the user query.
      
       Only set if the answer generation (/answer API call) happened in this
       turn.
       
      string answer = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... }
      Specified by:
      getAnswerBytes in interface Session.TurnOrBuilder
      Returns:
      The bytes for answer.
    • hasDetailedAnswer

      public boolean hasDetailedAnswer()
       Output only. In
       [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession]
       API, if
       [GetSessionRequest.include_answer_details][google.cloud.discoveryengine.v1.GetSessionRequest.include_answer_details]
       is set to true, this field will be populated when getting answer query
       session.
       
      .google.cloud.discoveryengine.v1.Answer detailed_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasDetailedAnswer in interface Session.TurnOrBuilder
      Returns:
      Whether the detailedAnswer field is set.
    • getDetailedAnswer

      public Answer getDetailedAnswer()
       Output only. In
       [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession]
       API, if
       [GetSessionRequest.include_answer_details][google.cloud.discoveryengine.v1.GetSessionRequest.include_answer_details]
       is set to true, this field will be populated when getting answer query
       session.
       
      .google.cloud.discoveryengine.v1.Answer detailed_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDetailedAnswer in interface Session.TurnOrBuilder
      Returns:
      The detailedAnswer.
    • getDetailedAnswerOrBuilder

      public AnswerOrBuilder getDetailedAnswerOrBuilder()
       Output only. In
       [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession]
       API, if
       [GetSessionRequest.include_answer_details][google.cloud.discoveryengine.v1.GetSessionRequest.include_answer_details]
       is set to true, this field will be populated when getting answer query
       session.
       
      .google.cloud.discoveryengine.v1.Answer detailed_answer = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDetailedAnswerOrBuilder in interface Session.TurnOrBuilder
    • hasDetailedAssistAnswer

      public boolean hasDetailedAssistAnswer()
       Output only. In
       [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession]
       API, if
       [GetSessionRequest.include_answer_details][google.cloud.discoveryengine.v1.GetSessionRequest.include_answer_details]
       is set to true, this field will be populated when getting assistant
       session.
       
      .google.cloud.discoveryengine.v1.AssistAnswer detailed_assist_answer = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      hasDetailedAssistAnswer in interface Session.TurnOrBuilder
      Returns:
      Whether the detailedAssistAnswer field is set.
    • getDetailedAssistAnswer

      public AssistAnswer getDetailedAssistAnswer()
       Output only. In
       [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession]
       API, if
       [GetSessionRequest.include_answer_details][google.cloud.discoveryengine.v1.GetSessionRequest.include_answer_details]
       is set to true, this field will be populated when getting assistant
       session.
       
      .google.cloud.discoveryengine.v1.AssistAnswer detailed_assist_answer = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDetailedAssistAnswer in interface Session.TurnOrBuilder
      Returns:
      The detailedAssistAnswer.
    • getDetailedAssistAnswerOrBuilder

      public AssistAnswerOrBuilder getDetailedAssistAnswerOrBuilder()
       Output only. In
       [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1.ConversationalSearchService.GetSession]
       API, if
       [GetSessionRequest.include_answer_details][google.cloud.discoveryengine.v1.GetSessionRequest.include_answer_details]
       is set to true, this field will be populated when getting assistant
       session.
       
      .google.cloud.discoveryengine.v1.AssistAnswer detailed_assist_answer = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getDetailedAssistAnswerOrBuilder in interface Session.TurnOrBuilder
    • getQueryConfigCount

      public int getQueryConfigCount()
      Description copied from interface: Session.TurnOrBuilder
       Optional. Represents metadata related to the query config, for example
       LLM model and version used, model parameters (temperature, grounding
       parameters, etc.). The prefix "google." is reserved for Google-developed
       functionality.
       
      map<string, string> query_config = 16 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getQueryConfigCount in interface Session.TurnOrBuilder
    • containsQueryConfig

      public boolean containsQueryConfig(String key)
       Optional. Represents metadata related to the query config, for example
       LLM model and version used, model parameters (temperature, grounding
       parameters, etc.). The prefix "google." is reserved for Google-developed
       functionality.
       
      map<string, string> query_config = 16 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      containsQueryConfig in interface Session.TurnOrBuilder
    • getQueryConfig

      @Deprecated public Map<String,String> getQueryConfig()
      Deprecated.
      Use getQueryConfigMap() instead.
      Specified by:
      getQueryConfig in interface Session.TurnOrBuilder
    • getQueryConfigMap

      public Map<String,String> getQueryConfigMap()
       Optional. Represents metadata related to the query config, for example
       LLM model and version used, model parameters (temperature, grounding
       parameters, etc.). The prefix "google." is reserved for Google-developed
       functionality.
       
      map<string, string> query_config = 16 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getQueryConfigMap in interface Session.TurnOrBuilder
    • getQueryConfigOrDefault

      public String getQueryConfigOrDefault(String key, String defaultValue)
       Optional. Represents metadata related to the query config, for example
       LLM model and version used, model parameters (temperature, grounding
       parameters, etc.). The prefix "google." is reserved for Google-developed
       functionality.
       
      map<string, string> query_config = 16 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getQueryConfigOrDefault in interface Session.TurnOrBuilder
    • getQueryConfigOrThrow

      public String getQueryConfigOrThrow(String key)
       Optional. Represents metadata related to the query config, for example
       LLM model and version used, model parameters (temperature, grounding
       parameters, etc.). The prefix "google." is reserved for Google-developed
       functionality.
       
      map<string, string> query_config = 16 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getQueryConfigOrThrow in interface Session.TurnOrBuilder
    • 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 Session.Turn parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

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

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

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

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

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

      public static Session.Turn parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

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

      public static Session.Turn parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

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

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

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

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

      public static Session.Turn.Builder newBuilder()
    • newBuilder

      public static Session.Turn.Builder newBuilder(Session.Turn prototype)
    • toBuilder

      public Session.Turn.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

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

      public static Session.Turn getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<Session.Turn> parser()
    • getParserForType

      public com.google.protobuf.Parser<Session.Turn> 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 Session.Turn getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder