Package io.jmix.aitoolsflowui.service
Interface AiConversationService
- All Known Implementing Classes:
AiConversationDataService,AiConversationEmptyService
public interface AiConversationService
Provides access to the current user's AI conversations for the chat UI.
Operates purely on the AiConversation model. List operations are implicitly
scoped to the current user.
-
Method Summary
Modifier and TypeMethodDescriptioncreate()Creates a new conversation owned by the current user.@Nullable AiConversationloadConversation(UUID conversationId) Loads a conversation by id.Loads the current user's conversations, newest first.voidremove(AiConversation conversation) Removes the given conversation together with its messages.save(AiConversation conversation) Persists the given conversation (insert or update).
-
Method Details
-
loadConversation
Loads a conversation by id.- Parameters:
conversationId- id of the conversation to load- Returns:
- the conversation, or
nullif it does not exist or is not accessible to the current user
-
loadConversations
List<AiConversation> loadConversations()Loads the current user's conversations, newest first. Messages are not loaded; useAiChatMessageServiceto fetch a conversation's messages on demand.- Returns:
- the conversations, newest first; empty if there are none
-
create
AiConversation create()Creates a new conversation owned by the current user.- Returns:
- the created conversation
-
save
Persists the given conversation (insert or update).- Parameters:
conversation- conversation to save- Returns:
- the saved conversation
-
remove
Removes the given conversation together with its messages.- Parameters:
conversation- conversation to remove
-