From Bright Pattern Documentation
< 5.19:AgentDesktop-client-side-javascript-api-specification
Revision as of 01:30, 26 February 2026 by Wyler.metge (talk | contribs) (Updated via BpClonePage extension. Source page: draft:AgentDesktop-client-side-javascript-api-specification/onSummaryGenerationCompleted)
• 5.19
onSummaryGenerationCompleted
Subscribes to the event triggered upon completion or failure of AI summary generation. If the summary generation was successful, the event provides an array of topic summaries. Requires Historical AI Summary to be enabled for the associated service.
Request
Syntax
on('ON_SUMMARY_GENERATION_COMPLETED', handler: OnSummaryGenerationCompleted): void
type OnSummaryGenerationCompleted = (result: InteractionSummaryResult) => void
type InteractionSummaryResult = InteractionSummary | InteractionSummaryFailed
type InteractionSummary = {
interactionId: string
success: true
topics: SummaryTopic[]
}
type InteractionSummaryFailed = {
interactionId: string
success: false
errorCode: string
}
export type SummaryTopic = {
name: string
value: string
}
Example Request
function summaryGenerationCompletedCallback(summary: InteractionSummaryResult) {
if (summary.success) {
console.log("Summary by topics:", summary.topics);
} else {
console.log("Summary generation error, code:", summary.errorCode);
}
}
adApi.on("ON_SUMMARY_GENERATION_COMPLETED", summaryGenerationCompletedCallback);
Return Value
| Parameter | Parameter Values | Data Type | Optional/Required | Description |
| interactionId | String | Required | ID of the interaction for which the summary was generated | |
| success | Boolean | Required | true if successful; otherwise, false | |
| topics | SummaryTopic[] | Optional | Array of summary topics, each containing a name and value. Only when success=true | |
| errorCode | String | Optional | Internal error code identifying the failure. Only when success=false |