Package com.github.copilot.sdk.json
Interface SessionEndHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Handler for session-end hooks.
This handler is invoked when a session ends, allowing you to perform cleanup or logging.
Example Usage
SessionEndHandler handler = (input, invocation) -> {
System.out.println("Session ended: " + input.getReason());
return CompletableFuture
.completedFuture(new SessionEndHookOutput().setSessionSummary("Session completed successfully"));
};
- Since:
- 1.0.7
-
Method Summary
Modifier and TypeMethodDescriptionhandle(SessionEndHookInput input, HookInvocation invocation) Handles a session end event.
-
Method Details
-
handle
CompletableFuture<SessionEndHookOutput> handle(SessionEndHookInput input, HookInvocation invocation) Handles a session end event.- Parameters:
input- the hook input containing session end detailsinvocation- metadata about the hook invocation- Returns:
- a future that resolves with the hook output, or
nullto proceed without modification
-