Package io.jmix.aitoolsflowui.service
Interface AiChatService
- All Known Implementing Classes:
AiChatDataService,AiChatEmptyService
public interface AiChatService
Generates assistant responses in an AI chat.
Whether a response can actually be produced depends on the application's AI
configuration; callers should check isAvailable() before sending a message.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether AI chat is currently available, i.e.processMessage(AiChatMessage message) Generates the assistant's reply to the given user message.processMessage(AiChatMessage message, Consumer<AiToolStatusUpdate> statusCallback) Generates the assistant's reply to the given user message, reporting progress while the reply is being prepared.
-
Method Details
-
processMessage
Generates the assistant's reply to the given user message.- Parameters:
message- the user message to answer- Returns:
- the assistant's reply text, or an empty string if no reply was produced
-
processMessage
Generates the assistant's reply to the given user message, reporting progress while the reply is being prepared.- Parameters:
message- the user message to answerstatusCallback- receives progress updates during processing- Returns:
- the assistant's reply text, or an empty string if no reply was produced
-
isAvailable
boolean isAvailable()Returns whether AI chat is currently available, i.e. replies can be generated.- Returns:
trueif chat is configured and ready to use
-