Class AiChat


@Entity public class AiChat extends AuditableModel
  • Constructor Details

    • AiChat

      public AiChat()
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in class Model
    • setId

      public void setId(Long id)
      Specified by:
      setId in class Model
    • getUuid

      public UUID getUuid()
    • setUuid

      public void setUuid(UUID uuid)
    • getTitle

      public String getTitle()
    • setTitle

      public void setTitle(String title)
    • getContextModel

      public String getContextModel()
      Model of the record this conversation is about.
      Returns:
      the property value
    • setContextModel

      public void setContextModel(String contextModel)
    • getContextId

      public Long getContextId()
      ID of the record this conversation is about.
      Returns:
      the property value
    • setContextId

      public void setContextId(Long contextId)
    • getContextView

      public String getContextView()
      View the conversation started from.
      Returns:
      the property value
    • setContextView

      public void setContextView(String contextView)
    • getContextAction

      public String getContextAction()
      Action-view the conversation started from, when it has a stable name.
      Returns:
      the property value
    • setContextAction

      public void setContextAction(String contextAction)
    • getContextField

      public String getContextField()
      Field the conversation started from.
      Returns:
      the property value
    • setContextField

      public void setContextField(String contextField)
    • getLastMessageAt

      public LocalDateTime getLastMessageAt()
    • setLastMessageAt

      public void setLastMessageAt(LocalDateTime lastMessageAt)
    • getAgent

      public AiAgent getAgent()
    • setAgent

      public void setAgent(AiAgent agent)
    • getModel

      public AiModel getModel()
    • setModel

      public void setModel(AiModel model)
    • getActiveAgentPath

      public String getActiveAgentPath()
      Comma-separated agent codes for the active consultation path
      Returns:
      the property value
    • setActiveAgentPath

      public void setActiveAgentPath(String activeAgentPath)
    • getConversationMode

      public AiChatConversationMode getConversationMode()
      How a driver's plain message behaves: plain messages run the agent until a Can-post member's post switches the chat to Discussion
      Returns:
      the property value
    • setConversationMode

      public void setConversationMode(AiChatConversationMode conversationMode)
    • getIsSpace

      public Boolean getIsSpace()
      A shared conversation marked for reuse, so it lists and can be found again
      Returns:
      the property value
    • setIsSpace

      public void setIsSpace(Boolean isSpace)
    • getMessages

      public List<AiChatMessage> getMessages()
    • setMessages

      public void setMessages(List<AiChatMessage> messages)
    • addMessage

      public void addMessage(AiChatMessage item)
      Add the given AiChatMessage item to the messages collection.

      It sets item.chat = this to ensure the proper relationship.

      Parameters:
      item - the item to add
    • removeMessage

      public void removeMessage(AiChatMessage item)
      Remove the given AiChatMessage item from the messages collection.
      Parameters:
      item - the item to remove
    • clearMessages

      public void clearMessages()
      Clear the messages collection.
    • getParticipants

      public List<AiChatParticipant> getParticipants()
    • setParticipants

      public void setParticipants(List<AiChatParticipant> participants)
    • addParticipant

      public void addParticipant(AiChatParticipant item)
      Add the given AiChatParticipant item to the participants collection.

      It sets item.chat = this to ensure the proper relationship.

      Parameters:
      item - the item to add
    • removeParticipant

      public void removeParticipant(AiChatParticipant item)
      Remove the given AiChatParticipant item from the participants collection.
      Parameters:
      item - the item to remove
    • clearParticipants

      public void clearParticipants()
      Clear the participants collection.
    • getReads

      public List<AiChatRead> getReads()
      The fields whose values entered the chat, which every model it goes to must be allowed to receive.
      Returns:
      the property value
    • setReads

      public void setReads(List<AiChatRead> reads)
    • addRead

      public void addRead(AiChatRead item)
      Add the given AiChatRead item to the reads collection.

      It sets item.chat = this to ensure the proper relationship.

      Parameters:
      item - the item to add
    • removeRead

      public void removeRead(AiChatRead item)
      Remove the given AiChatRead item from the reads collection.
      Parameters:
      item - the item to remove
    • clearReads

      public void clearReads()
      Clear the reads collection.
    • getSummary

      public String getSummary()
      LLM-generated summary of older messages for context window management
      Returns:
      the property value
    • setSummary

      public void setSummary(String summary)
    • getSummaryUpToMessageId

      public String getSummaryUpToMessageId()
      UUID of the last message included in the summary
      Returns:
      the property value
    • setSummaryUpToMessageId

      public void setSummaryUpToMessageId(String summaryUpToMessageId)
    • getCompactedUpToMessageId

      public String getCompactedUpToMessageId()
      UUID of the last message whose tool results have been compacted. Anchors compaction to a message rather than to a distance from the end, so an unchanged prefix stays byte-identical across turns and the provider's prompt cache keeps hitting
      Returns:
      the property value
    • setCompactedUpToMessageId

      public void setCompactedUpToMessageId(String compactedUpToMessageId)
    • getRecap

      public String getRecap()
      The last recap produced for this conversation, as JSON
      Returns:
      the property value
    • setRecap

      public void setRecap(String recap)
    • getRecapUpToMessageId

      public String getRecapUpToMessageId()
      UUID of the last message included in the recap
      Returns:
      the property value
    • setRecapUpToMessageId

      public void setRecapUpToMessageId(String recapUpToMessageId)
    • getSessionNotes

      public String getSessionNotes()
      Incrementally updated structured notes about the current conversation
      Returns:
      the property value
    • setSessionNotes

      public void setSessionNotes(String sessionNotes)
    • getSessionNotesUpToMessageId

      public String getSessionNotesUpToMessageId()
      UUID of the last message included in the session notes
      Returns:
      the property value
    • setSessionNotesUpToMessageId

      public void setSessionNotesUpToMessageId(String sessionNotesUpToMessageId)
    • getSessionNotesTokenCount

      public Integer getSessionNotesTokenCount()
      Estimated token count when session notes were last updated
      Returns:
      the property value
    • setSessionNotesTokenCount

      public void setSessionNotesTokenCount(Integer sessionNotesTokenCount)
    • getAttrs

      public String getAttrs()
    • setAttrs

      public void setAttrs(String attrs)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object