Package com.storedobject.ai
Interface Chat
public interface Chat
The Chat interface represents a basic contract for interaction between the user
and an AI system through text-based communication. It provides a method to ask
a question or send a message to the system, receiving a response asynchronously.
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptionSends a message to the chat system and receives a response asynchronously.void
close()
Closes the chat interface, releasing any associated resources or connections.boolean
isClosed()
Checks whether the chat instance has been closed.void
setChatClosedListener
(Runnable listener) Sets a listener to be invoked when the chat is closed.
-
Method Details
-
ask
-
close
void close()Closes the chat interface, releasing any associated resources or connections. This method should be called when the chat instance is no longer needed to ensure proper cleanup. -
isClosed
boolean isClosed()Checks whether the chat instance has been closed.- Returns:
true
if the chat instance is closed, otherwisefalse
.
-
setChatClosedListener
Sets a listener to be invoked when the chat is closed. The listener is aRunnable
that will execute when the chat instance is closed by calling theclose
method.- Parameters:
listener
- theRunnable
to be executed when the chat is closed.
-