Record Class ResponseHints

java.lang.Object
java.lang.Record
com.tnsai.channels.model.ResponseHints
Record Components:
streaming - request token-by-token delivery if the channel supports it
showTyping - send a typing indicator before the response
splitLongMessages - automatically split text exceeding channel's max length
replyToMessageId - native message id to reply to (null for standalone messages)

public record ResponseHints(boolean streaming, boolean showTyping, boolean splitLongMessages, String replyToMessageId) extends Record
Hints for how the channel adapter should deliver a response.
  • Constructor Details

    • ResponseHints

      public ResponseHints(boolean streaming, boolean showTyping, boolean splitLongMessages, String replyToMessageId)
      Creates an instance of a ResponseHints record class.
      Parameters:
      streaming - the value for the streaming record component
      showTyping - the value for the showTyping record component
      splitLongMessages - the value for the splitLongMessages record component
      replyToMessageId - the value for the replyToMessageId record component
  • Method Details

    • defaults

      public static ResponseHints defaults()
    • withStreaming

      public static ResponseHints withStreaming()
    • replyTo

      public static ResponseHints replyTo(String messageId)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • streaming

      public boolean streaming()
      Returns the value of the streaming record component.
      Returns:
      the value of the streaming record component
    • showTyping

      public boolean showTyping()
      Returns the value of the showTyping record component.
      Returns:
      the value of the showTyping record component
    • splitLongMessages

      public boolean splitLongMessages()
      Returns the value of the splitLongMessages record component.
      Returns:
      the value of the splitLongMessages record component
    • replyToMessageId

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