Package com.github.copilot.sdk.events
Class AssistantMessageEvent
java.lang.Object
com.github.copilot.sdk.events.AbstractSessionEvent
com.github.copilot.sdk.events.AssistantMessageEvent
Event representing a complete message from the assistant.
This event is fired when the assistant has finished generating a response.
For streaming responses, use AssistantMessageDeltaEvent instead.
Example Usage
session.on(event -> {
if (event instanceof AssistantMessageEvent msg) {
String content = msg.getData().getContent();
System.out.println("Assistant: " + content);
}
});
- Since:
- 1.0.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContains the assistant message content and metadata. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.github.copilot.sdk.events.AbstractSessionEvent
getEphemeral, getId, getParentId, getTimestamp, setEphemeral, setId, setParentId, setTimestamp
-
Constructor Details
-
AssistantMessageEvent
public AssistantMessageEvent()
-
-
Method Details
-
getType
Gets the event type discriminator string.This corresponds to the event type in the JSON protocol (e.g., "assistant.message", "session.idle").
- Specified by:
getTypein classAbstractSessionEvent- Returns:
- "assistant.message"
-
getData
Gets the message data.- Returns:
- the message data containing content and tool requests
-
setData
Sets the message data.- Parameters:
data- the message data
-