Class Session
java.lang.Object
uno.anahata.ai.tools.spi.Session
A tool provider for managing chat sessions using Kryo serialization.
These tools allow the model to persist the current conversation history to disk and reload it later, enabling long-running or multi-stage tasks.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionLists all available saved chat sessions.static voidloadSession(String id) Loads a conversation history from a saved session file.static StringsaveSession(String name) Saves the current conversation history to a file.
-
Constructor Details
-
Session
public Session()
-
-
Method Details
-
saveSession
Saves the current conversation history to a file.- Parameters:
name- The name of the session (used as the filename).- Returns:
- A success message.
- Throws:
IOException- if an I/O error occurs.
-
listSavedSessions
Lists all available saved chat sessions.- Returns:
- A list of session names.
- Throws:
IOException- if an I/O error occurs.
-
loadSession
Loads a conversation history from a saved session file.- Parameters:
id- The name of the session to load.- Throws:
IOException- if the session file is not found or an error occurs.
-
