提供: Bright Pattern Documentation
移動先: 案内、 検索
• English

onSummaryGenerationCompleted

AI要約生成の完了または失敗時にトリガーされるイベントを購読します。要約生成が成功した場合、このイベントはトピック要約の配列を提供します。この機能を使用するには、関連するサービスで リアルタイムAI要約 が有効になっている必要があります。


リクエスト

構文

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

}

リクエスト例

    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);

戻り値

パラメータ パラメータ値 データ型 オプション/必須 説明
interactionId String 必須 要約が生成されたインタラクションのID
success Boolean 必須 成功した場合はtrue、それ以外の場合はfalse
topics SummaryTopic[] オプション 要約トピックの配列で、それぞれに名前(name)と値(value)が含まれます。success=trueの場合のみ提供されます
errorCode String オプション 失敗を識別する内部エラーコード。success=falseの場合のみ提供されます
< 前へ