- [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/StreamResponse#SCHEMA_REPRESENTATION)
- [TaskStatusUpdateEvent](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/StreamResponse#TaskStatusUpdateEvent)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/StreamResponse#TaskStatusUpdateEvent.SCHEMA_REPRESENTATION)
- [TaskArtifactUpdateEvent](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/StreamResponse#TaskArtifactUpdateEvent)
  - [JSON representation](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/StreamResponse#TaskArtifactUpdateEvent.SCHEMA_REPRESENTATION)

A wrapper object used in streaming operations to encapsulate different types of response data.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "task": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks#Task`) }, "message": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks#Message`) }, "statusUpdate": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/StreamResponse#TaskStatusUpdateEvent`) }, "artifactUpdate": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/StreamResponse#TaskArtifactUpdateEvent`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| The payload of the stream response. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `task` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks#Task`)`` A Task object containing the current state of the task. |
| `message` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks#Message`)`` A Message object containing a message from the agent. |
| `statusUpdate` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/StreamResponse#TaskStatusUpdateEvent`)`` An event indicating a task status update. |
| `artifactUpdate` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/StreamResponse#TaskArtifactUpdateEvent`)`` An event indicating a task artifact update. |
| End of mutually exclusive fields. ||

## TaskStatusUpdateEvent

An event sent by the agent to notify the client of a change in a task's status.

| JSON representation |
|---|
| ``` { "taskId": string, "contextId": string, "status": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks#TaskStatus`) }, "metadata": { object } } ``` |

| Fields ||
|---|---|
| `taskId` | `string` Required. The ID of the task that has changed. |
| `contextId` | `string` Required. The ID of the context that the task belongs to. |
| `status` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks#TaskStatus`)`` Required. The new status of the task. |
| `metadata` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Optional. Metadata associated with the task update. |

## TaskArtifactUpdateEvent

A task delta where an artifact has been generated.

| JSON representation |
|---|
| ``` { "taskId": string, "contextId": string, "artifact": { object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks#Artifact`) }, "append": boolean, "lastChunk": boolean, "metadata": { object } } ``` |

| Fields ||
|---|---|
| `taskId` | `string` Required. The ID of the task for this artifact. |
| `contextId` | `string` Required. The ID of the context that this task belongs to. |
| `artifact` | ``object (`https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks#Artifact`)`` Required. The artifact that was generated or updated. |
| `append` | `boolean` If true, the content of this artifact should be appended to a previously sent artifact with the same ID. |
| `lastChunk` | `boolean` If true, this is the final chunk of the artifact. |
| `metadata` | ``object (`https://protobuf.dev/reference/protobuf/google.protobuf#struct` format)`` Optional. Metadata associated with the artifact update. |