Package com.axelor.ai.db
Class AiChat
java.lang.Object
com.axelor.db.Model
com.axelor.auth.db.AuditableModel
com.axelor.ai.db.AiChat
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(AiChatMessage item) Add the givenAiChatMessageitem to themessagescollection.voidAdd the givenAiChatParticipantitem to theparticipantscollection.voidaddRead(AiChatRead item) Add the givenAiChatReaditem to thereadscollection.voidClear themessagescollection.voidClear theparticipantscollection.voidClear thereadscollection.booleanComma-separated agent codes for the active consultation pathgetAgent()getAttrs()UUID of the last message whose tool results have been compacted.Action-view the conversation started from, when it has a stable name.Field the conversation started from.ID of the record this conversation is about.Model of the record this conversation is about.View the conversation started from.How a driver's plain message behaves: plain messages run the agent until a Can-post member's post switches the chat to DiscussiongetId()A shared conversation marked for reuse, so it lists and can be found againgetModel()getReads()The fields whose values entered the chat, which every model it goes to must be allowed to receive.getRecap()The last recap produced for this conversation, as JSONUUID of the last message included in the recapIncrementally updated structured notes about the current conversationEstimated token count when session notes were last updatedUUID of the last message included in the session notesLLM-generated summary of older messages for context window managementUUID of the last message included in the summarygetTitle()getUuid()inthashCode()voidremoveMessage(AiChatMessage item) Remove the givenAiChatMessageitem from themessagescollection.voidRemove the givenAiChatParticipantitem from theparticipantscollection.voidremoveRead(AiChatRead item) Remove the givenAiChatReaditem from thereadscollection.voidsetActiveAgentPath(String activeAgentPath) voidvoidvoidsetCompactedUpToMessageId(String compactedUpToMessageId) voidsetContextAction(String contextAction) voidsetContextField(String contextField) voidsetContextId(Long contextId) voidsetContextModel(String contextModel) voidsetContextView(String contextView) voidsetConversationMode(AiChatConversationMode conversationMode) voidvoidsetIsSpace(Boolean isSpace) voidsetLastMessageAt(LocalDateTime lastMessageAt) voidsetMessages(List<AiChatMessage> messages) voidvoidsetParticipants(List<AiChatParticipant> participants) voidsetReads(List<AiChatRead> reads) voidvoidsetRecapUpToMessageId(String recapUpToMessageId) voidsetSessionNotes(String sessionNotes) voidsetSessionNotesTokenCount(Integer sessionNotesTokenCount) voidsetSessionNotesUpToMessageId(String sessionNotesUpToMessageId) voidsetSummary(String summary) voidsetSummaryUpToMessageId(String summaryUpToMessageId) voidvoidtoString()Methods inherited from class com.axelor.auth.db.AuditableModel
getCreatedBy, getCreatedOn, getUpdatedBy, getUpdatedOnMethods inherited from class com.axelor.db.Model
getArchived, getCid, getImportId, getVersion, isSelected, setArchived, setCid, setImportId, setSelected, setVersion
-
Constructor Details
-
AiChat
public AiChat()
-
-
Method Details
-
getId
-
setId
-
getUuid
-
setUuid
-
getTitle
-
setTitle
-
getContextModel
Model of the record this conversation is about.- Returns:
- the property value
-
setContextModel
-
getContextId
ID of the record this conversation is about.- Returns:
- the property value
-
setContextId
-
getContextView
View the conversation started from.- Returns:
- the property value
-
setContextView
-
getContextAction
Action-view the conversation started from, when it has a stable name.- Returns:
- the property value
-
setContextAction
-
getContextField
Field the conversation started from.- Returns:
- the property value
-
setContextField
-
getLastMessageAt
-
setLastMessageAt
-
getAgent
-
setAgent
-
getModel
-
setModel
-
getActiveAgentPath
Comma-separated agent codes for the active consultation path- Returns:
- the property value
-
setActiveAgentPath
-
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
-
getIsSpace
A shared conversation marked for reuse, so it lists and can be found again- Returns:
- the property value
-
setIsSpace
-
getMessages
-
setMessages
-
addMessage
Add the givenAiChatMessageitem to themessagescollection.It sets
item.chat = thisto ensure the proper relationship.- Parameters:
item- the item to add
-
removeMessage
Remove the givenAiChatMessageitem from themessagescollection.- Parameters:
item- the item to remove
-
clearMessages
public void clearMessages()Clear themessagescollection. -
getParticipants
-
setParticipants
-
addParticipant
Add the givenAiChatParticipantitem to theparticipantscollection.It sets
item.chat = thisto ensure the proper relationship.- Parameters:
item- the item to add
-
removeParticipant
Remove the givenAiChatParticipantitem from theparticipantscollection.- Parameters:
item- the item to remove
-
clearParticipants
public void clearParticipants()Clear theparticipantscollection. -
getReads
The fields whose values entered the chat, which every model it goes to must be allowed to receive.- Returns:
- the property value
-
setReads
-
addRead
Add the givenAiChatReaditem to thereadscollection.It sets
item.chat = thisto ensure the proper relationship.- Parameters:
item- the item to add
-
removeRead
Remove the givenAiChatReaditem from thereadscollection.- Parameters:
item- the item to remove
-
clearReads
public void clearReads()Clear thereadscollection. -
getSummary
LLM-generated summary of older messages for context window management- Returns:
- the property value
-
setSummary
-
getSummaryUpToMessageId
UUID of the last message included in the summary- Returns:
- the property value
-
setSummaryUpToMessageId
-
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
-
getRecap
The last recap produced for this conversation, as JSON- Returns:
- the property value
-
setRecap
-
getRecapUpToMessageId
UUID of the last message included in the recap- Returns:
- the property value
-
setRecapUpToMessageId
-
getSessionNotes
Incrementally updated structured notes about the current conversation- Returns:
- the property value
-
setSessionNotes
-
getSessionNotesUpToMessageId
UUID of the last message included in the session notes- Returns:
- the property value
-
setSessionNotesUpToMessageId
-
getSessionNotesTokenCount
Estimated token count when session notes were last updated- Returns:
- the property value
-
setSessionNotesTokenCount
-
getAttrs
-
setAttrs
-
equals
-
hashCode
public int hashCode() -
toString
-