Receiving platform feedback

Handle reactions, prompt clicks, edits, deletions, and stream control
View as Markdown

The sidecar sends PlatformFeedback on the same stream when the user interacts with a previous response.

PlatformFeedback

FieldTypeRequiredNotes
conversationIdstringyesConversation this feedback belongs to.
responseIdstringnoWhich agent response this feedback relates to.
timestampTimestampyesWhen the feedback occurred.
traceContextTraceContextnoTrace context of the response this feedback references, echoed back by the platform. See Trace context.
userUsernoPlatform user who submitted the feedback. Empty for anonymous/system events.
one variantyesOne of the fields below.

PlatformFeedback variants

VariantTypeNotes
reactionMessageReactionThumbs up/down or custom emoji.
promptSelectionPromptSelectionUser clicked a SuggestedPrompts entry.
buttonClickButtonClickUser clicked a button on a CardAttachment.
streamControlStreamControlUser asked to stop, pause, resume, or regenerate.
messageEditMessageEditUser edited their own previous message.
messageDeleteMessageDeleteUser deleted their own previous message.
textTextFeedbackFree-form text from a platform-native modal.

MessageReaction

FieldTypeRequiredNotes
typenumberyes0=UNSPECIFIED, 1=THUMBS_UP, 2=THUMBS_DOWN, 3=CUSTOM_EMOJI.
emojistringnoPopulated when type === 3.
addedbooleanyestrue = added, false = removed.

PromptSelection

FieldTypeNotes
promptIdstringMatches Prompt.id from a sent suggestion.
promptMessagestringFull message being sent.

ButtonClick

FieldTypeNotes
buttonIdstringButton identifier from card.
valuestringButton value/payload.
actionstringAction identifier.

StreamControl

FieldTypeNotes
actionnumber0=UNSPECIFIED, 1=STOP, 2=PAUSE, 3=RESUME, 4=REGENERATE.
reasonstringWhy (user click, error, etc.).

MessageEdit

FieldTypeNotes
messageIdstringPlatform message ID that was edited.
newContentstringNew content after edit.
originalContentstringOriginal content (if available).
editedAtTimestampWhen the edit happened.

MessageDelete

FieldTypeNotes
messageIdstringPlatform message ID that was deleted.
deletedAtTimestampWhen the delete happened.

TextFeedback

FieldTypeNotes
textstringFree-form text the user typed.
promptstringLabel/title shown above the textbox.
conversation.on('response', (resp) => {
if (resp.feedback?.reaction) {
const { type, added } = resp.feedback.reaction;
log({ kind: 'reaction', responseId: resp.feedback.responseId, type, added });
}
if (resp.feedback?.streamControl) {
// Cancel in-flight generation for this conversation
}
});

Next steps