SessionLogEvent Class

  • java.lang.Object
    • com.azure.ai.agents.models.SessionLogEvent

Implements

public final class SessionLogEvent
implements JsonSerializable<SessionLogEvent>

A single Server-Sent Event frame emitted by the hosted agent session log stream. Each frame contains an `event` field identifying the event type and a `data` field carrying the payload as plain text. Although the current `data` payload is JSON-formatted, its schema is not contractual — additional keys may appear and the format may change over time. Clients should treat `data` as an opaque string and optionally attempt JSON parsing. New event types may be added in the future. Clients should gracefully ignore unrecognized event types. Wire format: ``` event: log data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting server on port 18080"} event: log data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} ```.

Method Summary

Modifier and Type Method and Description
static SessionLogEvent fromJson(JsonReader jsonReader)

Reads an instance of SessionLogEvent from the JsonReader.

String getData()

Get the data property: The event payload as plain text.

SessionLogEventType getEvent()

Get the event property: The SSE event type.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static SessionLogEvent fromJson(JsonReader jsonReader)

Reads an instance of SessionLogEvent from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of SessionLogEvent if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getData

public String getData()

Get the data property: The event payload as plain text. Currently JSON-formatted but the schema is not contractual and may change.

Returns:

the data value.

getEvent

public SessionLogEventType getEvent()

Get the event property: The SSE event type. Currently `log`, but additional event types may be added in the future. Clients should ignore unrecognized event types.

Returns:

the event value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to