Stream agent events
Streams an agent as it works, as server-sent events: first the transcript's events after after, then each new event as it is added, its answer as it writes it, and the agent whenever it changes. Reconnect with the last sequence seen as after to miss nothing. The stream lasts until the caller ends it, or 15 minutes, when kosem ends it for the caller to reconnect; a heartbeat arrives after 15 seconds of silence. Skip events you do not know.
Streams an agent as it works, as server-sent events: first the transcript's events after after, then each new event as it is added, its answer as it writes it, and the agent whenever it changes.
Reconnect with the last sequence seen as after to miss nothing. The stream lasts until the caller ends it, or 15 minutes, when kosem ends it for the caller to reconnect; a heartbeat arrives after 15 seconds of silence. Skip events you do not know.
bearerAuthorizationBearer <token>An access token, or an API key.
project*stringThe project's ID.
^prj_[0-7][0-9a-hjkmnp-tv-z]{25}$agent*stringThe agent's ID.
^ags_[0-7][0-9a-hjkmnp-tv-z]{25}$after?integerThe sequence of the last event the caller has seen; the stream starts after it. 0, the default, streams the whole transcript.
int640 <= valueServer-sent events, each one of these; an error event ends a stream that failed after it started.
text/event-stream- response
[index: integer]?|||||curl -X GET 'https://api.kosem.ai/v1/projects/string/agents/string/events/stream'[
{
"data": {
"activityTime": "2019-08-24T14:15:22Z",
"awaitingCalls": [
"string"
],
"config": {
"environment": {
"diskGib": 0,
"env": {
"property1": "string",
"property2": "string"
},
"idleTimeoutSeconds": 0,
"image": "string",
"memoryMib": 0,
"runnerPool": "string",
"secrets": [
{
"credential": "string",
"env": "string",
"file": "string",
"scope": {
"property1": null,
"property2": null
},
"secret": "string",
"state": "ACTIVE",
"stateReason": "string"
}
],
"stoppedTtlSeconds": 0,
"vcpus": 0
},
"instructions": "string",
"maxModelCalls": 0,
"model": "string",
"reasoningEffort": "",
"tools": [
"string"
]
},
"createTime": "2019-08-24T14:15:22Z",
"creator": "string",
"environment": {
"diskGib": 0,
"environment": "string",
"memoryMib": 0,
"state": "PROVISIONING",
"stateReason": "string",
"updateTime": "2019-08-24T14:15:22Z",
"vcpus": 0
},
"jobs": [
{
"command": "string",
"job": "string",
"startTime": "2019-08-24T14:15:22Z"
}
],
"lastSequence": 0,
"lastStop": {
"message": "string",
"reason": "END_TURN"
},
"name": "string",
"state": "IDLE",
"title": "string",
"unread": true,
"updateTime": "2019-08-24T14:15:22Z",
"usage": {
"webSearches": 0
},
"visibility": "PROJECT"
},
"event": "agent"
}
]