Assistant change sets
What the assistant changed, or asks to change, as one set: applied at once, or waiting for its user’s :apply or :reject; :revert takes it back. A large set is applied in the background: :stream follows it, :cancel stops it. Read across conversations, the account’s journal of the assistant’s changes.
List assistant change sets
The change sets the assistant made in a conversation of the caller's, the latest applied first — or, with - in place of the conversation, across conversations: the caller's own, or, for a member with READ on the Access section, every member's — the account's journal of what the assistant changed. Filter on user_id, state (as a set reads now: state = "EXPIRED" finds the sets that waited too long) and apply_time. Nothing of a conversation's text is in a set.
path Parameters
account_idId of the parent account.
assistant_conversation_idId of the parent assistant_conversation.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: apply_time desc. Sortable: apply_time.
filterAIP-160 subset (§8). Filterable: apply_time, state, user_id. A field outside the list is INVALID_ARGUMENT.
List assistant change sets › Responses
One page of change_sets.
This page of change_sets, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Get assistant change set
What one turn of the AI assistant asked to change, as a whole: its summary, its items and how they ended. The server decides from the items whether a set is applied at once with the assistant's token or waits for its user, who applies or rejects it with :apply or :reject, and takes back what it applied with :revert. A set of more than 25 items is applied in the background: :stream follows it, :cancel stops it and :apply goes on with it. A set is its author's and the account's: a member with READ on the Access section reads every member's sets — the journal of the assistant's changes, assistant_conversations/-/change_sets — and anyone else their own.
path Parameters
account_idId of the parent account.
assistant_conversation_idId of the parent assistant_conversation.
change_set_idId of the parent change_set.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get assistant change set › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
conversation_idThe conversation the set was made in — its parent, also in name: a set read across conversations (assistant_conversations/-) says whose it is without the name being parsed.
turn_idThe turn of the conversation whose call of the write tool made the set.
user_idThe member who asked for the change: the author of the conversation. Filter on it to read one member's changes.
summaryWhat the set changes, in the assistant's words, for the person who confirms it.
stateAWAITING_CONFIRMATION until its user applies or rejects it, APPLYING while its items are called, then APPLIED, FAILED (an item was refused or found its resource changed, the application was interrupted — error says so — or a revert left an item as it was), STOPPED (its user's :cancel: the rest of it waits, :apply goes on), REJECTED, EXPIRED (waited past expire_time) or REVERTED. Filters with = and != as it reads.
confirmation_reasonsWhy the set waits for its user, decided by the server, never the model: OPERATION_CLASS (an operation or a setting that always asks), DESTRUCTIVE, EXTERNAL_EFFECT, MONEY, LIVE_SITE (a theme a website wears), BULK (more than 5 items), UNTRUSTED_CONTEXT (the turn read text the website's visitors typed). Empty: applied at once.
item_countHow many calls the set makes, 1 to 1000: its items, a change the assistant made of many resources counted once for each of them.
applied_countHow many of the items are applied now — after an application that stopped, the ones before it; after a revert, the ones it could not take back.
apply_channelWhose token applies it: AUTO — the assistant's, at once, nothing in it needing a person — or USER — its user's own, by :apply.
applied_byThe member whose :apply applied it; absent on AUTO and before it was applied.
apply_timeWhen its application ended (RFC 3339, UTC); absent while it waits, and on a set rejected or expired. The Lists' order: the latest applied first, the sets without one after them.
expire_timeUntil when a set waits for its user — 24 hours after the assistant made it; past it, the set is EXPIRED and nothing applies it. Absent on a set applied at once.
revertibleWhether :revert can take something of it back now: an applied Update or Create. A Delete and a custom method are final.
overviewWhat the set holds, without reading its items: item_counts — {collection, operation, verb?, count}, how many items of each operation in each collection; first_items — {operation, resource, verb?} of the first 20 items; templates — for each change the assistant made of many resources, {collection, filter?, item_count, body, update_mask, add?, remove?}: where its targets were found, how many, and what each of them gets — add and remove the values each target's list gains and loses.
sequenceThe number of the last change the set holds — the sequence its :stream numbers its events with, one more with every change: each item its application calls is two, the item and the count applied.
errorWhy its application ended FAILED when no item says it: it was interrupted — the process applying it stopped, or nothing moved it for two minutes. The shape of an API error: code, status, message. :apply goes on from the first item not applied. Absent otherwise.
Apply (assistant change set)
Applies a change set that waits for confirmation, with the caller's own token — the operations the assistant may never call alone included — item by item, stopping at the first that is refused or finds its resource changed since the set was prepared (STALE); answers the set as it ended. A set of more than 25 items is applied in the background: the call answers it APPLYING at once, and :stream follows it; RESOURCE_EXHAUSTED while the server applies as many sets in the background as it does at once. A FAILED or STOPPED set is applied again from its first item not applied, read anew. Only the author applies a set of their conversation: another member's answers NOT_FOUND. A set past its expire_time is FAILED_PRECONDITION CHANGE_SET_EXPIRED, any other state CHANGE_SET_STATE; ABORTED when another call moved the set first. {"request_id": "…"} makes it safe to repeat: the repeat is answered the set, and nothing is applied twice.
path Parameters
account_idId of the parent account.
assistant_conversation_idId of the parent assistant_conversation.
change_set_idId of the parent change_set.
Apply (assistant change set) › Request Body optional
Apply (assistant change set) › Responses
The affected resource, or the method’s own response object (§10).
Cancel (assistant change set)
Stops a change set being applied after the item in flight: it becomes STOPPED, the items not applied yet wait (PENDING), and :apply goes on with it — or :revert takes back what it applied. Answers the set once it stopped, or still APPLYING when the item in flight takes longer than a few seconds; a set already STOPPED is answered as it is, so the call is safe to repeat. Any other state is FAILED_PRECONDITION CHANGE_SET_STATE. Only the author stops a set of their conversation.
path Parameters
account_idId of the parent account.
assistant_conversation_idId of the parent assistant_conversation.
change_set_idId of the parent change_set.
Cancel (assistant change set) › Request Body optional
Cancel (assistant change set) › Responses
The affected resource, or the method’s own response object (§10).
Reject (assistant change set)
Rejects a change set that waits for confirmation: it becomes REJECTED, and nothing of it is ever applied. Only the author rejects; a set in any other state is FAILED_PRECONDITION. Takes {"request_id": "…"} like :apply.
path Parameters
account_idId of the parent account.
assistant_conversation_idId of the parent assistant_conversation.
change_set_idId of the parent change_set.
Reject (assistant change set) › Request Body optional
Reject (assistant change set) › Responses
The affected resource, or the method’s own response object (§10).
Revert (assistant change set)
Takes back what an APPLIED set — or a FAILED or STOPPED one — applied, last first, with the caller's own token: an Update's fields are put back as before holds them, a resource a Create made is deleted. A Delete and a custom method stay done, and a resource changed since the set applied it is left as it is, its item naming why; the set becomes REVERTED, or FAILED with what it left. Only the author reverts. Takes {"request_id": "…"} like :apply.
path Parameters
account_idId of the parent account.
assistant_conversation_idId of the parent assistant_conversation.
change_set_idId of the parent change_set.
Revert (assistant change set) › Request Body optional
Revert (assistant change set) › Responses
The affected resource, or the method’s own response object (§10).
Stream (assistant change set)
Follows a change set as it is applied, as server-sent events (text/event-stream, §17 «Streamed responses»): first snapshot — the set whole, as a Get answers it — then item for each item the application called, progress with how many are applied of how many, and completed with the set as the application left it, which ends the stream. A set that is not being applied is its snapshot alone. While nothing changes, a : keep-alive comment every 15 seconds.
Pass after_sequence — the last sequence you applied — to resume after a dropped connection: the snapshot still comes first, and nothing at or below it is sent again. Read it with fetch and this call's Authorization; closing the connection does not stop the application — :cancel does.
path Parameters
account_idId of the parent account.
assistant_conversation_idId of the parent assistant_conversation.
change_set_idId of the parent change_set.
query Parameters
after_sequenceThe last sequence the client applied, to resume a stream that dropped: the snapshot still comes first, and no event at or below it is sent again. A negative value is INVALID_ARGUMENT.
Stream (assistant change set) › Responses
Server-sent events (§17, «Streamed responses»): each an event: line with its name and one data: line with a JSON object that carries the sequence of the change, then a blank line. While nothing changes, a : keep-alive comment. The server ends the stream after the last event; a client ignores an event it does not know.
snapshot—change_set— the change_set whole, as a Get answers it, and thesequenceof the last change it holds. First on every connection; a change_set that has already ended is the whole stream.item—item— an item the application called ended, as a Get of it answers it:APPLIEDwith itsafter, orFAILEDorSTALEwith itserror— which stops the application. The items it skipped after one are read fromitemsonce it ended.progress—applied_countanditem_count— how many of the set's items are applied now, of how many; after every item the application called.completed—change_set— the set as the application left it, as a Get answers it:APPLIED,FAILED(an item stopped it, or it was interrupted — itserrorsays so) orSTOPPED(:cancel). The last event of the stream; read theitemsagain.error—error— the Status of §13: the stream failed after it began, and this is its last event. Read the resource to know where it stands.
The events, one after another, as they happen.