Record Class SessionSearchResult

java.lang.Object
java.lang.Record
com.tnsai.session.SessionSearchResult

public record SessionSearchResult(AgentSession session, double score, List<SessionSearchResult.MatchedTurn> matchedTurns, List<String> highlights) extends Record
Result of a session search operation.
Author:
TnsAI Team
  • Constructor Details

    • SessionSearchResult

      public SessionSearchResult(AgentSession session, double score, List<SessionSearchResult.MatchedTurn> matchedTurns, List<String> highlights)
      Creates an instance of a SessionSearchResult record class.
      Parameters:
      session - the value for the session record component
      score - the value for the score record component
      matchedTurns - the value for the matchedTurns record component
      highlights - the value for the highlights record component
  • Method Details

    • of

      public static SessionSearchResult of(AgentSession session)
      Creates a result with just the session.
    • of

      public static SessionSearchResult of(AgentSession session, double score)
      Creates a result with score.
    • withMatches

      public static SessionSearchResult withMatches(AgentSession session, double score, List<SessionSearchResult.MatchedTurn> matchedTurns)
      Creates a result with matched turns.
    • hasMatches

      public boolean hasMatches()
      Checks if this result has matched turns.
    • getSessionId

      public String getSessionId()
      Gets the session ID.
    • getFirstUserMessage

      public String getFirstUserMessage()
      Gets the first user message from the session.
    • 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.
    • session

      public AgentSession session()
      Returns the value of the session record component.
      Returns:
      the value of the session record component
    • score

      public double score()
      Returns the value of the score record component.
      Returns:
      the value of the score record component
    • matchedTurns

      public List<SessionSearchResult.MatchedTurn> matchedTurns()
      Returns the value of the matchedTurns record component.
      Returns:
      the value of the matchedTurns record component
    • highlights

      public List<String> highlights()
      Returns the value of the highlights record component.
      Returns:
      the value of the highlights record component