Record Class AssistantRequest

java.lang.Object
java.lang.Record
ch.tocco.nice2.optional.aiassistant.impl.rest.AssistantRequest
Record Components:
question - the user's question (required)
conversationKey - key of an existing conversation to continue; null starts a new one
function - which assistant function to use (e.g. "MANUAL"); the client always sends its active function; ignored when continuing an existing conversation (the function is taken from the existing conversation)
language - the answer language (ISO code); the client always sends it

public record AssistantRequest(String question, @Nullable String conversationKey, String function, String language) extends Record
Request body of POST /nice2/rest/aiAssistant.
  • Constructor Details

    • AssistantRequest

      public AssistantRequest(String question, @Nullable String conversationKey, String function, String language)
      Creates an instance of a AssistantRequest record class.
      Parameters:
      question - the value for the question record component
      conversationKey - the value for the conversationKey record component
      function - the value for the function record component
      language - the value for the language record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • question

      public String question()
      Returns the value of the question record component.
      Returns:
      the value of the question record component
    • conversationKey

      public @Nullable String conversationKey()
      Returns the value of the conversationKey record component.
      Returns:
      the value of the conversationKey record component
    • function

      public String function()
      Returns the value of the function record component.
      Returns:
      the value of the function record component
    • language

      public String language()
      Returns the value of the language record component.
      Returns:
      the value of the language record component