/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. *--------------------------------------------------------------------------------------------*/ /** * Event types emitted during Copilot session processing. * *
* This package contains all event classes that can be emitted by a * {@link com.github.copilot.sdk.CopilotSession} during message processing. * Events provide real-time information about the session state, assistant * responses, tool executions, and other activities. * *
* All events extend {@link com.github.copilot.sdk.events.AbstractSessionEvent}, * which provides common properties like event type and timestamp. * *
{@code
* session.on(evt -> {
* if (evt instanceof AssistantMessageDeltaEvent delta) {
* // Streaming response - print incrementally
* System.out.print(delta.getData().deltaContent());
* } else if (evt instanceof AssistantMessageEvent msg) {
* // Complete response
* System.out.println("\nFinal: " + msg.getData().content());
* } else if (evt instanceof ToolExecutionStartEvent tool) {
* System.out.println("Executing tool: " + tool.getData().toolName());
* } else if (evt instanceof SessionIdleEvent) {
* System.out.println("Session is idle");
* } else if (evt instanceof SessionErrorEvent err) {
* System.err.println("Error: " + err.getData().message());
* }
* });
* }
*
* @see com.github.copilot.sdk.CopilotSession#on(java.util.function.Consumer)
* @see com.github.copilot.sdk.events.AbstractSessionEvent
*/
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "DTOs for JSON deserialization - low risk")
package com.github.copilot.sdk.events;