The stream response for a message. The stream should be one of the following sequences: If the response is a message, the stream should contain one, and only one, message and then close If the response is a task lifecycle, the first response should be a Task object followed by zero or more TaskStatusUpdateEvents and TaskArtifactUpdateEvents. The stream should complete when the Task if in an interrupted or terminal state. A stream that ends before these conditions are met are
| JSON representation |
|---|
{ // Union field |
Union field payload
.
payload
can be only one of the following:
task
object (
Task
)
message
object (
Message
)
statusUpdate
object (
TaskStatusUpdateEvent
)
artifactUpdate
object (
TaskArtifactUpdateEvent
)
TaskStatusUpdateEvent
TaskStatusUpdateEvent is a delta even on a task indicating that a task has changed.
| JSON representation |
|---|
{
"taskId"
:
string
,
"contextId"
:
string
,
"status"
:
{
object (
|
| Fields | |
|---|---|
taskId
|
The ID of the task that is changed |
contextId
|
The ID of the context that the task belongs to |
status
|
The new status of the task. |
final
|
Whether this is the last status update expected for this task. |
metadata
|
Optional metadata to associate with the task update. |
TaskArtifactUpdateEvent
TaskArtifactUpdateEvent represents a task delta where an artifact has been generated.
| JSON representation |
|---|
{
"taskId"
:
string
,
"contextId"
:
string
,
"artifact"
:
{
object (
|
| Fields | |
|---|---|
taskId
|
The ID of the task for this artifact |
contextId
|
The ID of the context that this task belongs too |
artifact
|
The artifact itself |
append
|
Whether this should be appended to a prior one produced |
lastChunk
|
Whether this represents the last part of an artifact |
metadata
|
Optional metadata associated with the artifact update. |

