Class InteractionsHandler
java.lang.Object
io.github.glaforge.gemini.interactions.server.InteractionsHandler
- All Implemented Interfaces:
HttpHandler
Base class for handling Gemini Interactions API requests in an
HttpHandler.
Subclasses must implement the abstract methods to provide the actual logic for creating, retrieving, deleting, and cancelling interactions, as well as streaming events.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor for InteractionsHandler. -
Method Summary
Modifier and TypeMethodDescriptionabstract InteractionCancels an interaction by ID.abstract Interactioncreate(InteractionParams.Request request) Creates a new interaction.abstract voidDeletes an interaction by ID.abstract InteractionRetrieves an interaction by ID.voidhandle(HttpExchange exchange) stream(InteractionParams.Request request) Returns a stream of events for an interaction request.
-
Constructor Details
-
InteractionsHandler
protected InteractionsHandler()Default constructor for InteractionsHandler.
-
-
Method Details
-
handle
- Specified by:
handlein interfaceHttpHandler- Throws:
IOException
-
create
Creates a new interaction.- Parameters:
request- The interaction request parameters.- Returns:
- The created Interaction.
-
get
Retrieves an interaction by ID.- Parameters:
id- The interaction ID.- Returns:
- The Interaction, or null if not found.
-
delete
Deletes an interaction by ID.- Parameters:
id- The interaction ID.
-
cancel
Cancels an interaction by ID.- Parameters:
id- The interaction ID.- Returns:
- The updated Interaction.
-
stream
Returns a stream of events for an interaction request.- Parameters:
request- The interaction request parameters.- Returns:
- A stream of Events.
-