AgentEventMessage interface
Each event in a server-sent events stream has an event and data property:
*
*
Example
-
- event: thread.created
- data: {"id": "thread_123", "object": "thread", ...}
-
- We emit events whenever a new object is created, transitions to a new state, or is being
- streamed in parts (deltas). For example, we emit
thread.run.createdwhen a new run - is created,
thread.run.completedwhen a run completes, and so on. When an Agent chooses - to create a message during a run, we emit a
thread.message.created event, a thread.message.in_progressevent, manythread.message.deltaevents, and finally athread.message.completedevent.- We may add additional events over time, so we recommend handling unknown events gracefully
- in your code.
Properties
| data | The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk |
| event | The type of the event. |
Property Details
data
The data of the event. The data can be of type AgentThreadOutput, ThreadRunOutput, RunStepOutput, ThreadMessageOutput, MessageDeltaChunk,RunStepDeltaChunk
data: AgentEventStreamData
Property Value
event
The type of the event.
event: string
Property Value
string