Package org.openxava.chat
Interface IChatService
public interface IChatService
Interface for AI chat service implementations.
This interface allows the chat functionality to work with different AI providers.
The default implementation requires Java 17 and LangChain4j, available in openxava-7.7-chat-jdk17.
- Since:
- 7.7
- Author:
- Javier Paniza
-
Method Summary
Modifier and TypeMethodDescriptionProcess a chat message and return the AI response as HTML.voidclearMemory(String sessionId) Clear the conversation memory for a session.consumePendingFilterValues(String sessionId) Get pending filter values after a chat response (for UI filtering).booleanconsumeRefreshUINeeded(String sessionId) Check if UI refresh is needed after a chat response.
-
Method Details
-
chat
String chat(String sessionId, javax.servlet.http.HttpSession httpSession, String message) throws ChatException Process a chat message and return the AI response as HTML.- Parameters:
sessionId- The HTTP session ID for maintaining conversation contexthttpSession- The HTTP session for accessing application contextmessage- The user message to process- Returns:
- The AI response as HTML, or null if the message was a command
- Throws:
ChatException- if there's an error processing the message
-
clearMemory
Clear the conversation memory for a session.- Parameters:
sessionId- The HTTP session ID
-
consumePendingFilterValues
Get pending filter values after a chat response (for UI filtering).- Parameters:
sessionId- The HTTP session ID- Returns:
- Map of filter values, or null if none pending
-
consumeRefreshUINeeded
Check if UI refresh is needed after a chat response.- Parameters:
sessionId- The HTTP session ID- Returns:
- true if refresh is needed
-