CoreEvent
Sealed hierarchy of real-time events emitted by the SDK through CoreClient.events.
Events are delivered via a hot SharedFlow that does not replay past emissions. Collection must begin before events occur in order to observe them. The flow is active only while the CoreClient is started (between CoreClient.start and CoreClient.stop).
The hierarchy is divided into three categories:
ConversationEvent — activity within a specific conversation (new entries, typing, queue updates).
Connection — real-time connection lifecycle transitions.
Error — SDK-level errors encountered during operation.
For conversation-scoped observation, use ConversationClient.events which filters to a single conversation and emits only ConversationEvent instances.
See also
Samples
scope.launch {
coreClient.events.collect { event ->
when (event) {
is CoreEvent.ConversationEvent.Entry -> {
val entry = event.conversationEntry
}
is CoreEvent.ConversationEvent.ProgressIndicator -> {
// Agent is typing
}
is CoreEvent.Connection -> {
// Connection state changed (Connecting, Open, Closed, Ping)
}
is CoreEvent.Error -> {
// Handle error: event.message, event.exception
}
else -> {}
}
}
}Inheritors
Types
Emitted when the real-time server connection transitions between lifecycle states.
Events scoped to a specific conversation, identified by conversationId.