ユーザー・インタフェースのコンポーネント
これらは、YAMLベースのダイアログ・フロー・エディタのユーザー・インタフェース・カテゴリで使用可能なコンポーネントです。
-
System.CommonResponse—様々なコンテンツのメッセージを出力します。
-
System.Webview—ボットをWebアプリケーションと統合します。
-
System.IncidentCreation - Oracle B2C ServiceまたはOracle Fusion Serviceのインシデントを作成します。
-
System.IntelligentAdvisor—スキルをOracle Intelligent Advisorインタビューと統合します。
-
System.KnowledgeSearch—主題に関する情報をナレッジ・サービスで検索します。
-
System.AgentTransfer—DA (エージェント)スキルで会話をOracle B2C ServiceまたはOracle Fusion Serviceに戻すことができます。
-
System.AgentTransferCondition - エージェントが使用可能かどうかを確認し、予想される待機時間を取得できます。
-
System.AgentInitiationおよび System.AgentConversation—会話をOracle B2C Serviceライブ・エージェントに転送できます。
-
System.ResolveEntities—コンポジット・バッグ・エンティティのメンバー・エンティティの値を解決します。
- System.Feedback - フィードバック評価コンポーネントを出力します。
System.CommonResponse
System.CommonResponse
コンポーネントを使用すると、イメージやアクション・ボタンを含むカード・カルーセルや、表と入力フィールドを含むフォームなどの豊富なUI機能を持つメッセージを作成できます。
このトピックでは、このコンポーネントをYAMLモードで使用する方法について説明します。ビジュアル・フロー・デザイナでの使用方法の詳細は、「一般的なレスポンス・コンポーネント・テンプレート」を参照してください。
System.CommonResponse
のテンプレートは、「コンポーネントの追加」ダイアログの「ユーザー・メッセージング」セクションで使用できます。
System.CommonResponse
コンポーネントを使用する例を確認できます。PizzaBotのこのスピンでは、クイック・アクション「今すぐオーダー」ボタンがあるイメージが豊富なメニューを表示できます。
System.CommonResponse
コンポーネントのコンテキストでは、様々なタイプのメッセージはレスポンス・タイプと呼ばれ、CrcPizzaBotでは、特に、ボット・ユーザーがどのようにアクション・ボタンを使用してプロンプトに応答し、ピザのメニューを一連のカード・アイテムとして表示できるかが示されています。
「コンポーネントの追加」メニューから、カード、テキスト、アタッチメント・レスポンスおよび(CbPizzaBotで示されている)コンポジット・バッグ・エンティティ用の様々なSystem.CommonResponse
テンプレートを選択できます。これらのテンプレートには、これらのレスポンス・タイプすべてに共通のプロパティと個々のレスポンス・タイプに固有のプロパティの両方が含まれています。「コンポーネントの追加」メニューでは、レスポンス・タイプごとに個別の状態が追加されますが、1つ以上のレスポンス・タイプを1つの状態に結合できます。CrcPizzaBotでは、ShowMenu
(テキスト・レスポンス)状態とOrderPizza
(テキスト・レスポンスおよびカード・レスポンス)状態で、両方の例が示されています。
開発サイクルの早期にターゲット・チャネル内の各スキルをテストして、コンポーネントが目的どおりにレンダリングされることを確認する必要があります。
コンポーネントのプロパティ
System.CommonResponse
コンポーネントの構成には、ダイアログ・エンジンに指示するプロパティと、コンポーネントによるメッセージの配信方法(テキスト・プロンプト、カードまたは添付として)のみでなく、メッセージ自体の内容および動作も設定するメタデータ・プロパティの設定が必要です。
名前 | 説明 | 必須? |
---|---|---|
metadata |
このコンポーネントで作成されるチャット・レスポンスは、metadata プロパティのコンテンツによって制御されます。「共通のレスポンス・コンポーネントのmetadataプロパティ」を参照してください。
|
はい |
processUserMessage |
ユーザーがテキストを入力するかボタンをタップした後に状態に戻るようダイアログ・エンジンに指示するには、このプロパティをtrue に設定します。ユーザー入力が必要ではない(または予期されない)場合は、このプロパティをfalse に設定します。
ロケーションを設定するときは、このプロパティを |
はい |
autoNumberPostbackActions |
このプロパティは、コンポジット・バッグ、テキスト・レスポンス、カード・レスポンスに対して使用されます。true に設定すると、このオプションによって、オプションの先頭に番号が付けられます。このオプションをtrue に設定していない場合でも、デジタル・アシスタントの「ポストバック・アクションでの自動採番の有効化」構成がtrue に設定されている場合は、カード・アイテムに自動採番を適用できます。デフォルトの構成で示されているように、チャネル固有の自動採番は、デジタル・アシスタントに登録されているすべてのスキル・ボットに適用できます(${(system.channelType=='twilio')?then('true','false')} ):
|
いいえ |
variable |
この変数には、ユーザーがボタンのタップではなくフリー・テキストの入力によって応答したときに移入されるコンテキスト変数またはユーザー変数の名前が保持されます。ボタンのペイロードによってどの変数の値が設定されるかが決まるため、ユーザーがボタンをタップした場合は、このプロパティは無視されます。ダイアログ・エンジンがこの状態になったときにvariableプロパティがすでに設定されていた場合、状態はスキップされます。 コンポジット・バッグ・エンティティの場合は、コンポジット・バッグ・エンティティ変数を参照します。ユーザーは、バッグ内の個別のエンティティ値を求められます。すべてのエンティティ値が設定されると、コンポーネントは次の状態に遷移します。 |
いいえ |
nlpResultVariable |
エンティティ値を使用してvariable プロパティを設定します(参照される変数に対してそのエンティティ値がまだ設定されていない場合)。NLPの結果を保持する変数を使用して定義すると(サンプル・ボットで使用されているiResult: "nlpresult" など)、nlpResultVariable で値を返すことができます。こうすることで、変数によって参照されるエンティティと一致する解決済エンティティが見つかった場合、nlpResultVariable プロパティはnullであっても値を移入できます。nlpResultVariable によって値が設定されると、ダイアログは次の状態に遷移します。このプロパティは、System.SetVariableコンポーネントのかわりに使用できます。
|
いいえ |
useFullEntityMatches |
true に設定すると、カスタム・エンティティ値がJSONオブジェクトとして格納されます(組込みエンティティ値のようになります)。これで、value 、primaryLanguageValue 、originalString などのプロパティにアクセスするための式を作成できます。これは、現在複数言語である(またはいずれ複数言語になる可能性がある)スキルにとって特に重要です。
|
いいえ |
maxPrompts |
System.CommonResponse コンポーネントでは、ユーザーが入力したテキストから、variable プロパティに対して指定した変数値への移入の前に、変数タイプに対して値が検証されます。これは、エンティティ・タイプの検証であるか、またはプリミティブ型の場合には、プリミティブ型に強制変換できる値です。
コンポーネントで値を検証できない場合、ダイアログ・エンジンはメッセージ・テキストおよびオプションを再度送信します。(このメッセージは、検証の失敗を反映するように変更できます。)ユーザーが有効な値を入力できないことが続いて無限ループになることを避けるには、このプロパティを使用して、ユーザーに与えられる試行回数に制限を設定します。ユーザーがこの割当てを超えると、 コンポジット・バッグ・エンティティの作成で説明されているように、「最大ユーザー入力試行回数」オプションが設定されている場合は、コンポジット・バッグ内の個々のエンティティはこの設定をオーバーライドできます。 |
いいえ |
keepTurn |
keepTurn プロパティは、processUserMessage プロパティをfalse に設定した場合にのみ適用されます。このプロパティの設定方法は、System.Outputを参照してください。
|
いいえ |
translate |
このプロパティを使用して、autotranslate コンテキスト変数に対して設定したブール値をオーバーライドします。この変数を設定していない場合、またはfalse に設定した場合、このプロパティをtrue に設定して、このコンポーネントに対してのみ自動翻訳を有効にすることができます。autotranslation 変数をtrue に設定した場合、このプロパティをfalse に設定して、このコンポーネントを自動翻訳から除外できます。スキルでの翻訳サービスを参照してください。
|
いいえ |
footerText |
テキストのみのチャネルでの出力を拡張します。フッターで説明されているように、FreeMarker式を使用して、テキストのみのチャネルのフッター・テキストに条件を設定できます。 | いいえ |
transitionAfterMatch (非推奨)
|
ブール。これをtrue に設定すると、このコンポーネントによって実行されるエンティティ一致から別の状態への一時的な遷移が可能になります。このプロパティはサポートされていません。この機能を取得するには、エンティティ・イベント・ハンドラを使用します |
いいえ |
cancelPolicy |
cancel 遷移のタイミングを決定します:
maxPromptsReached ハンドラに登録している場合、このプロパティは無視されます。 |
いいえ |
System.CommonResponse
コンポーネントに基づく状態の例のYAMLを次に示します。
AskPizzaSize:
component: "System.CommonResponse"
properties:
variable: "pizzaSize"
nlpResultVariable: "iresult"
maxPrompts: 2
metadata:
responseItems:
- type: "text"
text: "<#if system.invalidUserInput == 'true'>Invalid size, please try again.\
\ </#if>What size do you want?"
name: "What size"
separateBubbles: true
actions:
- label: "${enumValue}"
type: "postback"
payload:
action: ""
variables:
pizzaSize: "${enumValue}"
name: "size"
iteratorVariable: "pizzaSize.type.enumValues"
processUserMessage: true
transitions:
actions:
cancel: "Intent"
next: "AskLocation"
ヒント:
このスニペットのtext
プロパティは、Apache FreeMarker Template Language (FTL)を使用して定義されています。FTL式を追加し、FreeMarkerの組込み操作を使用して変数値を変換する方法については、Apache FreeMarker Template Languageの構文を参照してください。
System.CommonResponseコンポーネントの遷移
遷移 | 説明 |
---|---|
cancel |
maxAttempts プロパティによって設定された割当て済試行またはフローのリダイレクトをユーザーが超える場合にトリガーされます。
|
textReceived |
ユーザーがアクション・ボタンまたはリンクをタップするかわりにテキストまたは絵文字を送信したときにトリガーされます。 |
attachmentReceived |
ユーザーがイメージ、オーディオ、ビデオまたはファイル添付を送信したときにトリガーされます。 |
locationReceived |
ユーザーがロケーションを送信したときにトリガーされます。 |
system.outOfOrderMessage |
予期しないユーザー動作を回避するために、これを設定します。具体的には、ユーザーが現在のメッセージ内のアクション・アイテムをタップせず、かわりにチャット・セッション内の古いメッセージに属するアクションをタップするときです。 |
System.CommonResponseコンポーネントのコンポジット・バッグ遷移
System.CommonResponse
コンポーネントは、ユーザー入力と一致した値と、cancelPolicy
プロパティの構成に基づいて、match
およびcancel
アクションをトリガーします。
アクション | 説明 | 必須? |
---|---|---|
match |
コンポーネントは、バッグ内の少なくとも1つのエンティティがユーザー入力と一致した場合に、指定された状態に移動するためにこのアクションをトリガーします。 | いいえ |
cancel |
コンポーネントは、cancelPolicy プロパティの設定に基づいて、このアクションをトリガーして指定された状態にナビゲートします。
|
いいえ |
System.Webview
System.Webview
コンポーネントは、Webビューをスキル内で、またはWebチャネルで実行されるスキルの場合はブラウザ・タブで開きます。
System.WebViewコンポーネントのプロパティ
プロパティ | 説明 | 必須? |
---|---|---|
sourceVariableList |
コンテキスト変数名またはユーザー変数名のカンマ区切りリスト。これらの変数名は、Webビューに送信されるパラメータであり、ボットからの入力パラメータです。各変数を設定するには、System.Webview 状態の前に一連のSystem.SetVariable 状態を追加します。
|
はい |
variable |
ユーザーがWebビュー内で対話を完了した後でボットに返されるWebビューのペイロードを識別する変数の名前(文字列値)。
ペイロードはこの変数に格納されるため、これにダイアログ・フロー定義内で後でアクセスできます。たとえば、出力コンポーネントでこれを参照できます。 |
はい |
prompt |
「タップして続行」などのテキスト文字列。 | いいえ |
service |
Webビュー・コンポーネント・サービスの名前。 | いいえ |
imageUrl |
プロンプトに付随するイメージへのURL。 | いいえ |
linkLabel |
Webアプリケーションを起動するボタンのラベル。 | いいえ |
cancelLabel |
ユーザーがWebアプリケーションを起動しないで状態を終了できるようにする取消しボタンのラベル。 | いいえ |
autoNumberPostbackActions |
番号に相当するものをUI要素に追加することによって、ボタンがサポートされていないSMSチャネルでのユーザー入力を可能にします。
|
いいえ |
translate |
このプロパティを使用して、autotranslate コンテキスト変数に対して設定したブール値をオーバーライドします。この変数を設定していない場合、またはfalse に設定した場合、このプロパティをtrue に設定して、このコンポーネントに対してのみ自動翻訳を有効にすることができます。autotranslation 変数をtrue に設定した場合、このプロパティをfalse に設定して、このコンポーネントを自動翻訳から除外できます。スキルでの翻訳サービスを参照してください。
|
いいえ |
System.IncidentCreation
System.IncidentCreation
コンポーネントを使用して、カスタマ・サービス・サイトにインシデントを作成できます。インスタンスでこのコンポーネントを使用するには、「設定」→「追加サービス」→「カスタマ・サービス統合」ページからカスタマ・サービス統合を作成する必要があります。
次の例では、このコンポーネントを使用して会話をOracle B2C Serviceサイトに戻します。
component: "System.IncidentCreation"
properties:
serviceName: "IncidentService"
subject: "${incident.value.subject}"
attachmentUrl: <#if (incident.value.Attachment.url)??>${incident.value.Attachment.url}<#else></#if>
customFields:
description: "${incident.value.description}"
contactInfo: "<#if (profile.contactInfo)??>${profile.contactInfo}<#else></#if>"
contactProperties:
firstName: "${profile.firstName}"
lastName: "${profile.lastName}"
email: "${incident.value.email}"
incidentNumberVariable: "incidentNumber"
transitions:
error: "incidentError"
next: "exitIncident"
次に、Oracle Fusion Serviceの例を示します。
component: "System.IncidentCreation"
properties:
serviceName: "IncidentServiceB2BEndUserAuth"
subject: "${service.value.subject}"
attachmentUrl: <#if (service.value.Attachment.url)??>${service.value.Attachment.url}<#else></#if>
agentReportFilter: "ODAQueue"
addChatTranscript: "true"
customFields:
description: "${service.value.description}"
contactInfo: "<#if (profile.contactInfo)??>${profile.contactInfo}<#else></#if>"
contactProperties:
firstName: "${profile.firstName}"
lastName: "${profile.lastName}"
email: "<#if (profile.email)??>${profile.email}<#else></#if>"
incidentNumberVariable: "incidentNumber"
transitions:
error: "incidentError"
next: "exitIncident"
プロパティ | 説明 | 必須? | |
---|---|---|---|
serviceName |
「設定」→「追加サービス」→「カスタマ・サービス統合」で構成されている統合の名前。 | はい | |
subject |
インシデントのサブジェクトのテキスト。 | はい | |
attachmentUrl |
インシデントに関連するドキュメントまたはイメージのURL。DA (エージェント)スキルでは、添付の追加はサポートされていません。 | いいえ | |
agentReportFilter |
(Oracle Fusion Serviceインシデントの場合)インシデントをフィルタするテキスト。デフォルト値はODA です。
|
いいえ | |
addChatTranscript |
(Oracle Fusion Serviceインシデントの場合のみ。)trueに設定すると、チャット・トランスクリプトがインシデントに追加されます。デフォルトはfalseです。
チャット・トランスクリプトを使用可能にするには、スキルに対してインサイトを有効にする必要があります。 トランスクリプトは、DAをエージェント統合としてWeb Chat for ServiceまたはOracle Inlay Toolkitインレーと組み合せて使用する場合にのみインシデントに追加できます。 |
いいえ | |
customFields |
インシデントに関する追加の詳細を含むdescription およびオプションでcontactInfo を含むマップ。
マップは、オブジェクトのテキスト・バージョンとして未検証で渡され、インシデント・メッセージに非公開ノートとして挿入されます。 |
いいえ | |
contactProperties |
顧客サービス担当者情報の参照または作成に必要な情報を含む名前/値ペアのマップ。これにはemail が含まれている必要があり、オプションでfirstName およびlastName を含めることができます。
|
Oracle B2C Serviceの場合のみ | |
incidentNumberVariable |
インシデント番号を格納する文字列コンテキスト変数の名前。 | いいえ |
System.IntelligentAdvisor
このコンポーネントを使用して、スキルからOracle Intelligent Advisorインタビューにアクセスします。
このコンポーネントを使用する前に、インテリジェント・アドバイザ・サービス統合を作成する必要があります。インテリジェント・アドバイザ・サービスの追加を参照してください。また、インタビューがインテリジェント・アドバイザ・ハブにデプロイされ、チャット・サービス・チャネルでアクティブ化されている必要があります。インタビューは匿名ユーザー向けである必要があります。ポータル・ユーザーまたはエージェント・ユーザーのインタビューにはアクセスできません。
コンポーネントのプロパティを使用して、次のインタビュー設定を指定できます:
- タイトルと説明を表示するかどうか
- 肯定、否定、不確実のボタンのラベル
- リセット、前の質問に戻る(元に戻す)、インタビューの終了のために、ユーザーが入力する文字列
- インタビューの終了時に表示するテキスト
- 説明を表示するかどうかという質問を表現する方法
- ファイルのアップロードが完了したことを示すためにユーザーが入力する文字列
- インタビューに渡す属性値とコネクタ・パラメータ
- 使用するプロジェクトロケール
次の例は、次のとおりです:
loanAdvisorIA:
component: "System.IntelligentAdvisor"
properties:
intelligentAdvisorService: "myService"
deployment: "Loan Advisor"
# default yesLabel: "yes"
# default noLabel: "no"
uncertainLabel: "not sure"
endLabel: "You can ask me another question if there's something else that I can help
you with."
# default doneLabel: "/done"
# default undoLabel: "/back"
# default resetLabel: "/reset"
# default exitLabel: "/exit"
showExplanation: "ask"
# default explanationAskLabel: "Do you want to see the explanation?"
# default removeHtml: false
transitions:
error: "handleIAError"
next: "endOfFlow"
handleIAError:
component: "System.Output"
properties:
text: |
We are having a problem with a connection.
Can you please send email to
contact@example.com to let them know that
the loan advisor isn't working? Thank you.
transitions:
next: "endOfFlow"
ダイアログ・フローでコンポーネントを使用する例は、スキルにおけるインテリジェント・アドバイザ・コンポーネントの使用を参照してください。
ヒント:
すべてのラベル・プロパティのデフォルト値は、スキルのリソース・バンドルに格納されます。デフォルトを変更するには、スキルの「リソース・バンドル」ページを開き、
構成リソース・バンドルでは、IntelligentAdvisor - defaultValue、IntelligentAdvisor - doneHelp、IntelligentAdvisor - maskLabel、IntelligentAdvisor - outOfOrderMessage、IntelligentAdvisor - resumeSessionPrompt、IntelligentAdvisor - numberMinMax、IntelligentAdvisor - outOfOrderMessage、IntelligentAdvisor - resumeSessionPrompt、IntelligentAdvisor - yesNoMessageの各メッセージも変更できます。たとえば、IntelligentAdvisor - doneHelpメッセージは添付ファイル・フィールドに対して出力され、デフォルトはWhen you are done with the upload, say {0}.
です。Say {0} to let me know that you are done uploading.
のように変更することもできます。
プロパティ | 説明 | 必須? |
---|---|---|
currency |
インタビューで使用される通貨のISO-4217通貨コード。このコードを指定した場合、ユーザーはその通貨に対して許可されているフォーマットでのみ通貨値を入力できます。面接で通貨金額の入力を求められない場合、または特定の通貨が必要ない場合は、このプロパティを空白に設定するか、除外することができます。 | いいえ |
deployment |
インテリジェント・アドバイザ・ハブ上のアクティブなデプロイメント・プロジェクトの名前。 | はい |
doneLabel |
ファイルのアップロードが完了したことを示すためにユーザーが入力するテキスト。
デフォルトは |
いいえ |
endLabel |
インタビューの終了時にチャットに表示するテキスト。
デフォルトは |
いいえ |
exitLabel |
インタビューを終了することを示すためにユーザーが入力するテキスト。
デフォルトは |
いいえ |
explanationAskLabel |
showExplanation がask に設定されている場合に尋ねる質問。
デフォルトは |
いいえ |
hideScreenTitle |
インタビューの画面タイトルをすべて非表示にするかどうかを示します。
デフォルトは |
いいえ |
intelligentAdvisorService |
「設定」→「追加サービス」で構成されたインテリジェント・アドバイザ・サービスの名前。 | はい |
interviewAttributes |
インタビューの属性値を格納する文字列型のコンテキスト変数の名前。属性値は、キーと値のペアの配列として格納されます。 | いいえ |
locale |
このプロパティは、ターゲットのインタビューと日付および数値の解決の両方に影響します。 コンポーネントは、コンポーネントの 日付および数値入力の場合、値はDATEおよびNUMBERエンティティ設定に従って解決されます。エンティティの「エンド・ユーザー・ロケールの検討」を「オン」に切り替えると、このプロパティで指定されたロケール(または指定されていない場合はデフォルト)の値が解決されます。ロケールベースのエンティティ解決を参照してください。 このプロパティのデフォルト値は |
いいえ |
noLabel |
ブールのFALSE値を表すために使用するラベル。
デフォルトは |
いいえ |
params |
インタビューの開始時に渡されるキー/値接続パラメータのマップ。これは通常、外部データ統合とのインタビューに必要です。 | いいえ |
removeHtml |
テキストからHTMLマークアップを削除するかどうかを示します。デフォルトはfalse です。
|
いいえ |
resetLabel |
最初の質問に戻ることを示すためにユーザーが入力するテキスト。
デフォルトは |
いいえ |
seedData |
インタビューに渡すインテリジェント・アドバイザの属性名と値のマップ。日付や時刻の属性には、インテリジェント・アドバイザの標準の日付と時刻の書式を使用します。例: start_date: "2010-01-31" 。
値を渡す属性では、ポリシー・モデリングで「URLパラメータからのシード」オプションが有効になっている必要があります。 |
いいえ |
showExplanation |
インテリジェント・アドバイザの説明を表示するかどうかを指定します。指定できる値は、never 、always およびask です。
デフォルトは |
いいえ |
uncertainLabel |
値がわからない場合にユーザーが入力できるラベル。このラベルは、オプションのブール・ラジオ・ボタンに表示されます。
デフォルトは |
いいえ |
undoLabel |
直前の質問に戻ることを示すためにユーザーが入力するテキスト。
デフォルトは |
いいえ |
yesLabel |
ブールのTRUE値を表すために使用するラベル。
デフォルトは |
いいえ |
例: スキルにおけるインテリジェント・アドバイザ・コンポーネントの使用
####################
# Loan Advisor
####################
loanAdvisorStart:
component: "System.Output"
properties:
keepTurn: true
text: |
OK, I can initiate a loan request for you.
But first I'll transfer you to an
automated advisor that will ask some
questions about the loan that you want,
your assets, your liabilities, and your
financial history. It shouldn't take
more than 5 minutes.
<#if (user.notFirstTime)??><#else>
At any time, you can say
/back to go to the previous question,
/reset to start over or
/exit to stop the questions.</#if>
transitions:
next: "setNotFirstTime"
setNotFirstTime:
component: "System.SetVariable"
properties:
variable: "user.notFirstTime"
value: true
transitions:
next: "loanAdvisorIA"
loanAdvisorIA:
component: "System.IntelligentAdvisor"
properties:
intelligentAdvisorService: "myService"
deployment: "Loan Qualifier"
# default yesLabel: "yes"
# default noLabel: "no"
uncertainLabel: "not sure"
endLabel: " "
# default doneLabel: "/done"
# default undoLabel: "/back"
# default resetLabel: "/reset"
# default exitLabel: "/exit"
showExplanation: "ask"
# default explanationAskLabel: "Do you want to see the explanation?"
interviewAttributes: "interviewDetails"
transitions:
error: "handleIAError"
next: "handleEligibility"
handleEligibility:
component: "System.Switch"
properties:
source: <#list interviewDetails.value as i><#if i.key = 'eligibility'>${i.val}</#if></#list>
# The values that are matched against the value of the variable or source property. The value that matches is set as transition action
values:
- "eligible"
- "noteligible"
transitions:
actions:
eligible: "initiateLoan"
noteligible: "suggestNextSteps"
NONE: "handleUnexpectedAttributeValue" # the attribute value was other than eligible or noteligible or the user exited interview
error: "handleAttributeNotSet" # the attribute wasn't set during the interview or the key is incorrect
handleIAError:
component: "System.Output"
properties:
text: |
We are having a problem with a connection.
Can you please send email to
contact@example.com to let them know that
the loan advisor isn't working? Thank you.
transitions:
next: "endOfFlow"
...
例: 面接属性へのアクセス
インタビューの属性値にアクセスする簡単な例を次に示します。
context:
variables:
iResult: "nlpresult"
interviewDetails: "string"
states:
...
loanAdvisorIA:
component: "System.IntelligentAdvisor"
properties:
intelligentAdvisorService: "myService"
deployment: "Loan Qualifier"
# default yesLabel: "yes"
# default noLabel: "no"
uncertainLabel: "not sure"
endLabel: " "
# default doneLabel: "/done"
# default undoLabel: "/back"
# default resetLabel: "/reset"
# default exitLabel: "/exit"
showExplanation: "ask"
# default explanationAskLabel: "Do you want to see the explanation?"
interviewAttributes: "interviewDetails"
transitions:
error: "handleIAError"
next: "handleEligibility"
handleEligibility:
component: "System.Switch"
properties:
source: <#list interviewDetails.value as i><#if i.key = 'eligibility'>${i.val}</#if></#list>
# the values that are matched against the value of the variable or source property. The value that matches is set as transition action
values:
- "eligible"
- "noteligible"
transitions:
actions:
eligible: "initiateLoan"
noteligible: "suggestNextSteps"
NONE: "handleUnexpectedAttributeValue" # the attribute value was other than eligible or noteligible or the user exited interview
error: "handleAttributeNotSet" # the attribute wasn't set during the interview or the key is incorrect
...
System.KnowledgeSearch
このコンポーネントを使用して、Oracle B2C Service Knowledge FoundationまたはOracle Fusion Service Knowledge Managementで特定の検索語に関する情報を検索し、結果を表示します。
Oracle B2C Serviceの場合、サービスが返す結果は、回答が公開されているかどうか、およびアクセス・レベル、製品、カテゴリの設定によって異なります。
このコンポーネントを使用するには、ナレッジ検索サービスを作成する必要があることに注意してください。ナレッジ検索サービスの追加を参照してください。
このコンポーネントの使用例を次に示します。ユーザーの最後の発話に関連するすべての情報をナレッジ管理サービスで検索します。その他の例は、ナレッジ検索コンポーネントの使用を参照してください。
searchFor: knowledgeSearch:
component: "System.KnowledgeSearch"
properties:
searchServiceName: "myKnowledgeSearch"
searchTerm: "${iResult.value.query}"
searchPrelude: "I don't know the answer for that. Let me search for an answer."
resultSizeLimit: 5
resultVersion: "Special Response"
resultVersionExclusive: true
resultLinkLabel: "Show More"
searchLinkLabel: "Open Page with All Answers" # For B2B set to "Go to search home page"
noResultText: "I don't have an answer for that. Try rephrasing your question."
transitions:
actions:
resultSent: "reset"
noResult: "reset"
serverError: "handleSearchServerProblem"
error: "handleSearchError"
next: "reset"
ヒント:
defaultAttachmentLabel
、noResultText
およびresultLinkLabel
プロパティのデフォルト値は、スキルのリソース・バンドルに格納されます。デフォルトを変更するには、スキルの「リソース・バンドル」ページを開き、
プロパティ | 説明 | 必須? |
---|---|---|
cardLayout |
結果カードを垂直方向と水平方向のどちらで表示するかを指定します。デフォルトはhorizontal です。
|
いいえ |
customFilters |
名前と値のペアとして表示される検索結果フィルタのリスト。使用可能なフィルタ名は、product およびcategory です。それぞれが、1つのフィルタ宣言のみを許可します。「製品およびカテゴリ別の結果のフィルタ」を参照してください。
|
いいえ |
customProperties |
Oracle B2C Serviceのみ: 検索サービスに送信するキー/値ペアのマップ。現在、このプロパティはword_connector キーのみをサポートしています。word_connector プロパティをAND に設定して、検索語のすべての単語の前に+ を付加します。
|
いいえ |
defaultAttachmentLabel |
アタッチメントに表示名が構成されていないときに常にアタッチメントにリンクされた結果カードのURLアクションに使用するデフォルトのラベル。使用される場合は、索引番号が付加されます。たとえば、2番目のアタッチメントに表示名がない場合、デフォルトのアタッチメント・ラベルに デフォルトは、 |
いいえ |
locale |
デフォルトは、profile.locale 変数の値です。
Oracle B2C Serviceマルチインタフェース・ナレッジ統合サービスの場合、検索の実行に使用するインタフェースを指定する5文字のISOまたはBCPロケール・コード(例: en_GB)。ロケールをサポートするインタフェースがない場合は、デフォルトのインタフェースが使用されます。多言語ナレッジ検索の実装を参照してください。 Oracle Fusion Serviceの場合、指定したロケールに関連付けられている記事をフェッチします。一致する記事がロケールに存在しない場合、 |
いいえ |
noResultText |
使用可能な検索結果がない場合に出力するテキスト。 デフォルトは、KnowledgeSearch - noResultTextリソース・バンドル・エントリのテキストです。 |
いいえ |
resultLinkLabel |
Webバージョンの情報にリンクする結果カードのURLアクション(ボタン)に使用するラベル。 デフォルトは、KnowledgeSearch - resultLinkLabelリソース・バンドル・エントリのテキストです。 このプロパティを |
いいえ |
resultSizeLimit |
表示する最大結果数。 デフォルトは |
いいえ |
resultVersion |
Oracle B2C Serviceのみ: 結果に複数のバージョンがある場合に返す優先バージョン。 このプロパティを 特別なレスポンスを利用すると、Webページではなく、チャット会話専用に調整された出力を表示できます。 デフォルトのバージョンは |
いいえ |
resultVersionExclusive |
Oracle B2C Serviceのみ: 優先バージョンで使用可能な結果のみを表示するかどうかを指定します。
デフォルトは |
いいえ |
searchLinkLabel |
Oracle B2C Service: 完全検索結果リストが掲載されているWebページにリンクされたカード・メッセージ・ペイロード・アクションに使用するラベル。 Oracle Fusion Service: ホーム検索ページにリンクされているカード・メッセージ・ペイロード処理に使用するラベル。 このプロパティが設定されていない場合、カード・メッセージ・ペイロードにアクションは表示されません。 |
いいえ |
searchPrelude |
検索結果が表示される前に出力するテキスト。 このプロパティが設定されていない場合、KnowledgeSearch - searchPreludeリソース・バンドル・エントリのテキストが出力されます。 検索のプリロードを表示しない場合は、このプロパティを |
いいえ |
searchServiceName |
「設定」で構成されたナレッジ検索統合の名前。 | はい |
searchTerm |
ナレッジ検索起動の検索語として使用するテキスト。Oracle Fusion Service Knowledge Managementには検索語が必要です。Oracle B2C Service Knowledge Foundationでは、検索語が指定されていない場合、最も人気のある記事が返されます。
検索用語の手法は、ナレッジ検索コンポーネントの使用を参照してください。 |
はい |
System.KnowledgeSearchの遷移
アクション | 説明 |
---|---|
resultSent |
検索で結果が少なくとも1つ返されました。 |
noResult |
検索語の結果がありませんでした。 |
serverError |
サーバー・エラー障害や予期しないエラー障害など、起動中にナレッジ検索サービスのサーバーでエラーが発生しました。
このエラーが発生すると、エラー・メッセージは |
例: YAMLダイアログ・フローでの関連質問と検索語の関連付け
次の図に、ダイアログ・フローがYAMLモードで作成されている場合の単一状態メソッドの実装方法を示します。1)マップ・コンテキスト変数を使用して、ナレッジ・インテントを検索語に関連付けます。2)各ナレッジ・インテントを設定しますIntent
状態のアクション。マップを使用してsearchTerm
コンテキスト変数をインテントの検索語に設定するデータ・フローに遷移します。3)次に、searchTerm
値をナレッジ・ベースで検索する状態に遷移します。
図kf-assoc-intent-with-term.pngの説明
ナレッジ・ベース・アンサーごとに個別のインテントがあるダイアログ・フローの例を次に示します。
context:
variables:
iResult: "nlpresult"
intentName: "string"
searchTerm: "string"
searchTerms: "map"
someVariable: "string" # For the reset state
states:
#
# Set search term for each knowledge intent
#
setSearchTerms:
component: "System.SetVariable"
properties:
variable: "searchTerms"
value:
knowledge.Shipping Return Costs: "Shipping Return Costs"
knowledge.Locate Service Tag or Serial: "Locating Your Service Tag or Asset Serial Number"
knowledge.Support Account: "My Support Account"
knowledge.Product Registration: "How do I register my product?" # (1)
knowledge.Noncontiguous Delivery Time: "What is the delivery time to Alaska, Hawaii and the U.S. Territories?"
knowledge.Return Policy: "What is your return policy?"
transitions:
next: "intent"
intent:
component: "System.Intent"
properties:
variable: "iResult"
transitions:
actions:
system.Greeting: "welcome"
system.Unsatisfactory Response: "transferToAgent"
system.Request Agent: "transferToAgent"
knowledge.Shipping Return Costs: "startIntentKnowledgeSearch"
knowledge.Locate Service Tag or Serial: "startIntentKnowledgeSearch"
knowledge.Support Account: "startIntentKnowledgeSearch"
knowledge.Product Registration: "startIntentKnowledgeSearch" # (2)
knowledge.Noncontiguous Delivery Time: "startIntentKnowledgeSearch"
knowledge.Return Policy: "startIntentKnowledgeSearch"
unresolvedIntent: "genericKnowledgeSearch"
#
# Start knowledge search for a knowledge intent's search term
# based on searchTerms context variable
#
# First, reset variables
#
startIntentKnowledgeSearch: # (2)
component: "System.ResetVariables"
properties:
variableList: "searchTerm, intentName"
transitions:
next: "setIntentName"
#
# Set the intentName context variable
#
setIntentName:
component: "System.SetVariable"
properties:
variable: "intentName"
value: "${iResult.value.intentMatches.summary[0].intent}"
transitions:
next: "setSearchTerm"
#
# Get the search term to use for the intent
#
setSearchTerm:
component: "System.SetVariable"
properties:
variable: "searchTerm"
value: "${searchTerms.value[intentName.value]}"
transitions:
next: "knowledgeSearchForGivenSearchTerm" # (3)
#
# This state searches for the searchTerm variable's value
#
knowledgeSearchForGivenSearchTerm:
component: "System.KnowledgeSearch"
properties:
# Set to the name of the search service that is configured in Settings
searchServiceName: "KnowledgeSearch"
searchTerm: "${searchTerm.value}" # put the search term here (3)
# searchPrelude: Optional property. If missing, there's no search prelude.
resultSizeLimit: 1 # Change to how many articles to show.
# resultVersion: Optional property. Defaults to "Answer".
# resultVersionExclusive: Optional property. Defaults to false.
resultLinkLabel: "Show More"
# defaultAttachmentLabel: Optional property. Defaults to "Download"
searchLinkLabel: "Search for Similar Answers"
noResultText: >
I don't have an answer for that. Try rephrasing your question
(or you can ask to speak to a live agent).
# cardLayout: Optional property. Defaults to "horizontal"
transitions:
actions:
resultSent: "offerMoreHelp"
noResult: "reset"
serverError: "handleSearchServerProblem"
error: "handleSearchError"
next: "reset"
#
# This state is called after knowledge search returns its results.
#
offerMoreHelp:
component: "System.Output"
properties:
text: >
You can ask me another question if there's something
else that I can help you with.
transitions:
return: "offerMoreHelp"
#
# This state is called when there's a problem accessing the knowledge base such
# as a server error fault or an unexpected error fault. When this error occurs,
# the error message is stored in system.state.<state-name>.serverError.message.
#
handleSearchServerProblem:
component: "System.Output"
properties:
text: >
I'm not able to get an answer for that question. Let me know
if there's anything else I can help you with.
transitions:
return: "handleSearchServerProblem"
#
# This state is called when there's a problem using the knowledge search component
# such as when there's a problem with the knowledge search integration configuration
#
handleSearchError:
component: "System.Output"
properties:
text: >
Oops, my answer mechanism for that isn't working properly.
You can ask a different question or ask to speak to an agent?
transitions:
return: "handleSearchError"
#
# This state ends the conversation
#
reset:
component: "System.SetVariable"
properties:
variable: "someVariable"
value: "x"
transitions:
return: "reset"
例: 検索語としてのユーザー発話の使用
次の例は、YAMLダイアログ・スキルでsearchTerm
をユーザーの発話に設定する方法を示しています。ビジュアル・ダイアログ・スキルの場合は、かわりに${skill.system.nlpresult.value.query}
を使用します。
context:
variables:
iResult: "nlpresult"
someVariable: "string" # For the reset state
states:
intent:
component: "System.Intent"
properties:
variable: "iResult"
transitions:
actions:
system.Greeting: "welcome"
system.Unsatisfactory Response: "transferToAgent"
...
unresolvedIntent: "genericKnowledgeSearch"
#
# This state searches the knowledge base with the user input as the search term.
#
genericKnowledgeSearch:
component: "System.KnowledgeSearch"
properties:
# Set to the name of the search service that is configured in Settings
searchServiceName: "KnowledgeSearch"
searchTerm: "${iResult.value.query}"
searchPrelude: "I don't know the answer offhand. Let's see what articles we have..."
resultSizeLimit: 3 # Change to how many articles to show. Defaults to 10.
# resultVersion: Optional property. Defaults to "Answer".
# resultVersionExclusive: Optional property. Defaults to false.
resultLinkLabel: "Show More"
# defaultAttachmentLabel: Optional property. Defaults to "Download"
searchLinkLabel: "Open Page with All Answers"
noResultText: >
I couldn't find any articles about that. Try rephrasing your
question (or you can ask to speak to a live agent).
# cardLayout: Optional property. Defaults to "horizontal"
transitions:
actions:
resultSent: "offerMoreHelp"
noResult: "reset"
serverError: "handleSearchServerProblem"
error: "handleSearchError"
next: "reset"
#
# This state is called after knowledge search returns its results.
#
offerMoreHelp:
component: "System.Output"
properties:
text: >
You can ask me another question if there's something
else that I can help you with.
transitions:
return: "offerMoreHelp"
#
# This state is called when there's a problem accessing the knowledge base such
# as a server error fault or an unexpected error fault. When this error occurs,
# the error message is stored in system.state.<state-name>.serverError.message.
#
handleSearchServerProblem:
component: "System.Output"
properties:
text: >
I'm not able to get an answer for that question. Let me know
if there's anything else I can help you with.
transitions:
return: "handleSearchServerProblem"
#
# This state is called when there's a problem using the knowledge search component
# such as when there's a problem with the knowledge search integration configuration
#
handleSearchError:
component: "System.Output"
properties:
text: >
Oops, my answer mechanism for that isn't working properly.
You can ask a different question or ask to speak to an agent?
transitions:
return: "handleSearchError"
#
# This state ends the conversation
#
reset:
component: "System.SetVariable"
properties:
variable: "someVariable"
value: "x"
transitions:
return: "reset"
System.AgentTransfer
DA (エージェント)デジタル・アシスタントでSystem.AgentTransfer
コンポーネントを使用して、会話をチャット・サービスに戻します。会話は、チャット・サービスで構成されているチャット・ルールによってライブ・エージェントにルーティングされます。
このコンポーネントは、デジタル・アシスタント(エージェント)のフレームワークの動作で説明されているように、サービスのチャットで発生した会話用です。スキルで発生した会話の場合は、かわりにSystem.AgentConversationを使用します。
次に、このコンポーネントを使用して会話をチャット・サービスに戻す例を示します。
transferToAgent:
component: "System.AgentTransfer"
properties:
maxEngagementsInQueue: "8"
maxWaitSeconds: "300"
waitingMessage: "Let me see if a human agent is available to help you. Hold tight."
rejectedMessage: "No agents are available at this time. Please try again later."
errorMessage: "We're unable to transfer you to a human agent because there was a system error."
transitions:
actions:
accepted: "reset"
rejected: "handleRejected"
error: "offerMoreHelp"
next:
"reset"
ヒント:
プラットフォーム・バージョンが21.04以降のスキルでは、acceptedMessage
、errorMessage
、rejectedMessage
およびwaitingMessage
プロパティのデフォルト値はスキルのリソース・バンドルに格納されます。デフォルトを変更するには、スキルの「リソース・バンドル」ページを開き、
プロパティ | 説明 | 必須? | |
---|---|---|---|
agentStatusVariable |
エージェント可用性ステータス情報の格納に使用する、タイプ・マップのコンテキスト変数の名前。プロパティが指定されていない場合、情報は格納されません。マップ変数を参照するには、${<mapVariableName>.value.<key>} のような値式を使用します。たとえば、agentStatus.value.expectedWaitMinutes です。
この変数で返される値について学習するには、System.AgentTransferConditionを参照してください。 |
いいえ | |
allowTransferIf |
スキルがチャット・セッションを転送する条件を指定します。
指定した条件が満たされない場合、 |
いいえ | |
customProperties |
サービスに渡す情報を保持するマップ。サービスへの情報の受渡しを参照してください。 | いいえ | |
errorMessage |
エージェントへのチャット・セッションの転送中にシステム・エラーが発生したときにユーザーに表示されるメッセージ。デフォルトは、「システム・エラーのため転送できません」 です。このプロパティを空白または空の文字列に設定して、メッセージ出力を抑制できます。
|
いいえ | |
maxEngagementsInQueue |
宛先キューで待機するエンゲージメントの最大許容数。チャット・リクエストが送信されると、チャット・サービスは、キュー内で待機している現在のエンゲージメント数を使用して応答します。この値がmaxEngagementsInQueue を超えると、rejected アクションが発生します。デフォルトは-1 で、エンゲージメントの制限がないことを意味します。
Oracle Fusion Service Chatの場合、レスポンスは常に0であるため、このプロパティはOracle Fusion Serviceの値ではありません。 |
いいえ | |
maxWaitSeconds |
許容される予測待機秒数の最大値。チャット・サービスは、転送リクエストを受け取ると、予測待機時間を使用して応答します。この値がmaxWaitSeconds を超えると、rejected アクションが発生します。このプロパティのデフォルトは-1 であり、これは最大待機時間がないことを意味します。-1 に設定されていると、予測待機時間に関係なく、デジタル・アシスタントはユーザーを人間のエージェントに転送します。
|
いいえ | |
rejectedMessage |
次のいずれかが発生した場合に常にユーザーに表示されるメッセージ:
Agent rejected です。このプロパティを空白または空の文字列に設定して、メッセージ出力を抑制できます。
|
いいえ | |
waitingMessage |
ユーザーがキューに転送されたときにユーザーに表示されるメッセージ。デフォルトは、「エージェント・チャット・セッションが確立されました。エージェントの参加を待機中」 です。このプロパティを空白または空の文字列に設定して、メッセージ出力を抑制できます。
|
いいえ |
このコンポーネントは、次のアクションを返すことができます:
アクション | 説明 |
---|---|
accepted |
accepted 遷移は、チャットがキューに正常に転送されたときに設定されます。
チャット・リクエストが受け入れられた後は、会話は
|
rejected |
rejected 遷移は、次のいずれかが発生したときに設定されます:
|
error |
error 遷移は、人間のエージェントへの転送を妨げるシステム・エラーがある場合に設定されます。
|
例: 人間のエージェントへの転送
顧客がエージェントとの会話を要求したときにエージェントに転送するダイアログ・フローの例を次に示します:
metadata:
platformVersion: "1.1"
main: true
name: "AutomatedAgentConversation"
context:
variables:
iResult: "nlpresult"
someVariable: "string"
states:
intent:
component: "System.Intent"
properties:
variable: "iResult"
transitions:
actions:
...
system.Unsatisfactory Response: "transferToAgent"
system.Request Agent: "transferToAgent"
...
#
# This state tries to transfer the user to another agent when the user explicitly requests for it.
#
transferToAgent:
component: "System.AgentTransfer"
properties:
maxWaitSeconds: "300"
waitingMessage: "I'm transferring you to a human agent. Hold tight."
rejectedMessage: "I wasn't able to transfer you to a human agent. Please try again later."
errorMessage: "We're unable to transfer you to a human agent because there was a system error."
transitions:
actions:
accepted: "reset"
rejected: "handleRejected"
error: "offerMoreHelp"
next: "reset"
#
# This state is called when an agent transfer is rejected.
# It lets the customer know they can ask for something else.
#
handleRejected:
component: "System.Output"
properties:
text: "Meanwhile, let me know if there's anything else I can help you with."
transitions:
return: "handleRejected"
#
# This state is called when an agent transfer encounters a system error.
# It lets the customer know they can ask for something else.
#
offerMoreHelp:
component: "System.Output"
properties:
text: >
You can ask me another question if there's something
else that I can help you with.
transitions:
return: "offerMoreHelp"
#
# This state ends the conversation with a return transition for insights purposes,
# after the user has been transferred to another agent.
#
reset:
component: "System.SetVariable"
properties:
variable: "someVariable"
value: "x"
transitions:
return: "reset"
例: サービスへの情報の受渡し
デジタル・アシスタントからライブ・エージェントに会話を転送する場合、System.AgentTransfer
コンポーネントのカスタム・プロパティを使用してこの情報を渡すことができます。
Oracle B2C Serviceの構造を次に示します:
customProperties:
- name:
value:
type:
カスタム・フィールドにはtype
プロパティが必要です。それ以外の場合はオプションです。
Oracle Fusion Serviceの構造は次のとおりです。
customProperties:
- name:
value:
Oracle Fusion ServiceのcustomProperties
設定の例:
doTransfer:
component: "System.AgentTransfer"
properties:
maxWaitSeconds: "300"
allowTransferIf: "agentSessionsAreAvailable"
# Example of passing a custom property to Oracle Fusion
Service
customProperties:
# This is a checkbox custom field in the Universal Work Object.
# Checkboxes take the value of Y (selected) or N (unselected).
- name: "TriagedByODA_c"
value: "Y"
acceptedMessage: "The conversation has been transferred to a live agent."
waitingMessage: "I'm transferring you to a human. Hold tight"
rejectedMessage: "Looks like no one is available. Please try later"
errorMessage: "We're unable to transfer you to a live agent because there was a system error."
transitions:
actions:
accepted: "reset"
rejected: "handleRejected"
error: "offerMoreHelp"
next: "reset"
ヒント:
Oracle Fusion Serviceでは、ルール評価は、すべての条件が満たされる最初のルールまでしか行われません。ルールを構成する際は、転送された会話がデジタル・アシスタント・エージェントにルーティングで戻されないことを確認します。doTransfer
の例では、カスタム・プロパティTriagedByODA_c
がY
に設定されています。ルールは、このカスタム・プロパティを使用して、Y
に設定されている場合に会話がデジタル・アシスタント・エージェントにルーティングされないようにできます。(Oracle B2C Serviceでは、「状態を移行して停止」構成によってルーティングが決まります。)
System.AgentTransferCondition
DA-as-agentデジタル・アシスタントでSystem.AgentTransferCondition
コンポーネントを使用して、エージェントが使用可能かどうか、および可能であれば予想される待機時間を判断できます。
コンポーネントのプロパティを使用して転送条件を指定し、条件が満たされたかどうかを示すアクションを返します。また、名前付きコンテキスト・マップ変数の値を次のように設定します。
queueId (integer, optional): The engagement queue ID,
expectedTotalWaitSeconds (integer, optional): Expected wait time in the queue in seconds
( -1 if there's inadequate information, zero or greater otherwise ).,
expectedWaitSeconds (integer, optional): The number representing the "ss" segment of the expected wait time of format mm:ss
( -1 if there's inadequate information, zero or greater otherwise ).,
expectedWaitMinutes (integer, optional): The number representing the "mm" segment of the expected wait time of format mm:ss
( -1 if there's inadequate information, zero or greater otherwise ).,
availableAgentSessions (integer, optional): Total number of sessions available across all agents.,
totalAvailableAgents (integer, optional): Total number of agents whose status is available.,
totalUnavailableAgents (integer, optional): Total number of agents whose status is unavailable.,
totalAgentsRequestingNewEngagement (integer, optional): Total number of agents who are available and have capacity.,
outsideOperatingHours (boolean, optional): True if outside operating hours. False if inside operating hours.,
engagementsInQueue (integer, optional): The number of engagements currently in the queue.,
sessionId (string, optional): The session ID.,
clientId (integer, optional): The client ID.
次に、このコンポーネントを使用してエージェントが使用可能かどうかを確認し、待機時間をレポートし、ユーザーが転送要求を長時間待機しない場合は取り消すことができる例を示します。
handleAgentRequest:
component: "System.CommonResponse"
properties:
keepTurn: true
metadata:
responseItems:
- type: "text"
text: "I understand. Give me a moment while I see who might be available to help you."
transitions:
next: "evaluateAgentTransferCondition"
############################
# Agent Transfer
############################
# See if there are any agents available
evaluateAgentTransferCondition:
component: "System.AgentTransferCondition"
properties:
maxWaitSeconds: 300
maxEngagementsInQueue: 20
allowTransferIf: "agentsAreAvailable"
agentStatusVariable: "agentStatus"
transitions:
actions:
conditionsMet: "askIfWillWait"
conditionsNotMet: "handleRejected"
error: "handleTransferError"
next: "done"
askIfWillWait:
component: "System.CommonResponse"
properties:
processUserMessage: true
metadata:
responseItems:
- type: "text"
text: "${rb('promptTextForTransferDecision','minutes,seconds',agentStatus.value.expectedWaitMinutes,agentStatus.value.expectedWaitSeconds)}"
separateBubbles: true
actions:
- label: "Yes, I'll wait"
type: "postback"
keyword: "yes"
payload:
action: "yes"
name: "Yes"
- label: "No, nevermind"
keyword: "no"
type: "postback"
payload:
action: "no"
name: "No"
transitions:
actions:
yes: "transferToAgent"
no: "handleCancelled"
textReceived: "intent"
next: "handleCancelled"
# Perform the actual transfer
#
# The maxWaitSeconds, maxEngagementsInQueue, allowTransferIf,
# and customProperties, if any, should match those used for
# System.AgentTransferCondition
transferToAgent:
component: "System.AgentTransfer"
properties:
maxWaitSeconds: 300
maxEngagementsInQueue: 20
allowTransferIf: "agentsAreAvailable"
transitions:
actions:
accepted: "done"
rejected: "handleRejected"
error: "handleTransferError"
next: "handleTransferError"
ヒント:
予想される待機時間の表示に使用できる推奨リソース・バンドル定義を次に示します:This might take {minutes, plural,
=-1 {}
=0 {}
=1 {1 minute and }
other {# minutes and }
}{seconds, plural,
=-1 {a while}
=0 {{minutes, plural,
=0 {a short wait time}
other {0 seconds}
}}
=1 {1 second}
other {# seconds}
} to connect. Are you willing to wait?
プロパティ | 説明 | 必須? | |
---|---|---|---|
agentStatusVariable |
エージェント可用性ステータス情報の格納に使用する、タイプ・マップのコンテキスト変数の名前。プロパティが指定されていない場合、情報は格納されません。マップ変数を参照するには、${<mapVariableName>.value.<key>} のような値式を使用します。たとえば、agentStatus.value.expectedWaitMinutes です。
|
いいえ | |
allowTransferIf |
満たす必要がある条件の基本セットを指定します。
指定した条件が一致しない場合、 |
いいえ | |
customProperties |
サービスに渡す情報を保持するマップ。サービスへの情報の受渡しを参照してください。このプロパティはバージョン21.04以降でサポートされています。 | いいえ | |
errorMessage |
デジタル・アシスタントがエージェント・チャット・サービスで問題が発生したときにユーザーに表示されるメッセージ。デフォルトはWe were unable to check the agent transfer conditions because there was a system error. です。このデフォルトの文字列は、構成リソース・バンドルのsystemComponent_AgentTransferCondition_errorMessageキーの下に格納されます。このプロパティを空白または空の文字列に設定して、メッセージ出力を抑制できます。
|
いいえ | |
maxEngagementsInQueue |
宛先キューで待機するエンゲージメントの最大許容数。リクエストが送信されると、チャット・サービスは、キュー内で待機している現在のエンゲージメント数を使用して応答します。この値がmaxEngagementsInQueue を超えると、conditionsNotMet アクションが発生します。デフォルトは-1 で、エンゲージメントの制限がないことを意味します。
|
いいえ | |
maxWaitSeconds |
許容される予測待機秒数の最大値。チャット・サービスは、リクエストを受け取ると、予測待機時間を使用して応答します。この値がmaxWaitSeconds を超えると、conditionsNotMet アクションが発生します。このプロパティのデフォルトは-1 であり、これは最大待機時間がないことを意味します。
|
いいえ |
このコンポーネントは、次のアクションを返すことができます:
アクション | 説明 |
---|---|
conditionsMet |
conditionsMet 遷移は、営業時間内であり、maxWaitSeconds 、maxEngagementsInQueue およびallowTransferIf 条件が満たされた場合に設定されます。
|
conditionsNotMet |
conditionsNotMet 遷移は、次のいずれかが発生したときに設定されます:
|
error |
error 遷移は、エージェント条件チェック中にエージェント・チャット・サービスへの接続に問題がある場合に設定されます。
|
例: エージェントの可用性および待機時間の取得
コンポーネントを起動し、待機時間を表示し、ユーザーに転送リクエストを取り消す機会を与えるダイアログ・フローの例を次に示します。
############################
# Agent Transfer
############################
# See if there are any agents available
evaluateAgentTransferCondition:
component: "System.AgentTransferCondition"
properties:
maxWaitSeconds: 300
maxEngagementsInQueue: 20
allowTransferIf: "agentsAreAvailable"
agentStatusVariable: "agentStatus"
transitions:
actions:
conditionsMet: "askIfWillWait"
conditionsNotMet: "setInsightsCustomMetricsConditionsNotMet"
error: "handleTransferError"
next: "done"
# Measure when agents aren't available
setInsightsCustomMetricsConditionsNotMet:
component: "System.SetCustomMetrics"
properties:
dimensions:
- name: "Agent Transfer Choice"
value: "No agents available for new chats"
transitions:
next: "handleRejected"
askIfWillWait:
component: "System.CommonResponse"
properties:
processUserMessage: true
metadata:
responseItems:
- type: "text"
text: "${rb('promptTextForTransferDecision','minutes,seconds',agentStatus.value.expectedWaitMinutes,agentStatus.value.expectedWaitSeconds)}"
separateBubbles: true
actions:
- label: "Yes, I'll wait"
type: "postback"
keyword: "yes"
payload:
action: "yes"
name: "Yes"
- label: "No, nevermind"
keyword: "no"
type: "postback"
payload:
action: "no"
name: "No"
transitions:
actions:
yes: "setInsightsCustomMetricsAgentTransferInitiated"
no: "setInsightsCustomMetricsAgentTransferCancelled"
textReceived: "intent"
next: "handleCancelled"
# Measure when user chooses to wait for transfer
setInsightsCustomMetricsAgentTransferInitiated:
component: "System.SetCustomMetrics"
properties:
dimensions:
- name: "Agent Transfer Choice"
value: "User chose to wait"
transitions:
next: "transferToAgent"
# Measure when user chooses to not wait for transfer
setInsightsCustomMetricsAgentTransferCancelled:
component: "System.SetCustomMetrics"
properties:
dimensions:
- name: "Agent Transfer Choice"
value: "User didn't want to wait"
transitions:
next: "handleCancelled"
# Perform the actual transfer
#
# The maxWaitSeconds, maxEngagementsInQueue, allowTransferIf,
# and customProperties, if any, should match those used for
# System.AgentTransferCondition
transferToAgent:
component: "System.AgentTransfer"
properties:
maxWaitSeconds: 300
maxEngagementsInQueue: 20
allowTransferIf: "agentsAreAvailable"
transitions:
actions:
accepted: "done"
rejected: "handleRejected"
error: "handleTransferError"
next: "handleTransferError"
############################
# All done
############################
done:
component: "System.Output"
properties:
text: "Let me know if you need help on anything else."
transitions:
return: "done"
handleRejected:
component: "System.CommonResponse"
properties:
keepTurn: true
metadata:
responseItems:
- type: "text"
text: >
Unfortunately, none of my colleagues are currently available to assist with this.
Still, we’d love to see this through for you.
Please feel free to reach us through email@example.com.
transitions:
next: "done"
handleCancelled:
component: "System.CommonResponse"
properties:
keepTurn: true
metadata:
responseItems:
- type: "text"
text: "OK. Maybe some other time. Please feel free to reach us through email@example.com."
transitions:
next: "done"
handleTransferError:
component: "System.CommonResponse"
properties:
keepTurn: true
metadata:
responseItems:
- type: "text"
text: "Unfortunately, we can't transfer you at this time. Please try again later."
transitions:
next: "done"
############################
# Global error handler
############################
globalErrorHandler:
component: "System.Output"
properties:
text: "Sorry, we were unable to do the action that you requested."
transitions:
next: "done"
askIfWillWait
状態では、リソース・バンドル・エントリを使用して待機時間メッセージを形成し、時間が1分以上か1分未満か、および数が0か1以上かがわかるようにします。
There are some experts online. But it might take {minutes, plural,
=-1 {}
=0 {}
=1 {1 minute and }
other {# minutes and }
}{seconds, plural,
=-1 {a while}
=0 {{minutes, plural,
=0 {a very short wait time}
other {0 seconds}
}}
=1 {1 second}
other {# seconds}
} for one to join. Are you willing to wait?
この例では、System.SetCustomMetricsを使用して、エージェントが使用可能かどうか、および使用可能である場合は待機することを選択したユーザー数と、転送リクエストを取り消した数を追跡します。
ライブ・エージェント転送コンポーネント
System.AgentInitiation
スキルの会話をOracle B2C Serviceエージェントに転送する場合は、このコンポーネントをダイアログ・フローに追加し、agentChannel
プロパティで指定されたエージェント統合チャネルとのハンドシェイクを開始します。System.AgentConversation
コンポーネントをコールする前に、このコンポーネントをコールする必要があります。
このコンポーネントは、スキルで発生した会話用です。デジタル・アシスタント(エージェント)のフレームワークの動作で説明されているように、このコンポーネントをOracle B2C Serviceチャットで発生した会話に使用しないでください。
このコンポーネントを使用して、ServiceCloudIntegration
というエージェント統合チャネルによって定義されるOracle B2C Serviceインスタンスとのハンドシェイクを開始する例を次に示します。
agentInitiation:
component: "System.AgentInitiation"
properties:
agentChannel: "ServiceCloudIntegration"
nlpResultVariable: "iResult"
waitingMessage: "Waiting for an agent..."
rejectedMessage: "Agents are not available right now."
resumedMessage: "We're connecting you to an agent..."
errorMessage: "Oops! We're having system issues. We're sorry, but we can't connect you with an agent right now."
transitions:
actions:
accepted: "agentConversation"
rejected: "tryAgain"
error: "tryAgain"
agentConversation:
component: "System.AgentConversation"
properties:
agentChannel: "ServiceCloudIntegration"
nlpResultVariable: "iResult"
exitKeywords: "bye, exit, take care, goodbye, quit"
expiryMessage: "Your chat with the agent timed out."
conclusionMessage: "Your chat with the agent has ended."
waitMessage: "You are number ${system.message.messagePayload.position} in the queue. Your waiting time is ${(system.message.messagePayload.waitTime>60)?then('${(system.message.messagePayload.waitTime/60)?int} mins','${system.message.messagePayload.waitTime} seconds')}."
transitions:
next: "endPrompt"
actions:
agentLeft: "endPrompt"
expired: "sessionExpired"
error" "agentConversationError"
ヒント:
プラットフォーム・バージョンが21.04以降のスキルでは、agentActionsMessage
、errorMessage
、rejectedMessage
、resumedMessage
およびwaitingMessage
プロパティのデフォルト値はスキルのリソース・バンドルに格納されます。デフォルトを変更するには、スキルの「リソース・バンドル」ページを開き、
プロパティ | 説明 | 必須? | |
---|---|---|---|
agentActions |
チャットを終了してフローを遷移アクションに定義された状態に移動させるために、エージェントがトリガーできるアクションのリスト。顧客サービス担当のコンソールでは、次の例に示すように、エージェントの会話が開始されるときにスラッシュ・コマンドとしてこれらのアクションが表示されます:
アクション名は、
|
いいえ | |
agentActionsMessage |
agentActions プロパティが設定されている場合、エージェント・コンソールには、デフォルト・メッセージのかわりにこの値が表示されます。例:
|
いいえ | |
agentChannel |
エージェント統合チャネルを指定します。この値(エージェント統合チャネルの名前)とSystem.AgentConversation コンポーネントに定義されたagentChannel プロパティは、すべて一致する必要があります。
|
はい | |
allowTransferIf |
スキルがチャット・セッションを転送する条件を指定します。このコンポーネントは、queueId 値を使用して、統計を取得するキューを識別します。会話がチャット・ルールによって他のキューではなく特定のキューに実際に転送されることを確認する必要があります。
指定された条件が満たされない場合、コンポーネントは このプロパティを含める場合は、 このプロパティは、Oracle Cloud Infrastructure (Generation 2クラウド・インフラストラクチャとも呼ばれる)にプロビジョニングされたOracle Digital Assistantのインスタンスでのみ使用できます。 |
いいえ | |
chatResponseVariable |
エージェントのレスポンス情報を保持するマップ変数を指定します。System.AgentInitiation コンポーネントが正常に接続されると、マップには次のプロパティが含まれます:
|
いいえ | |
customProperties |
サービスに渡す、インシデントID、インタフェース、連絡先またはカスタム・フィールド(またはそれらの組合せ)を保持するマップ。マップ変数を参照するには、${mapVariableName.value} のような値式を使用します。ライブ・チャットへの顧客情報の受渡しを参照してください。
|
いいえ | |
errorMessage |
Oracle B2C Serviceとの接続の確立中に問題が発生した場合に表示するメッセージ。たとえば、エージェント統合チャネルのパスワードが有効でなくなった場合や、サーバーに問題がある場合などです。 | いいえ | |
nlpResultVariable |
顧客の問合せメッセージを格納する変数。 | いいえ | |
rejectedMessage |
AgentInitiation ハンドシェイクが拒否された場合(構成済の営業時間外の場合など)に表示されるメッセージ。例:
|
いいえ | |
resumedMessage |
顧客と顧客サービス担当とのチャットが再開されるときに表示されるメッセージ(「少々お待ちください。エージェントにおつなぎしています。」など)。このプロパティを追加すると、すでにリクエストがキューに登録されている顧客は、ライブ・チャットを繰り返しリクエストしたときに、誤解を招く「エージェントとのチャットを再開しています」メッセージを受け取りません。 | いいえ | |
subject |
エージェント・プラットフォームへのハンドオフ後にエージェントのコンソールに表示される件名。デフォルトでは、これはnlpResultVariable プロパティに格納されている最後の顧客メッセージですが、ダイアログ・フロー定義で以前に設定した変数を使用して定義することもできます。たとえば、System.AgentInitiation コンポーネントより前に値が設定されるstring 型のコンテキスト変数を定義できます:
|
いいえ | |
queueId |
指定したallowTransferIf 条件が満たされるかどうかを判断するためにコンポーネントが使用する必要があるキューのID。これは、Oracle B2C Serviceチャット・ルールが会話をルーティングする先のキューのIDである必要があります。
|
allowTransferIf プロパティが存在する場合は必須です。
|
|
transcriptDateTimeFormat |
エージェントに転送される会話トランスクリプト・メッセージの日付と時刻の書式。有効なパターンは、DateTimeFormatter Javaクラスを参照してください。例: dd/MM/yyyy HH:mm 。デフォルトはyyyy-mmm-ddThh:mm:ssZ です。
|
いいえ | |
transcriptTimezoneName |
transcriptDateTimeFormat プロパティを使用して会話トランスクリプトを書式設定するために使用するタイムゾーンのInternet Assigned Numbers Authority (IANA)名。例: America/Sao_Paulo 。デフォルトはEurope/London です。transcriptDateTimeFormat プロパティを含めない場合、このプロパティは無視されます。
|
いいえ | |
waitingMessage |
顧客がエージェントへの接続を待機している間に表示されるメッセージ。例:
|
いいえ |
System.AgentInitiation遷移
System.AgentInitiation
コンポーネントは、accepted
、rejected
およびerror
アクションを返します。これらのアクションはそれぞれ異なる状態を示すことができ、通常、accepted
アクションはSystem.AgentConversation
コンポーネントの状態を指定します: agentInitiation:
component: "System.AgentInitiation"
properties:
agentChannel: "ServiceCloudIntegration"
...
transitions:
actions:
accepted: "agentConversation"
rejected: "noAgentsAvailable"
error: "handshakeError"
アクション | 説明 |
---|---|
accepted |
ハンドシェイクが正常に完了し、状態はSystem.AgentConversation コンポーネントでの状態に遷移できます。
|
error |
Oracle B2C Serviceとの接続の確立中に問題が発生しました。たとえば、エージェント統合チャネルのパスワードが有効でなくなった場合や、サービス・クラウド・サーバーに問題がある場合などです。 |
rejected |
Oracle B2C Serviceにより、接続リクエストが拒否されました。接続リクエストが拒否される理由として、次のようなものがあります:
|
例: エージェント開始拒否とシステム・エラーの処理
システム・エラーとerror
およびrejected
アクションの処理の例を次に示します。
agentInitiation:
component: "System.AgentInitiation"
properties:
agentChannel: "B2CServiceIntegration"
nlpResultVariable: "iResult"
waitingMessage: "Let me connect you with someone who can further assist you."
resumedMessage: "Someone will be with you shortly."
errorMessage: "Oops! We're having system issues and we can't connect you with an agent right now."
rejectedMessage: "Unfortunately, no one's available right now."
transitions:
actions:
accepted: "agentConversation"
rejected: "initiationRejected"
error: "tryAgain"
error: "agentInitiationSystemError"
initiationRejected:
component: "System.Output"
properties:
text: "Perhaps it's outside their working hours or it's a holiday."
transitions:
return: "initiationRejected"
tryAgain:
component: "System.Output"
properties:
text: "Please try again later."
transitions:
return: "tryAgain"
agentInitiationSystemError:
component: "System.Output"
properties:
text: "I seem to be having a connection problem. Can you please email email@example.com to let them know?"
transitions:
return: "done"
例: incidentIDプロパティ
context:
variables:
liveChatInfo: "map"
customerTicketId: "int"
...
setCustomFields:
component: "System.SetVariable"
properties:
variable: "liveChatInfo"
value:
incidentID: "${customerTicketId}" # long value
...
agentInitiation:
component: "System.AgentInitiation"
properties:
...
customProperties: "${liveChatInfo.value}"
例: 標準customerInformationオブジェクト
この例では、contactID
を設定します。
context:
variables:
liveChatInfo: "map"
contactId: "int"
...
setCustomFields:
component: "System.SetVariable"
properties:
variable: "liveChatInfo"
value:
customerInformation:
contactID:
id: "${customerId}"
...
agentInitiation:
component: "System.AgentInitiation"
properties:
...
customProperties: "${liveChatInfo.value}"
例: レガシーcustomerInformationオブジェクト
次の例では、interfaceID
とcontactID
を設定します。
ヒント:
WSDLでinterfaceID
はNamedID
型であると指定されているため、id: id: "${interfaceId}"
ではなくname: "myInterfaceName"
を使用することもできます。
context:
variables:
liveChatInfo: "map"
interfaceId: "int"
contactId: "int"
...
setCustomFields:
component: "System.SetVariable"
properties:
variable: "liveChatInfo"
value:
customerInformation:
interfaceID:
id:
id: "${interfaceId}"
contactID:
id: "${customerId}"
...
agentInitiation:
component: "System.AgentInitiation"
properties:
...
customProperties: "${liveChatInfo.value}"
例: 標準的なcustomFieldsオブジェクト
context:
variables:
liveChatInfo: "map"
...
setupCustomFields:
component: "System.SetVariable"
properties:
variable: "liveChatInfo"
value:
customFields:
- name: "c$text_field" # text field
type: "STRING"
value: "SILVER"
- name: "c$text_area" # text area
type: "STRING"
value: "My package arrived but there were no contents in the box. Just bubble wrap."
- name: "c$integer" # integer
type: "INTEGER"
value: 21
- name: "c$yes_no" # yes/no (1=yes and 0=no)
type: "BOOLEAN"
value: 1
- name: "c$date_field" # date (yyyy-MM-dd'T'00:00:00. Use 0 for time)
type: "DATE"
value: "2020-02-04T00:00:00+00:00"
- name: "c$date_time" # datetime (yyyy-MM-dd'T'HH:mm:ssXXX)
type: "DATETIME"
value: "2020-02-04T21:24:18+00:00"
- name: "c$menu" # menu (no type property, you can pass the string or the ID for the value property)
value: "12"
transitions:
...
...
agentInitiation:
component: "System.AgentInitiation"
properties:
...
customProperties: "${liveChatInfo.value}"
例: レガシーcustomFieldsオブジェクト
context:
variables:
liveChatInfo: "map"
skillType: "string"
...
setupCustomFields:
component: "System.SetVariable"
properties:
variable: "liveChatInfo"
value:
customerInformation:
interfaceID:
id:
id: 1
customFields:
# Text Field
- name: "c$da_text_field"
dataType: "STRING"
dataValue:
stringValue: "SILVER"
# Text Area
- name: "c$da_text_area"
dataType: "STRING"
dataValue:
stringValue: "This is a very long string that is more than 32 characters."
# Integer
- name: "c$da_integer"
dataType: "INTEGER"
dataValue:
integerValue: 21
# Menu
- name: "c$da_menu"
dataType: "NAMED_ID"
dataValue:
namedIDValue:
name: "Item 1"
# Instead of name, you can use
# id:
# id: 1
#
# Yes/No
- name: "c$da_is_from_skill"
dataType: "BOOLEAN"
dataValue:
booleanValue: true
# Date (XML Schema Date)
- name: "c$da_date"
dataType: "DATE"
dataValue:
dateValue: "2019-10-26"
# DateTime (XML Schema DateTime)
- name: "c$da_datetime"
dataType: "DATETIME"
dataValue:
dateTimeValue: "2019-10-26T21:32:52"
transitions:
...
...
agentInitiation:
component: "System.AgentInitiation"
properties:
...
customProperties: "${liveChatInfo.value}"
例: カスタム・プロパティ・オブジェクトのアセンブル
これらのステップでは、customProperties
オブジェクトを宣言し、その様々な値を設定する方法について説明します。
ステップ1: カスタム・プロパティ変数の宣言
System.AgentInitiation
コンポーネントのcustomProperties
プロパティにマップ変数を定義します。これは、チャット顧客情報およびカスタム・フィールド値を保持できるJSONオブジェクトです。次の例では、この変数をliveChatInfo
と宣言しています:context:
variables:
size: "PizzaSize"
type: "PizzaType"
crust: "PizzaCrust"
iResult: "nlpresult"
interfaceId: "string"
categoryId: "string"
skillType: "string"
liveChatInfo: "map"
ステップ2: customPropertiesマップ変数の値の設定
System.AgentInitiation
コンポーネントのcustomProperties
プロパティにマップ変数を定義します。これは、チャット顧客情報およびカスタム・フィールド値を保持できるJSONオブジェクトです。次の例では、この変数をliveChatInfo
と宣言しています:context:
variables:
size: "PizzaSize"
type: "PizzaType"
crust: "PizzaCrust"
iResult: "nlpresult"
interfaceId: "string"
categoryId: "string"
skillType: "string"
liveChatInfo: "map"
ステップ3: customPropertiesマップ変数のフィールドの定義
setLiveChatInfo:
component: "System.SetVariable"
properties:
variable: "liveChatInfo"
value:
customerInformation:
categoryID:
id: "${categoryId}"
customFields:
- name: "c$skilltype"
type: "STRING"
value: "${skillType}"
transitions:
next: "agentInitiation"
ステップ4: System.AgentInitiationコンポーネントへのcustomPropertiesの追加
customProperties
プロパティをSystem.AgentInitiation
コンポーネントに追加し、マップ変数値にアクセスする式を使用してこれを定義します。 agentInitiation:
component: "System.AgentInitiation"
properties:
subject: "A customer needs help regarding ${skillType}."
agentChannel: "ServiceCloudIntegration"
waitingMessage: "Let me connect you with someone who can further assist you."
resumedMessage: "Please wait, someone will be with you shortly."
rejectedMessage: "Sorry no one is available now."
errorMessage: "We're sorry! We're having system issues and we can't connect you with an agent."
customProperties: "${liveChatInfo.value}"
transitions:
actions:
accepted: "agentConversation"
rejected: "initiationRejected"
error: "tryAgain"
initiationRejected:
component: "System.Output"
properties:
text: "Perhaps it's outside their working hours or it's a holiday."
transitions:
return: "tryAgain"
tryAgain:
component: "System.Output"
properties:
text: "Please try again later."
transitions:
return: "tryAgain"
System.AgentConversation
このコンポーネントを使用して、スキルの会話をOracle B2C Serviceライブ・エージェントに転送し、スキルとライブ・エージェントのやり取りを管理します。このコンポーネントを使用する前に、System.AgentInitiation
コンポーネントをコールする必要があることに注意してください。
System.AgentConversation
は、スキルで発生した会話用です。デジタル・アシスタント(エージェント)のフレームワークの動作で説明されているように、このコンポーネントをOracle B2C Serviceチャットで発生した会話に使用しないでください。
次に、このコンポーネントを使用して、ServiceCloudIntegration
というエージェント統合チャネルによって定義されるOracle B2C Serviceインスタンスに会話を転送する例を示します。
agentConversation:
component: "System.AgentConversation"
properties:
agentChannel: "ServiceCloudIntegration"
nlpResultVariable: "iResult"
errorMessage: "Oops, we lost connection with the agent. If you need further help, please call customer support."
exitKeywords: "bye, exit, take care, goodbye, quit"
expiryMessage: "Your chat with the agent timed out"
waitExpiryMessage: "The chat expired while waiting for an agent"
conclusionMessage: "Your chat with the agent has ended."
waitMessage: "You are number ${system.message.messagePayload.position} in the queue. Your waiting time is ${(system.message.messagePayload.waitTime>60)?then('${(system.message.messagePayload.waitTime/60)?int} mins','${system.message.messagePayload.waitTime} seconds')}."
transitions:
next: "endPrompt"
actions:
agentLeft: "endPrompt"
expired: "sessionExpired"
waitExpired: "expiredWhileWaiting"
error: "handleConnectionError"
プロパティ | 説明 | 必須? |
---|---|---|
agentChannel |
エージェント統合チャネルを指定します。この値(エージェント統合チャネルの名前)とSystem.AgentInitiation コンポーネントに定義されたagentChannel プロパティは、すべて一致する必要があります。
|
はい |
conclusionMessage |
ユーザーがexitキーワードを入力した場合、agentLeft アクションがトリガーされた場合、またはエージェントがagentActions のいずれかを送信せずに会話を終了した場合に、顧客に送信される自動メッセージ。たとえば、「エージェントとのチャットは終了しました」 です。
|
いいえ |
errorMessage |
Oracle B2C Serviceへの接続に問題がある場合にチャットに表示されるメッセージ。
デフォルト・メッセージは このプロパティは、Oracle Cloud Infrastructure (Generation 2クラウド・インフラストラクチャとも呼ばれる)にプロビジョニングされたOracle Digital Assistantのインスタンスでのみ動作します。 |
いいえ |
exitKeywords |
ライブ・エージェントとの会話を終了するために顧客が使用する一般的な終了語のカンマ区切りリスト。例:
このプロパティ値のデフォルトは |
いいえ |
expiryMessage |
expired アクションがトリガーされたときに表示されるメッセージ。デフォルト・メッセージは、「チャット・セッションの有効期限が切れました。ありがとうございました」 です。
サービス・クラウドの |
いいえ |
nlpResultVariable |
顧客の問合せメッセージを保持するnlpResultVariable 変数。
|
いいえ |
waitExpiryMessage |
エージェントの待機中にチャットが期限切れになったときにユーザーに表示されるメッセージ。デフォルトのメッセージはThe request for live chat expired while waiting for an agent. です |
いいえ |
waitMessage |
デフォルトでは、会話の転送が開始された後、ライブ・チャット・サービスがスキルに送信する待機メッセージ(キューの位置や待機時間など)がスキルに表示されます。このプロパティを使用してメッセージをカスタマイズします。例:
|
いいえ |
System.AgentConversation遷移
System.AgentConversation
は、expired
、agentLeft
、error
またはwaitExpired
アクションをトリガーできます。また、System.AgentInitiation
コンポーネントのagentActions
プロパティからアクションをトリガーできます。これらのアクションがトリガーされる前に、顧客がexitKeywords
のいずれかを入力してチャットを終了する場合があるため、next
遷移も追加する必要があります。
agentConversation:
component: "System.AgentConversation"
properties:
agentChannel: "ServiceCloudIntegration"
nlpResultVariable: "iResult"
exitKeywords: "bye, adios, take care, goodbye"
...
transitions:
next: "endPrompt"
actions:
agentLeft: "endPrompt"
expired: "endPrompt"
waitExpired: "endPrompt"
error: "agentConversationError"
...
endPrompt:
component: "System.List"
properties:
prompt: "Your session has ended. What would you like to do?"
options:
- label: "Order a Pizza"
value: "OrderPizza"
- label: "Nothing. I'm done here."
value: "Finished"
autoNumberPostbackActions: true
transitions:
actions:
OrderPizza: "resolvePizzaSize"
Finished: "done"
...
アクション | 説明 |
---|---|
agentActions |
System.AgentInitiation コンポーネントにagentActions プロパティがある場合、このコンポーネントには、agentActions で指定されたサポート対象のすべてのアクションに対する遷移アクションが必要です。
|
agentLeft |
エージェントがスラッシュ・アクション(たとえば、/Order)を使用せずにセッションを終了しました。または、Oracle B2C ServiceのCS_IDLE_TIMEOUT 構成で指定された時間内にアクティビティが発生せず、その構成がエージェント統合チャネルの「セッション失効」設定より短いため、セッションが終了しました。詳細は、expired アクションを参照してください。
ユーザーがキーワードを入力して会話から離れた場合、このアクションは返されないことに注意してください。その場合、フローは |
error |
ライブ・エージェント・サービスへの接続中に問題が発生しました。 このアクションは、Oracle Cloud Infrastructure (Generation 2クラウド・インフラストラクチャとも呼ばれる)にプロビジョニングされたOracle Digital Assistantのインスタンスでのみ動作します。 |
expired |
Oracle B2C Serviceの デフォルトでは、 サービス・クラウドの Oracle B2C Serviceインスタンスの設定を表示または変更するには、デスクトップ・コンソールを開いて、「ナビゲーション」、メニューの最初の「構成」項目、「構成設定」の順にクリックします。次に、「チャット」フォルダで設定を検索します。 |
waitExpired |
エージェントの待機中にチャット・リクエストの期限が切れました。これは、待機時間がチャット・クライアントのUSER_WAIT_QUEUE_TIMEOUT 設定の値を超えた場合に発生します。
|
例: エージェント転送ダイアログ・フローの構成
次の例では、GetAgent
インテントは、助けてくださいのような助けを求める発言を理解するようにトレーニングされています。
intent:
component: "System.Intent"
properties:
variable: "iResult"
transitions:
actions:
OrderPizza: "resolvesize"
CancelPizza: "cancelorder"
GetAgent: "agentInitiation"
unresolvedIntent: "agentInitiation"
次に、ダイアログ・フローを構成するための基本ステップを示します:
-
ライブ・エージェント転送を開始します。
-
System.AgentInitiation
コンポーネントの状態を追加します。 -
状態の
agentChannel
プロパティを、ライブ・エージェント・システム用に構成したエージェント統合チャネルの名前に設定します。
エージェント統合チャネルが接続を確立し、Oracle B2C Serviceがチャット・リクエストをそのキューに送信した後(つまり、ヘルプ・チケットを作成した後)、System.AgentInitiation
コンポーネントによって次の状態への遷移が可能になります。これは通常、System.AgentConversation
コンポーネントに定義されます(次の例ではagentConversation
)。agentInitiation: component: "System.AgentInitiation" properties: agentChannel: "ServiceCloudIntegration" nlpResultVariable: "iResult" waitingMessage: "Waiting for an agent..." rejectedMessage: "Agents are not available right now." resumedMessage: "We're connecting you to an agent..." errorMessage: "Oops! We're having system issues. We're sorry, but we can't connect you with an agent right now." transitions: actions: accepted: "agentConversation" rejected: "tryAgain" error: "tryAgain" tryAgain: component: "System.Output" properties: text: "Please try again later." transitions: return: "tryAgain"
ヒント:
顧客のリクエストがエージェントのチャット・コンソールのキューにすでに入っていても、顧客はライブ・チャットを繰り返し要求できます。System.AgentInitiation
状態にresumedMessage
プロパティを追加して、このような顧客が誤解を招く「エージェントとのチャットを再開しています」メッセージを受信しないようにします。 -
-
System.AgentConversation
コンポーネントを追加して構成します。ダイアログ・エンジンがこのコンポーネントに定義された状態になっている間、スキルは顧客とエージェントの間でメッセージを受け渡します。スキルは、顧客入力の終了キーワード(bye
など)をリスニングします。スキルがこれらのキーワードのいずれかを検出すると、System.AgentConversation
コンポーネントはライブ・チャット・セッションを終了し、そのnext
遷移をトリガーします。次の例は、次のとおりです:
agentConversation: component: "System.AgentConversation" properties: agentChannel: "ServiceCloudIntegration" nlpResultVariable: "iResult" errorMessage: "Oops, we lost connection with the agent. If you need further help, please call customer support." exitKeywords: "bye, exit, take care, goodbye, quit" expiryMessage: "Your chat with the agent timed out." conclusionMessage: "Your chat with the agent has ended." waitMessage: "You are number ${system.message.messagePayload.position} in the queue. Your waiting time is ${(system.message.messagePayload.waitTime>60)?then('${(system.message.messagePayload.waitTime/60)?int} mins','${system.message.messagePayload.waitTime} seconds')}." transitions: next: "endPrompt" actions: agentLeft: "endPrompt" expired: "endPrompt" error: "endPrompt" endPrompt: component: "System.Output" properties: text: "Returning you to your bot." transitions: return: "endPrompt"
例: サーベイ情報の取得
標準フォーマットを使用する次の例では、エージェントの会話が終了すると、AgentConversation
コンポーネントがサーベイ・リンクを出力します。リンクには、chatResponseVariable
プロパティによって指定されたマップからのセッションおよびエンゲージメントIDが含まれます。
context:
variables:
agentSystemResponse: "map" # chat request response is stored in this variable.
...
states:
...
agentInitiation:
component: "System.AgentInitiation"
properties:
agentChannel: "B2CServiceIntegration"
nlpResultVariable: "iResult"
chatResponseVariable: "agentSystemResponse"
transitions:
actions:
accepted: "agentConversation"
rejected: "tryAgain"
error: "tryAgain"
agentConversation:
component: "System.AgentConversation"
properties:
agentChannel: "B2CServiceIntegration"
nlpResultVariable: "iResult"
exitKeywords: "bye, exit, take care, goodbye, quit"
expiryMessage: "Your chat with the agent timed out."
conclusionMessage: "Can you please fill out this survey: <PUT SURVEY URL HERE>?session=${agentSystemResponse.value.sessionId}&surveyid=${agentSystemResponse.value.engagementId}"
transitions:
next: "endPrompt"
actions:
agentLeft: "endPrompt"
expired: "sessionExpired"
error: "agentConversationError"
例: 特定のOracle B2C Serviceキューへのチャットの転送
-
まだ定義していない場合は、コンテキスト・ノードで、
System.AgentInitiation
コンポーネントのcustomProperties
プロパティで使用するマップ変数を定義します。例:context: variables: greeting: "string" name: "string" liveChatInfo: "map"
-
マップ変数のフィールドを定義します。
次に、バージョン20.01以上で作成され、Oracle B2C Serviceバージョン19A以上に接続するエージェント統合チャネルの標準フォーマットの例を示します。
setLiveChatInfo: component: "System.SetVariable" properties: variable: "liveChatInfo" value: customFields: - name: "c$frombot" type: "BOOLEAN" value: 1 transitions: next: "agentInitiation"
次に、バージョン20.01より前に作成されたか、Oracle B2C Serviceバージョン19Aより前のバージョンに接続するエージェント統合チャネルのレガシー・フォーマットの例を示します。
setLiveChatInfo: component: "System.SetVariable" properties: variable: "liveChatInfo" value: customFields: - name: "c$frombot" dataType: "BOOLEAN" dataValue: booleanValue: true transitions: next: "agentInitiation"
-
customProperties
プロパティをSystem.AgentInitiation
コンポーネントに追加し、これをマップ変数の値に設定します。例:agentInitiation: component: "System.AgentInitiation" properties: agentChannel: "B2CServiceIntegration" nlpResultVariable: "iResult" customProperties: "${liveChatInfo.value}" waitingMessage: "Waiting for an agent..." rejectedMessage: "Agents are not available right now." resumedMessage: "We're connecting you to an agent..." errorMessage: "Oops! We're having system issues. We're sorry, but we can't connect you with an agent right now." transitions: actions: accepted: "agentConversation" rejected: "tryAgain" error: "tryAgain" tryAgain: component: "System.Output" properties: text: "Please try again later." transitions: return: "tryAgain"
System.ResolveEntities
コンポジット・バッグ内のすべてのエンティティ・フィールドを反復し、ユーザーと会話してすべてのフィールドを解決します。コンポーネントは、各エンティティに対して指定されるプロンプトをランダムに選択しながら、そのエンティティを解決します。
プロパティ | 説明 | 必須 | |
---|---|---|---|
variable |
このコンポーネントによって移入されるコンポジット・バッグ・エンティティ・コンテキスト変数を参照します。コンポジット・エンティティ変数のすべての子エンティティにすでに値がある場合、ダイアログ・フローはユーザーにメッセージを送信せずに次の状態に遷移します。 | はい | |
nlpResultVariable |
nlpresult コンテキスト変数に格納された値を使用して、(コンポジット・バッグ・エンティティ変数を参照する) variable プロパティに移入します。このプロパティは、nlpresult 変数(通常はiResult )を指定することで定義できます。フレームワークによって単一の子エンティティが解決されると、そのエンティティ値のみがvariable プロパティに移入されます。nlpresult 変数がすべての子エンティティの値を保持すると、ダイアログ・フローは次の状態に遷移します。このプロパティは、子エンティティ値に移入するSetVariable 状態のかわりに使用できます。
|
いいえ | |
maxPrompts |
子エンティティ・タイプに一致する有効な値を入力するためにユーザーに割り当てられる試行回数を指定します。最初の子エンティティについて最大試行回数を超えた場合、このプロパティは0にリセットされ、ボットは次の子エンティティを要求するプロンプトを出力します。コンポジット・バッグ・エンティティの作成で説明されているように、「最大ユーザー入力試行回数」オプションが設定されている場合は、コンポジット・バッグ内の個々のエンティティはこの設定をオーバーライドできます。 | いいえ | |
autoNumberPostbackActions |
true に設定すると、このオプションによって、オプションの先頭に番号が付けられます。このオプションをtrue に設定していない場合でも、デジタル・アシスタントの「ポストバック・アクションでの自動採番の有効化」構成がtrue に設定されている場合は、リスト・アイテムに自動採番を適用できます。チャネル固有の自動採番は、デジタル・アシスタントに登録されているどのスキル・ボットにも適用できます:
|
いいえ | |
useFullEntityMatches |
true に設定すると、カスタム・エンティティ値がJSONオブジェクトとして格納されます(組込みエンティティ値のようになります)。これで、value 、primaryLanguageValue 、originalString などのプロパティにアクセスするための式を作成できます。これは、現在複数言語である(またはいずれ複数言語になる可能性がある)スキルにとって特に重要です。
|
||
footerText |
テキストのみのチャネルでの出力を拡張します。フッターで説明されているように、FreeMarker式を使用して、テキストのみのチャネルのフッター・テキストに条件を設定できます。 | いいえ | |
headerText |
コンポーネントがユーザーにバッグ内の次のアイテムを要求する前に表示されるメッセージ。このヘッダーを使用して、バッグ内の一致した(または更新された)前のエンティティに関するフィードバックを提供できます。
|
いいえ | |
transitionAfterMatch |
true に設定した場合に、このコンポーネントによって実行されたエンティティ一致からカスタム・コンポーネントへの一時的な遷移を可能にするブール。デフォルトでは、これはfalse です。エンティティ・イベント・ハンドラを登録している場合、このプロパティは無視されます(match 遷移はトリガーされません)。
|
いいえ | |
cancelPolicy |
cancel 遷移のタイミングを決定します:
maxPromptsReached ハンドラに登録している場合、このプロパティは無視されます。 |
いいえ |
カレンダ・コンポーネント
次のカレンダ・コンポーネントを使用して、OutlookやGoogleのカレンダとの相互作用を行います:
-
System.CreateCalendarEvent: イベントの作成
-
System.DeleteCalendarEvent: イベントの取消
-
System.GetCalendarEventDetails: イベントの詳細の取得
-
System.ListCalendarEvents: フィルタ処理されたイベント・セットのデータの取得
-
System.SelectCalendarEvent: フィルタ処理されたリストからのイベントの選択
-
System.SendInviteResponse: イベントのレスポンス・データの変更
-
System.UpdateCalendarEvent: イベントの変更
カレンダの認可
スキルとカレンダ・プロバイダ間の対話を有効にするには、サービスを設定し、スキルおよびダイアログ・フローを変更して、ユーザーがそのサービスを介してカレンダにサインインできるようにする必要があります。
カレンダ・コンポーネントを使用する前に、アプリケーションをカレンダ・プロバイダに登録し、認可コード・サービスを作成する必要があります。方法は、次の項目を参照してください:
ダイアログ・フローで、System.OAuth2AccountLink
コンポーネントを使用して、作成した認可コード・サービスを介してカレンダにサインインするようユーザーに求めます。このコンポーネントをカレンダ・コンポーネントの認可に使用する場合は、コンポーネントのenableSingleSignOn
プロパティをtrue
に設定できないことに注意してください。
「認可が必要」機能を利用すると、ユーザーがカレンダ・コンポーネントを起動する前に、サインインしていること(アクセス・トークンを取得していること)を自動的に確認できます。この機能によって、ユーザーがまだアクセス・トークンを持っていない場合、または期限が切れてリフレッシュできない場合のみ、ユーザーがサインインを求められます。スキルの「認可が必要」構成を使用してスキル全体のデフォルトを設定し、状態レベルのrequiresAuthorization
設定を使用してデフォルトをオーバーライドできます。つまり、スキルの設定を使用してデフォルトを設定し、デフォルトが適用されない状態にのみコンポーネントのrequiresAuthorization
設定を含めます。
「認可が必要」機能を使用するには、defaultTransitions
ノードにsystem.authorizeUser
アクションを追加して、認可フローを開始する状態を指定する必要があります。例:
defaultTransitions:
error: "globalErrorHandler"
actions:
system.authorizeUser: "userAuthN.performOAuth"
スキルは、認可が必要な状態に遷移する前に、カレンダ・サービスにとって有効なアクセス・トークンがあるかどうかを確認します。ない場合は、次の処理を実行します:
-
defaultTransitions
ノードのsystem.authorizedUser
アクションに定義した状態を起動します。 -
ユーザーにサインインを求めます。
-
認可が必要な状態(
${system.requestedState}
によって定義された状態)に遷移します。
認可ダイアログ・フローの例を次に示します:
defaultTransitions:
error: "globalErrorHandler"
actions:
system.authorizeUser: "userAuthN.performOAuth"
...
############################
# Authenticate
############################
userAuthN.performOAuth:
component: "System.OAuth2AccountLink"
properties:
prompt: "User Authentication"
variable: "code"
linkLabel: "Sign into ${system.config.calendarProvider}"
authenticationService: "${system.config.authService}"
accessTokenVariableName: "user.accessToken"
authenticatedUserVariableName: "user.authenticatedUser"
enableSingleSignOn: false # SSO not supported for calendar components
transitions:
actions:
pass : "${system.requestedState}"
fail : "handleFailedLogin"
textReceived: "intent"
handleFailedLogin:
component: "System.Output"
requiresAuthorization: false
properties:
text: "Sorry, you aren't authorized to do that"
transitions:
return: "doneHandleFailedLogin"
主にカレンダ・コンポーネントに特化したスキルでは、スキルの「認可が必要」構成をtrue
に設定し、認可が必要でない状態に対してのみ値をfalseに設定することを検討してください。この例では、どのユーザーもinitTimezoneOffset
状態およびintent
状態を実行できます。したがって、それらの状態では、requiresAuthorization
がfalse
に設定されます。カレンダ・コンポーネントで作動する状態には、requiresAuthorization
を含める必要はありません。デフォルトがtrue
であるためです。
initTimezoneOffset:
requiresAuthorization: false
component: "System.SetVariable"
properties:
variable: "timezoneOffset"
value: <#attempt>${profile.timezoneOffset}<#recover>0</#attempt>
transitions:
next: "intent"
intent:
component: "System.Intent"
requiresAuthorization: false
properties:
variable: "iResult"
transitions:
actions:
SetupMeeting: "setUpMeeting"
CancelMeeting: "cancelMeeting"
ListMeetings: "listMeetings"
UpdateMeeting: "updateMeeting"
ListInvites: "listInvites"
RespondInvites: "respondInvites"
LogoutUser: "logoutUser"
unresolvedIntent: "greeting"
...
cancelMeeting.performDelete:
component: "System.DeleteCalendarEvent"
properties:
eventId: "${eventId}"
provider: "${system.config.calendarProvider}"
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
next: "cancelMeeting.printSuccessMessage"
cancelMeeting.printSuccessMessage:
component: "System.Output"
properties:
text: "I've cancelled the meeting"
transitions:
return: "doneCancel"
カレンダの日付と時刻の操作
カレンダ・コンポーネントを使用するときは、カレンダの開始時間と終了時間、DATEとTIMEエンティティ、およびローカル・タイムゾーンの関係を理解することが重要です。
イベントを作成、更新または取得する場合は、start
とend
の値にローカル日時を使用し、timezoneOffset
またはtimezone
プロパティを使用して、協定世界時(UTC)の計算方法をコンポーネントに指示します。
カレンダ・コンポーネントのtimezoneOffset
はprofile.timezoneOffset
とは異なります。カレンダ・コンポーネントの場合、timezoneOffset
は、UTCを得るためにコンポーネントがstart
とend
の値に追加する必要がある値です。profile.timezoneOffset
に-1を掛けると、カレンダ・コンポーネントのtimezoneOffset
プロパティ値を導出できます。
profile.timezoneOffset
は常に使用できるとはかぎりません。クライアントがオフセットを指定したかどうかによって異なります。たとえば、profile.timezoneOffset
を設定せずにOracle Webアプリケーションが構築されることがあります。したがって、profile.timezoneOffset
が設定されない場合に備えて、デフォルトのタイムゾーンを作成することをお薦めします。例:
initTimezoneOffset:
requiresAuthorization: false
component: "System.SetVariable"
properties:
variable: "timezoneOffset"
value: <#attempt>${profile.timezoneOffset}<#recover>${system.config.defaultTimezoneOffset}</#attempt>
transitions:
next: "intent
イベントを取得すると、コンポーネントがUTCフォーマットで日時値を返します。例: 2021-04-15T22:00:00.000Z
。スキルによって値をローカル時間に変換する必要があります。
updateMeeting.printEventDetails:
component: "System.Output"
properties:
keepTurn: true
text: |
You selected:
${eventDetails.value.subject}
${(eventDetails.value.start?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['MMM d']}
${(eventDetails.value.start?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['hh:mm a']}-${(eventDetails.value.end?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['hh:mm a']}
Location: ${eventDetails.value.location}
Attendees: ${eventDetails.value.attendees?join(', ')}
transitions:
next: "updateMeeting.selectItemToChange"
DATEおよびTIMEエンティティを使用する場合、次のことを考慮する必要があります:
-
DATEエンティティと1つ以上のTIMEエンティティの両方を含むコンポジット・バッグを使用する場合は、「順不同の抽出」を無効にする必要があります。そうしないと、エンティティが解決されるときに、どの値がDATEエンティティに解決され、どの値がTIMEエンティティに解決されるか(あるいは両方)を制御できません。たとえば、TIMEが解決されるときに、DATEエンティティの値が変更される可能性があります。
-
発話に「昨日」、「今日」、「明日」のようなテキストが含まれているとき、パーサーはローカル・タイムゾーンを考慮しません。したがって、早朝や夕方に、間違った日付が使用される可能性があります。そのため、解決された日付をエコーバックすることをお薦めします。これにより、スキルによってイベントが追加されたり、イベントの開始時刻または終了時刻が更新される前にユーザーが解決された日付を確認できます。
-
カレンダの
start
およびend
プロパティ値を設定するには、DATEエンティティの日付とTIMEエンティティの時刻を使用する必要があります。例:start: "${newEvent.value.date.date?number_to_date?string['yyyy-MM-dd']}T${newEvent.value.startTime.date?number_to_date?string['HH:mm:ss']}" end: "${newEvent.value.date.date?number_to_date?string['yyyy-MM-dd']}T${newEvent.value.endTime.date?number_to_date?string['HH:mm:ss']}"
カレンダ・エラーの処理
カレンダ・プロバイダによってイベント・リクエストが拒否される場合があります。たとえば、終了時間が開始時間よりも前になるイベントをユーザーが作成しようとすると、エラーが返される場合があります。ほとんどの場合、カレンダ・プロバイダは400エラーを返し、これによってスキルがグローバル・エラー・ハンドラに遷移します。
このようなエラーが発生しないように、値を検証することを検討してください。コンポジット・バッグ・エンティティ検証の例を次に示します:
-
DATEエンティティ: 新規の会議や更新された会議について、日付が現在の日付以降であることを確認します。
${(meetingSlot.value.date.date?number?long gte ((.now?date?long - timezoneOffset?number?long)?number_to_date?string['yyyy-MM-dd']+'T00:00:00')?datetime.iso?long)?then('true','false')}
-
TIMEエンティティ: 新規の会議や更新された会議について、日付と開始時刻が現在の日時以降であることを確認します。
${(((meetingSlot.value.date.date?number_to_date?string['yyyy-MM-dd']+'T'+meetingSlot.value.startTime.date?number_to_date?string['HH:mm:ss'])?datetime.iso?long) gte (.now?date?long - timezoneOffset?number))?then('true','false')}
すべての終了時刻について、終了時刻が開始時刻より後であることを確認します。
${(newEvent.value.startTime.date?number_to_time < newEvent.value.endTime.date?number_to_time)?then('true','false')}
カレンダ・プロバイダの拒否を正常に処理するには、独自のグローバル・エラー・ハンドラを追加します。例:
defaultTransitions:
error: "globalErrorHandler"
actions:
system.authorizeUser: "userAuthN.performOAuth"
...
globalErrorHandler:
requiresAuthorization: false
component: "System.Output"
properties:
text: "Sorry, we were unable to do the action that you requested."
transitions:
return: "done"
または、エラー遷移を使用して、各ケースに適したエラー・ハンドラを作成できます:
setUpMeeting.performSchedule:
component: "System.CreateCalendarEvent"
properties:
start: "${newEvent.value.date.date?number_to_date?string['yyyy-MM-dd']}T${newEvent.value.startTime.date?number_to_date?string['HH:mm:ss']}"
end: "${newEvent.value.date.date?number_to_date?string['yyyy-MM-dd']}T${newEvent.value.endTime.date?number_to_date?string['HH:mm:ss']}"
subject: "${newEvent.value.subject}"
location: "${newEvent.value.location}"
attendees: "${newEvent.value.attendees}"
provider: "${system.config.calendarProvider}"
timezoneOffset: ${timezoneOffset?number * -1}
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
next: "setUpMeeting.printResults"
error: "handleCreateEventError"
...
handleCreateEventError:
requiresAuthorization: false
component: "System.Output"
properties:
text: "Sorry, there's a problem with the event that you wanted to create."
transitions:
return: "done"
System.CreateCalendarEvent
このコンポーネントを使用して、OutlookまたはGoogleのカレンダにイベントを追加します。繰返しイベントまたは終日イベントは作成できないことに注意してください。
ユーザーがこのコンポーネントにアクセスするには、カレンダ・プロバイダにサインインする必要があります。カレンダの認可で説明されているように、「認可が必要」機能を使用してユーザーのサインインを管理できます。
start
とend
の値の設定方法の詳細は、カレンダの日付と時刻の操作を参照してください。
このコンポーネントの使用例を次に示します:この例では、コンポジット・バッグ・エンティティを使用して、日付、開始時刻と終了時刻、件名、場所および参加者を取得します。
####################
# Create Meeting
####################
setUpMeeting:
component: "System.CommonResponse"
properties:
keepTurn: true
processUserMessage: true
variable: "newEvent"
nlpResultVariable: "iResult"
cancelPolicy: "immediate"
transitionAfterMatch: "false"
metadata:
responseItems:
- type: "text"
text: "${system.entityToResolve.value.prompt}"
actions:
- label: "${enumValue}"
type: "postback"
iteratorVariable: "system.entityToResolve.value.enumValues"
payload:
variables:
newEvent: "${enumValue}"
globalActions:
- label: "Cancel"
type: "postback"
visible:
onInvalidUserInput: false
payload:
action: "cancel"
transitions:
actions:
cancel: "allDone"
next: "setUpMeeting.askConfirm"
setUpMeeting.askConfirm:
component: "System.CommonResponse"
properties:
processUserMessage: true
metadata:
responseItems:
- type: "text"
text: |
Create ${newEvent.value.subject} meeting on ${newEvent.value.date.date?number_to_date?string['MMM d']}
from ${newEvent.value.startTime.date?number_to_date?string['hh:mm a']} to ${newEvent.value.endTime.date?number_to_date?string['hh:mm a']}
at ${newEvent.value.location} with ${newEvent.value.attendees}?
name: "confirmCreate"
separateBubbles: true
actions:
- label: "Yes"
type: "postback"
keyword: "yes"
payload:
action: "yes"
name: "Yes"
- label: "No"
keyword: "no"
type: "postback"
payload:
action: "no"
name: "No"
transitions:
next: "intent"
actions:
yes: "setUpMeeting.performSchedule"
no: "allDone"
textReceived: "intent"
setUpMeeting.performSchedule:
component: "System.CreateCalendarEvent"
properties:
start: "${newEvent.value.date.date?number_to_date?string['yyyy-MM-dd']}T${newEvent.value.startTime.date?number_to_date?string['HH:mm:ss']}"
end: "${newEvent.value.date.date?number_to_date?string['yyyy-MM-dd']}T${newEvent.value.endTime.date?number_to_date?string['HH:mm:ss']}"
subject: "${newEvent.value.subject}"
location: "${newEvent.value.location}"
attendees: "${newEvent.value.attendees}"
provider: "${system.config.calendarProvider}"
timezoneOffset: ${timezoneOffset?number * -1}
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
next: "setUpMeeting.printResults"
error: "handleCreateCalendarError"
setUpMeeting.printResults:
component: "System.Output"
properties:
text: "The ${newEvent.value.date.date?number_to_date?string['MMM d']} meeting is now on your calendar."
keepTurn: true
transitions:
next: "setUpMeeting.getMeetings"
...
このコンポーネントは、Oracle Digital Assistantバージョン21.02以降でサポートされます。
プロパティ | 説明 | 必須? |
---|---|---|
provider |
カレンダ・プロバイダ。指定できる値はGoogle およびOutlook です。
|
はい |
calendarOwner |
カレンダ所有者のユーザーID。これは、カレンダ・プロバイダの有効なアカウントIDである必要があります。たとえば、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのauthenticatedUserVariable プロパティで識別される変数の値などです。
|
はい |
calendarId |
カレンダの名前。ユーザーのデフォルト・カレンダの場合は、calendarOwner プロパティと同じ値に設定します。
|
はい |
credential |
プロバイダのアクセス・トークン。これは、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのaccessTokenVariableName プロパティで識別される変数の値です。
|
はい |
start |
yyyy-MM-dd'T'HH:mm:ss というフォーマットでの会議の開始日時(例: 2021-02-26T09:55:00 )。
|
はい |
end |
yyyy-MM-dd'T'HH:mm:ss というフォーマットでの会議の終了日時。例、 2021-02-26T09:55:00
|
はい |
subject |
会議の件名。 | はい |
attendees |
参加者のカンマ区切りリスト。IDがそのカレンダ・プロバイダの有効なアカウントIDでない場合、プロバイダは参加者に通知を送信できないことに注意してください。 | はい |
timezoneOffset |
ユーザーのタイムゾーンの標準時刻を取得するために、世界標準時(UTC)に追加する時間(ミリ秒単位)。たとえば、ローカル・タイムゾーンがUTC-2の場合、timezoneOffset は-7200000 です。デフォルト値は0です。
ノート
ユーザー・コンテキスト変数 profile.timezoneOffset の値に基づいて、現在のユーザーのtimezoneOffset プロパティを導出できます。ただし、そのためには、profile.timezoneOffset に-1を掛ける必要があります。
|
いいえ |
timezone |
https://www.iana.org/time-zonesによって指定されるローカル・タイムゾーンのID。TZデータベース名とも呼ばれます。例: |
いいえ |
System.DeleteCalendarEvent
このコンポーネントを使用して、OutlookまたはGoogleのカレンダからイベントを削除します。繰返しイベントまたは終日イベントは削除できないことに注意してください。
ユーザーがこのコンポーネントにアクセスするには、カレンダ・プロバイダにサインインする必要があります。カレンダの認可で説明されているように、「認可が必要」機能を使用してユーザーのサインインを管理できます。
このコンポーネントの使用例を次に示します:
####################
# Cancel Meeting
####################
# Want to select from deletable meetings
cancelMeeting:
component: "System.SetVariable"
properties:
variable: "stateAfterList"
value: "cancelMeeting.confirmCancel"
transitions:
next: "cancelMeeting.setListType"
cancelMeeting.setListType:
component: "System.SetVariable"
properties:
variable: "listType"
# Only show deletable meetings
value: "DELETE"
transitions:
next: "cancelMeeting.setListPrompt"
cancelMeeting.setListPrompt:
component: "System.SetVariable"
properties:
variable: "listPrompt"
value: "to cancel"
transitions:
next: "listMeetings.commonEntryPoint"
# List meetings common code returns to this state
cancelMeeting.confirmCancel:
component: "System.ResetVariables"
properties:
variableList: "confirmAction"
transitions:
next: "cancelMeeting.askConfirm"
cancelMeeting.askConfirm:
component: "System.CommonResponse"
properties:
processUserMessage: true
metadata:
responseItems:
- type: "text"
text: "Are you sure you want to cancel this meeting?"
name: "confirmCcancel"
separateBubbles: true
actions:
- label: "Yes"
type: "postback"
keyword: "yes"
payload:
action: "yes"
name: "Yes"
- label: "No"
keyword: "no"
type: "postback"
payload:
action: "no"
name: "No"
transitions:
next: "intent"
actions:
yes: "cancelMeeting.performDelete"
no: "allDone"
textReceived: "intent"
cancelMeeting.performDelete:
component: "System.DeleteCalendarEvent"
properties:
eventId: "${eventId}"
provider: "${system.config.calendarProvider}"
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
next: "cancelMeeting.printSuccessMessage"
cancelMeeting.printSuccessMessage:
component: "System.Output"
properties:
text: "I've cancelled the meeting"
transitions:
return: "doneCancel"
...
############################
# List Meetings Shared Code
############################
listMeetings.commonEntryPoint:
component: "System.SetVariable"
properties:
variable: "inputDate"
value: "${iResult.value.entityMatches['DATE'][0]}"
transitions:
next: "listMeetings.setDate"
listMeetings.setDate:
component: "System.SetVariable"
properties:
variable: "start"
value: "${inputDate.value?has_content?then(inputDate.value.date?number_to_date?string['yyyy-MM-dd'], (.now?date?long - timezoneOffset?number?long)?number_to_date?string['yyyy-MM-dd'])}T00:00:00"
transitions:
next: "listMeetings.clearInputDate"
listMeetings.clearInputDate:
component: "System.ResetVariables"
properties:
variableList: "inputDate"
transitions:
next: "listMeetings.filterByAttendees"
listMeetings.filterByAttendees:
component: "System.CommonResponse"
properties:
processUserMessage: true
metadata:
responseItems:
- type: "text"
text: "Do you want to list only meetings with a particular attendee?"
name: "confirmFilter"
separateBubbles: true
actions:
- label: "Yes"
type: "postback"
keyword: "yes"
payload:
action: "yes"
name: "Yes"
- label: "No"
keyword: "no"
type: "postback"
payload:
action: "no"
name: "No"
transitions:
next: "intent"
actions:
yes: "listMeetings.resolveAttendeesFilter"
no: "listMeetings.clearAttendeesFilter"
textReceived: "intent"
# clear filter
listMeetings.clearAttendeesFilter:
component: "System.ResetVariables"
properties:
variableList: "attendees"
transitions:
next: "listMeetings.performList"
# resolve filter
listMeetings.resolveAttendeesFilter:
component: "System.CommonResponse"
properties:
keepTurn: true
processUserMessage: true
variable: "attendees"
nlpResultVariable: "iResult"
metadata:
responseItems:
- type: "text"
text: "Who is the attendee?"
transitions:
next: "listMeetings.performAttendeesList"
actions:
textReceived: "listMeetings.performAttendeesList"
# perform attendees list
listMeetings.performAttendeesList:
component: "System.SelectCalendarEvent"
properties:
listType: "${listType}"
start: "${start}"
attendees: "${attendees}"
prompt: "Choose the ${start?datetime.iso?long?number_to_date?string['MMM d']} meeting ${listPrompt}:"
eventIdVariableName: "eventId"
provider: "${system.config.calendarProvider}"
timezoneOffset: ${timezoneOffset?number * -1}
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
actions:
found: "${stateAfterList}"
notfound: "listMeetings.printNotFoundMessage"
next: "globalErrorHandler"
# perform list
listMeetings.performList:
component: "System.SelectCalendarEvent"
properties:
listType: "${listType}"
start: "${start}"
prompt: "Choose the ${start?datetime.iso?long?number_to_date?string['MMM d']} meeting ${listPrompt}:"
eventIdVariableName: "eventId"
provider: "${system.config.calendarProvider}"
timezoneOffset: ${timezoneOffset?number * -1}
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
actions:
found: "${stateAfterList}"
notfound: "listMeetings.printNotFoundMessage"
next: "globalErrorHandler"
listMeetings.printNotFoundMessage:
component: "System.Output"
properties:
text: "There are no meetings on ${start?datetime.iso?long?number_to_date?string['MMM d']}"
transitions:
return: "doneListMeetings"
...
このコンポーネントは、Oracle Digital Assistantバージョン21.02以降でサポートされます。
プロパティ | 説明 | 必須? |
---|---|---|
provider |
カレンダ・プロバイダ。指定できる値はGoogle およびOutlook です。
|
はい |
calendarOwner |
カレンダ所有者のユーザーID。これは、カレンダ・プロバイダの有効なアカウントIDである必要があります。たとえば、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのauthenticatedUserVariable プロパティで識別される変数の値などです。
|
はい |
calendarId |
カレンダの名前。ユーザーのデフォルト・カレンダの場合は、calendarOwner プロパティと同じ値に設定します。
|
はい |
credential |
プロバイダのアクセス・トークン。これは、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのaccessTokenVariableName プロパティで識別される変数の値です。
|
はい |
eventId |
削除するイベントのID。System.ListCalendarEvents またはSystem.SelectCalendarEvent を使用して、eventId を取得できます。
|
はい |
System.GetCalendarEventDetails
このコンポーネントを使用して、OutlookまたはGoogleのカレンダからイベントの詳細を取得します。
ユーザーがこのコンポーネントにアクセスするには、カレンダ・プロバイダにサインインする必要があります。カレンダの認可で説明されているように、「認可が必要」機能を使用してユーザーのサインインを管理できます。
詳細は、次のようなJSONフォーマットで、eventDetailsVariableName
プロパティで指定された変数に返されます:
{
"isAllDay": boolean,
"subject": string,
"inviteResponse": string,
"attendees": [
"string",
...
],
"start": format yyyy-MM-dd'T'HH:mm:ss.SSSZ,
"end": format yyyy-MM-dd'T'HH:mm:ss.SSSZ,
"location": string,
"isRecurring": boolean,
"id": string
}
start
およびend
プロパティはUTC値です。start
とend
の値の変換方法の詳細は、カレンダの日付と時刻の操作を参照してください。
このコンポーネントの使用例を次に示します:
listMeetings.performGetDetails:
component: "System.GetCalendarEventDetails"
properties:
eventId: "${eventId}"
eventDetailsVariableName: "eventDetails"
provider: "${system.config.calendarProvider}"
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
next: "listMeetings.checkIfResults"
# In case the eventId is no longer valid
listMeetings.checkIfResults:
component: "System.ConditionExists"
properties:
variable: "eventDetails"
transitions:
actions:
exists: "listMeetings.printEventDetails"
notexists: "globalErrorHandler"
listMeetings.printEventDetails:
component: "System.Output"
properties:
text: |
${eventDetails.value.subject}
${(eventDetails.value.start?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['MMM d']}
${(eventDetails.value.start?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['hh:mm a']}-${(eventDetails.value.end?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['hh:mm a']}
Location: ${eventDetails.value.location}
Attendees: ${eventDetails.value.attendees?join(', ')}
transitions:
return: "doneGetDetails"
このコンポーネントは、Oracle Digital Assistantバージョン21.02以降でサポートされます。
プロパティ | 説明 | 必須? |
---|---|---|
provider |
カレンダ・プロバイダ。指定できる値はGoogle およびOutlook です。
|
はい |
calendarOwner |
カレンダ所有者のユーザーID。これは、カレンダ・プロバイダの有効なアカウントIDである必要があります。たとえば、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのauthenticatedUserVariable プロパティで識別される変数の値などです。
|
はい |
calendarId |
カレンダの名前。ユーザーのデフォルト・カレンダの場合は、calendarOwner プロパティと同じ値に設定します。
|
はい |
credential |
プロバイダのアクセス・トークン。これは、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのaccessTokenVariableName プロパティで識別される変数の値です。
|
はい |
eventId |
取得するイベントのID。System.ListCalendarEvents またはSystem.SelectCalendarEvent を使用して、eventId を取得できます。
|
はい |
eventDetailsVariableName |
詳細を格納するコンテキスト変数の名前。 | はい |
System.ListCalendarEvents
このコンポーネントを使用して、指定したカレンダ所有者についてOutlookまたはGoogleイベントの配列を取得します。リストは次の属性でフィルタ処理できます:
- 削除できるイベント
- 更新できるイベント
- イベントに招待されたユーザー
- ユーザーが招待に応答した方法
- 指定した参加者1人以上が含まれるイベント
- 特定の日時より後に開始する会議
- 特定の日時より前に終了する会議
ユーザーがこのコンポーネントにアクセスするには、カレンダ・プロバイダにサインインする必要があります。カレンダの認可で説明されているように、「認可が必要」機能を使用してユーザーのサインインを管理できます。
リストは、次のようなJSONフォーマットで、eventListVariableName
プロパティで指定された変数に返されます。
[{
"isAllDay": boolean,
"subject": string,
"inviteResponse": string,
"start": format yyyy-MM-dd'T'HH:mm:ss.SSSZ,
"end": format yyyy-MM-dd'T'HH:mm:ss.SSSZ,
"isRecurring": boolean,
"id": string
}, …]
start
とend
の値の設定方法の詳細は、カレンダの日付と時刻の操作を参照してください。このトピックでは、JSONのstart
およびend
プロパティ値をローカル時間に変換する方法も示します。
このコンポーネントの使用例を次に示します:
############################
# List Invites
############################
listInvites:
component: "System.ListCalendarEvents"
properties:
provider: "${system.config.calendarProvider}"
timezoneOffset: ${timezoneOffset?number * -1}
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
listType: "INVITED"
response: "PENDING,ACCEPTED,TENTATIVE,DECLINED"
eventListVariableName: "eventList"
start: "${(.now?date?long - timezoneOffset?number?long)?number_to_date?string['yyyy-MM-dd']}T00:00:00"
transitions:
next: "globalErrorHandler"
actions:
found: "listInvites.printMeetings"
notfound: "listInvites.notFound"
listInvites.printMeetings:
component: "System.CommonResponse"
properties:
keepTurn: true
metadata:
responseItems:
- type: "text"
# display the local time
text: |
${eventList.subject} [${eventList.inviteResponse}]
${(eventList.start?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['MMM d hh:mm a']} to ${(eventList.end?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['hh:mm a']}
name: "event"
separateBubbles: true
iteratorVariable: "eventList"
processUserMessage: false
transitions:
return: "listInvitesDone"
listInvites.notFound:
component: "System.Output"
properties:
keepTurn: true
text: "You don't have any invitations for the next 14 days"
transitions:
return: "listInvitesDone"
このコンポーネントは、Oracle Digital Assistantバージョン21.02以降でサポートされます。
プロパティ | 説明 | 必須? |
---|---|---|
provider |
カレンダ・プロバイダ。指定できる値はGoogle およびOutlook です。
|
はい |
calendarOwner |
カレンダ所有者のユーザーID。これは、カレンダ・プロバイダの有効なアカウントIDである必要があります。たとえば、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのauthenticatedUserVariable プロパティで識別される変数の値などです。
|
はい |
calendarId |
カレンダの名前。ユーザーのデフォルト・カレンダの場合は、calendarOwner プロパティと同じ値に設定します。
|
はい |
credential |
プロバイダのアクセス・トークン。これは、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのaccessTokenVariableName プロパティで識別される変数の値です。
|
はい |
listType |
リストのタイプを示します。次のいずれかである必要があります:
|
はい |
eventListVariableName |
イベント・リストを格納するコンテキスト変数の名前。 | はい |
start |
リストに含める会議の最も早い日時(フォーマット: yyyy-MM-dd'T'HH:mm:ss )。例、 2021-02-26T09:55:00
|
はい |
end |
リストに含める会議の最も遅い日時(フォーマット: yyyy-MM-dd'T'HH:mm:ss )。例、 2021-02-26T09:55:00
リスト・タイプ |
いいえ |
attendees |
大/小文字が区別されない文字列のカンマ区切りリスト。参加者によってリストをフィルタ処理するために使用されます。1つ以上のattendee値にリストの1つ以上の文字列が含まれている会議のみが出力されます。 | いいえ |
response |
招待の状態のカンマ区切りリスト。listType がINVITED のときにリストをフィルタ処理するために使用されます。指定できる状態は次のとおりです:
デフォルトは |
いいえ |
timezoneOffset |
ユーザーのタイムゾーンの標準時刻を取得するために、世界標準時(UTC)に追加する時間(ミリ秒単位)。たとえば、ローカル・タイムゾーンがUTC-2の場合、timezoneOffset は-7200000 です。デフォルト値は0です。
ノート
ユーザー・コンテキスト変数 profile.timezoneOffset の値に基づいて、現在のユーザーのtimezoneOffset プロパティを導出できます。ただし、そのためには、profile.timezoneOffset に-1を掛ける必要があります。
|
いいえ |
timezone |
https://www.iana.org/time-zonesによって指定されるローカル・タイムゾーンのID。TZデータベース名とも呼ばれます。例: America/Los_Angeles 。デフォルトはUTC です。timezoneOffset またはtimezone を指定できますが、両方は指定できません。
|
いいえ |
このコンポーネントは、次のアクションを返すことができます:
アクション | 説明 |
---|---|
found |
1つ以上のイベントが返されました。 |
notfound |
一致するイベントがありません。 |
System.SelectCalendarEvent
このコンポーネントを使用して、ユーザーが選択できるOutlookまたはGoogleイベントのリストを表示します。このコンポーネントは、選択されたイベントのIDをeventIdVariableName
プロパティで指定された変数に保存します。
選択するためのリストは次の属性でフィルタ処理できます:
- 削除できるイベント
- 更新できるイベント
- イベントに招待されたユーザー
- ユーザーが招待に応答した方法
- 指定した参加者1人以上が含まれるイベント
- 特定の日時より後に開始する会議
- 特定の日時より前に終了する会議
ユーザーがこのコンポーネントにアクセスするには、カレンダ・プロバイダにサインインする必要があります。カレンダの認可で説明されているように、「認可が必要」機能を使用してユーザーのサインインを管理できます。
start
とend
の値の設定方法の詳細は、カレンダの日付と時刻の操作を参照してください。
このコンポーネントの使用例を次に示します:
############################
# Respond Invites
############################
respondInvites.performList:
component: "System.SelectCalendarEvent"
properties:
listType: "INVITED"
response: "${inviteFilter}"
# Note: For list type INVITED the default end date is 14 days after the start date and time.
start: "${(.now?date?long - timezoneOffset?number?long)?number_to_date?string['yyyy-MM-dd']}T00:00:00"
prompt: "Select the invitation to send the response to:"
eventIdVariableName: "eventId"
provider: "${system.config.calendarProvider}"
timezoneOffset: ${timezoneOffset?number * -1}
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
next: "globalErrorHandler"
actions:
found: "respondInvites.resolveInviteResponse"
notfound: "respondInvites.printNotFoundMessage"
respondInvites.printNotFoundMessage:
component: "System.Output"
properties:
text: "There are no meeting invites."
transitions:
return: "allDone"
...
このコンポーネントは、Oracle Digital Assistantバージョン21.02以降でサポートされます。
プロパティ | 説明 | 必須? |
---|---|---|
provider |
カレンダ・プロバイダ。指定できる値はGoogle およびOutlook です。
|
はい |
calendarOwner |
カレンダ所有者のユーザーID。これは、カレンダ・プロバイダの有効なアカウントIDである必要があります。たとえば、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのauthenticatedUserVariable プロパティで識別される変数の値などです。
|
はい |
calendarId |
カレンダの名前。ユーザーのデフォルト・カレンダの場合は、calendarOwner プロパティと同じ値に設定します。
|
はい |
credential |
プロバイダのアクセス・トークン。これは、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのaccessTokenVariableName プロパティで識別される変数の値です。
|
はい |
listType |
リストのタイプを示します。次のいずれかである必要があります:
|
はい |
eventIdVariableName |
イベントのIDを格納するコンテキスト変数の名前。 | はい |
start |
リストに含める会議の最も早い日時(フォーマット: yyyy-MM-dd'T'HH:mm:ss )。例、 2021-02-26T09:55:00
|
はい |
end |
リストに含める会議の最も遅い日時(フォーマット: yyyy-MM-dd'T'HH:mm:ss )。例、 2021-02-26T09:55:00
リスト・タイプ |
いいえ |
attendees |
大/小文字が区別されない文字列のカンマ区切りリスト。参加者によってリストをフィルタ処理するために使用されます。1つ以上のattendee値にリストの1つ以上の文字列が含まれている会議のみが出力されます。 | いいえ |
response |
招待の状態のカンマ区切りリスト。listType がINVITED のときにリストをフィルタ処理するために使用されます。指定できる状態は次のとおりです:
デフォルトは |
いいえ |
prompt |
リストの前に表示されるテキスト。デフォルトはYou have the following meeting(s): です。デフォルトをオーバーライドする場合を除き、このプロパティを含める必要はありません。
ヒント: プラットフォーム・バージョンが21.04以降のスキルでは、デフォルト値はスキルのリソース・バンドルに格納されます。デフォルトを変更するには、スキルの「リソース・バンドル」ページを開き、![]() |
いいえ |
allDayLabel |
終日イベントを示すテキスト。デフォルトはAll day です。
|
いいえ |
recurringLabel |
繰返しイベントを示すテキスト。デフォルトはRecurring です。
|
いいえ |
acceptedLabel |
カレンダ所有者が招待を受け入れたことを示すテキスト。デフォルトはAccepted です。
|
いいえ |
tentativeLabel |
カレンダ所有者が招待を仮に受け入れたことを示すテキスト。デフォルトはTentative です。
|
いいえ |
declinedLabel |
カレンダ所有者が招待を辞退したことを示すテキスト。デフォルトはDeclined です。
|
いいえ |
pendingLabel |
カレンダ所有者が招待に応答しなかったことを示すテキスト。デフォルトはPending です。
|
いいえ |
timezoneOffset |
ユーザーのタイムゾーンの標準時刻を取得するために、世界標準時(UTC)に追加する時間(ミリ秒単位)。たとえば、ローカル・タイムゾーンがUTC-2の場合、timezoneOffset は-7200000 です。デフォルト値は0です。
ノート
ユーザー・コンテキスト変数 profile.timezoneOffset の値に基づいて、現在のユーザーのtimezoneOffset プロパティを導出できます。ただし、そのためには、profile.timezoneOffset に-1を掛ける必要があります。
|
いいえ |
timezone |
https://www.iana.org/time-zonesによって指定されるローカル・タイムゾーンのID。TZデータベース名とも呼ばれます。例: America/Los_Angeles 。デフォルトはUTC です。timezoneOffset またはtimezone を指定できますが、両方は指定できません。
|
いいえ |
このコンポーネントは、次のアクションを返すことができます:
アクション | 説明 |
---|---|
found |
1つ以上のイベントが返されました。 |
notfound |
一致するイベントがありません。 |
System.SendInviteResponse
このコンポーネントを使用して、OutlookまたはGoogleのカレンダ・イベントについて、招待の受入れ、仮受入れまたは辞退を行います。
ユーザーがこのコンポーネントにアクセスするには、カレンダ・プロバイダにサインインする必要があります。カレンダの認可で説明されているように、「認可が必要」機能を使用してユーザーのサインインを管理できます。
このコンポーネントの使用例を次に示します:
############################
# Respond Invites
############################
respondInvites:
component: "System.CommonResponse"
properties:
processUserMessage: true
metadata:
responseItems:
- type: "text"
text: "Which types of meeting invitations do you want to respond to?"
name: "getInviteFilter"
separateBubbles: true
actions:
- label: "Pending and tentatively accepted invitations"
type: "postback"
keyword: "PENDING,TENTATIVE"
payload:
variables:
inviteFilter: "PENDING,TENTATIVE"
- label: "All invitations"
keyword: "PENDING,ACCEPTED,TENTATIVE,DECLINED"
type: "postback"
payload:
variables:
inviteFilter: "PENDING,ACCEPTED,TENTATIVE,DECLINED"
- label: "Cancel"
keyword: "cancel"
type: "postback"
payload:
action: "allDone"
transitions:
actions:
allDone: "allDone"
textReceived: "intent"
next: "respondInvites.performList"
respondInvites.performList:
component: "System.SelectCalendarEvent"
properties:
listType: "INVITED"
response: "${inviteFilter}"
# Note: For list type INVITED the default end date is 14 days after the start date and time.
start: "${(.now?date?long - timezoneOffset?number?long)?number_to_date?string['yyyy-MM-dd']}T00:00:00"
prompt: "Select the invitation to send the response to:"
eventIdVariableName: "eventId"
provider: "${system.config.calendarProvider}"
timezoneOffset: ${timezoneOffset?number * -1}
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
next: "globalErrorHandler"
actions:
found: "respondInvites.resolveInviteResponse"
notfound: "respondInvites.printNotFoundMessage"
respondInvites.printNotFoundMessage:
component: "System.Output"
properties:
text: "There are no meeting invites."
transitions:
return: "allDone"
############################
# Invite Response
############################
respondInvites.resolveInviteResponse:
component: "System.CommonResponse"
properties:
processUserMessage: true
metadata:
responseItems:
- type: "text"
text: "Choose a response:"
name: "getInviteResponse"
separateBubbles: true
actions:
- label: "Accept"
type: "postback"
keyword: "ACCEPTED"
payload:
variables:
inviteResponse: "ACCEPTED"
- label: "Tentatively accept"
keyword: "TENTATIVE"
type: "postback"
payload:
variables:
inviteResponse: "TENTATIVE"
- label: "Decline"
keyword: "DECLINED"
type: "postback"
payload:
variables:
inviteResponse: "DECLINED"
- label: "Don't send a response"
keyword: "CANCEL"
type: "postback"
payload:
action: "allDone"
transitions:
actions:
allDone: "allDone"
textReceived: "intent"
next: "respondInvites.performRespond"
respondInvites.performRespond:
component: "System.SendInviteResponse"
properties:
eventId: "${eventId}"
response: "${inviteResponse}"
provider: "${system.config.calendarProvider}"
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
next: "respondInvites.printSuccessMessage"
respondInvites.printSuccessMessage:
component: "System.Output"
properties:
text: "I've sent the meeting invitation response"
transitions:
return: "doneSendInviteResponse"
このコンポーネントは、Oracle Digital Assistantバージョン21.02以降でサポートされます。
プロパティ | 説明 | 必須? |
---|---|---|
provider |
カレンダ・プロバイダ。指定できる値はGoogle およびOutlook です。
|
はい |
calendarOwner |
カレンダ所有者のユーザーID。これは、カレンダ・プロバイダの有効なアカウントIDである必要があります。たとえば、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのauthenticatedUserVariable プロパティで識別される変数の値などです。
|
はい |
calendarId |
カレンダの名前。ユーザーのデフォルト・カレンダの場合は、calendarOwner プロパティと同じ値に設定します。
|
はい |
credential |
プロバイダのアクセス・トークン。これは、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのaccessTokenVariableName プロパティで識別される変数の値です。
|
はい |
eventId |
レスポンスの送信先のイベントのID。System.ListCalendarEvents またはSystem.SelectCalendarEvent を使用して、カレンダ所有者が招待されたカレンダ・イベントのIDを取得できます。
|
はい |
response |
送信するレスポンス。指定できるレスポンスは次のとおりです:
|
はい |
System.UpdateCalendarEvent
このコンポーネントを使用して、OutlookまたはGoogleのカレンダ・イベントを変更します。繰返しイベントまたは終日イベントは更新できないことに注意してください。
ユーザーがこのコンポーネントにアクセスするには、カレンダ・プロバイダにサインインする必要があります。カレンダの認可で説明されているように、「認可が必要」機能を使用してユーザーのサインインを管理できます。
start
とend
の値の設定方法の詳細は、カレンダの日付と時刻の操作を参照してください。
このコンポーネントの使用例を次に示します:この例では、コンポジット・バッグ・エンティティを使用して、日付、開始時刻および終了時刻を取得します。
####################
# Update Meeting
####################
updateMeeting:
component: "System.SetVariable"
properties:
variable: "stateAfterList"
value: "updateMeeting.performGetDetails"
transitions:
next: "updateMeeting.setListType"
updateMeeting.setListType:
component: "System.SetVariable"
properties:
variable: "listType"
# Only show updateable meetings
value: "UPDATE"
transitions:
next: "updateMeeting.setListPrompt"
updateMeeting.setListPrompt:
component: "System.SetVariable"
properties:
variable: "listPrompt"
value: "to update"
transitions:
next: "listMeetings.commonEntryPoint"
# List meetings common code returns to this state
updateMeeting.performGetDetails:
component: "System.GetCalendarEventDetails"
properties:
eventId: "${eventId}"
eventDetailsVariableName: "eventDetails"
provider: "${system.config.calendarProvider}"
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
next: "updateMeeting.checkIfResults"
updateMeeting.checkIfResults:
component: "System.ConditionExists"
properties:
variable: "eventDetails"
transitions:
actions:
exists: "updateMeeting.printEventDetails"
notexists: "globalErrorHandler"
updateMeeting.printEventDetails:
component: "System.Output"
properties:
keepTurn: true
text: |
You selected:
${eventDetails.value.subject}
${(eventDetails.value.start?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['MMM d']}
${(eventDetails.value.start?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['hh:mm a']}-${(eventDetails.value.end?datetime.iso?long - timezoneOffset?number?long)?number_to_date?string['hh:mm a']}
Location: ${eventDetails.value.location}
Attendees: ${eventDetails.value.attendees?join(', ')}
transitions:
next: "updateMeeting.updateTime"
# Change meeting time
updateMeeting.updateTime:
component: "System.ResolveEntities"
properties:
variable: "meetingSlot"
nlpResultVariable: "iResult"
maxPrompts: 5
cancelPolicy: "immediate"
transitions:
actions:
cancel: "allDone"
next: "updateMeeting.setStart"
updateMeeting.setStart:
component: "System.SetVariable"
properties:
variable: "start"
value: "${meetingSlot.value.date.date?number_to_date?string['yyyy-MM-dd']}T${meetingSlot.value.startTime.date?number_to_date?string['HH:mm:ss']}"
transitions:
next: "updateMeeting.setEnd"
updateMeeting.setEnd:
component: "System.SetVariable"
properties:
variable: "end"
value: "${meetingSlot.value.date.date?number_to_date?string['yyyy-MM-dd']}T${meetingSlot.value.endTime.date?number_to_date?string['HH:mm:ss']}"
transitions:
next: "updateMeeting.updateTime.performUpdate"
updateMeeting.updateTime.performUpdate:
component: "System.UpdateCalendarEvent"
properties:
eventId: "${eventId}"
start: "${start}"
end: "${end}"
provider: "${system.config.calendarProvider}"
#timezone: "${system.config.timezoneID}"
timezoneOffset: ${timezoneOffset?number * -1}
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
next: "updateMeeting.printSuccessMessage"
error: "handleUpdateCalendarError"
...
############################
# List Meetings Shared Code
############################
listMeetings.commonEntryPoint:
component: "System.SetVariable"
properties:
variable: "inputDate"
value: "${iResult.value.entityMatches['DATE'][0]}"
transitions:
next: "listMeetings.setDate"
listMeetings.setDate:
component: "System.SetVariable"
properties:
variable: "start"
value: "${inputDate.value?has_content?then(inputDate.value.date?number_to_date?string['yyyy-MM-dd'], (.now?date?long - timezoneOffset?number?long)?number_to_date?string['yyyy-MM-dd'])}T00:00:00"
transitions:
next: "listMeetings.clearInputDate"
listMeetings.clearInputDate:
component: "System.ResetVariables"
properties:
variableList: "inputDate"
transitions:
next: "listMeetings.filterByAttendees"
listMeetings.filterByAttendees:
component: "System.CommonResponse"
properties:
processUserMessage: true
metadata:
responseItems:
- type: "text"
text: "Do you want to list only meetings with a particular attendee?"
name: "confirmFilter"
separateBubbles: true
actions:
- label: "Yes"
type: "postback"
keyword: "yes"
payload:
action: "yes"
name: "Yes"
- label: "No"
keyword: "no"
type: "postback"
payload:
action: "no"
name: "No"
transitions:
next: "intent"
actions:
yes: "listMeetings.resolveAttendeesFilter"
no: "listMeetings.clearAttendeesFilter"
textReceived: "intent"
# clear filter
listMeetings.clearAttendeesFilter:
component: "System.ResetVariables"
properties:
variableList: "attendees"
transitions:
next: "listMeetings.performList"
# resolve filter
listMeetings.resolveAttendeesFilter:
component: "System.CommonResponse"
properties:
keepTurn: true
processUserMessage: true
variable: "attendees"
nlpResultVariable: "iResult"
metadata:
responseItems:
- type: "text"
text: "Who is the attendee?"
transitions:
next: "listMeetings.performAttendeesList"
actions:
textReceived: "listMeetings.performAttendeesList"
# perform attendees list
listMeetings.performAttendeesList:
component: "System.SelectCalendarEvent"
properties:
listType: "${listType}"
start: "${start}"
attendees: "${attendees}"
prompt: "Choose the ${start?datetime.iso?long?number_to_date?string['MMM d']} meeting ${listPrompt}:"
eventIdVariableName: "eventId"
provider: "${system.config.calendarProvider}"
timezoneOffset: ${timezoneOffset?number * -1}
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
actions:
found: "${stateAfterList}"
notfound: "listMeetings.printNotFoundMessage"
next: "globalErrorHandler"
# perform list
listMeetings.performList:
component: "System.SelectCalendarEvent"
properties:
listType: "${listType}"
start: "${start}"
prompt: "Choose the ${start?datetime.iso?long?number_to_date?string['MMM d']} meeting ${listPrompt}:"
eventIdVariableName: "eventId"
provider: "${system.config.calendarProvider}"
timezoneOffset: ${timezoneOffset?number * -1}
calendarOwner: "${user.authenticatedUser}"
calendarId: "${user.authenticatedUser}"
credential: "${user.accessToken}"
transitions:
actions:
found: "${stateAfterList}"
notfound: "listMeetings.printNotFoundMessage"
next: "globalErrorHandler"
listMeetings.printNotFoundMessage:
component: "System.Output"
properties:
text: "There are no meetings on ${start?datetime.iso?long?number_to_date?string['MMM d']}"
transitions:
return: "doneListMeetings"
...
このコンポーネントは、Oracle Digital Assistantバージョン21.02以降でサポートされます。
プロパティ | 説明 | 必須? |
---|---|---|
provider |
カレンダ・プロバイダ。指定できる値はGoogle およびOutlook です。
|
はい |
calendarOwner |
カレンダ所有者のユーザーID。これは、カレンダ・プロバイダの有効なアカウントIDである必要があります。たとえば、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのauthenticatedUserVariable プロパティで識別される変数の値などです。
|
はい |
calendarId |
カレンダの名前。ユーザーのデフォルト・カレンダの場合は、calendarOwner プロパティと同じ値に設定します。
|
はい |
credential |
プロバイダのアクセス・トークン。これは、ユーザー認証時に設定される、System.OAuth2AccountLink コンポーネントのaccessTokenVariableName プロパティで識別される変数の値です。
|
はい |
eventId |
更新するイベントのID。System.ListCalendarEvents またはSystem.SelectCalendarEvent を使用して、eventId を取得できます。
|
はい |
start |
yyyy-MM-dd'T'HH:mm:ss というフォーマットでの新しい開始日時(例: 2021-02-26T09:55:00 )。
|
いいえ |
end |
yyyy-MM-dd'T'HH:mm:ss というフォーマットでの新しい終了日時(例: 2021-02-26T09:55:00 )。
|
いいえ |
subject |
会議の新しい件名。 | はい |
attendees |
参加者のカンマ区切りリスト。このリストで前のリストが置き換えられます。IDがそのカレンダ・プロバイダの有効なアカウントIDでない場合、プロバイダは参加者に通知を送信できないことに注意してください。 | はい |
timezoneOffset |
ユーザーのタイムゾーンの標準時刻を取得するために、世界標準時(UTC)に追加する時間(ミリ秒単位)。たとえば、ローカル・タイムゾーンがUTC-2の場合、timezoneOffset は-7200000 です。デフォルト値は0です。
ノート
ユーザー・コンテキスト変数 profile.timezoneOffset の値に基づいて、現在のユーザーのtimezoneOffset プロパティを導出できます。ただし、そのためには、profile.timezoneOffset に-1を掛ける必要があります。
|
いいえ |
timezone |
https://www.iana.org/time-zonesによって指定されるローカル・タイムゾーンのID。TZデータベース名とも呼ばれます。例: America/Los_Angeles 。デフォルトはUTC です。timezoneOffset またはtimezone を指定できますが、両方は指定できません。
|
いいえ |
フッター

このフッターは、Facebookのようなボタンをサポートするチャネルも含め、すべてのチャネルに表示されます。ただし、フッター用のチャネル固有のレンダリングを構成できます。これを行うには:
-
system.message
式を使用してautoNumberPostbackActions
変数を定義します。setAutoNumbering: component: "System.SetVariable" properties: variable: "autoNumberPostbackActions" value: "${(system.channelType=='facebook')?then('true','false')}"
-
チャネル・タイプに基づいてフッターを表示または非表示にするには、
footerText
定義をApache FreeMarkerのif
ディレクティブとともに定義します。footerText: <#if autoNumberPostbackActions.value>"Make your choice by entering the menu option number."</#if>
Facebookでは、フッター・テキストはSystem.CommonResponseによってグローバル・アクション(クイック返信)の直前に表示される固有のテキスト・バブルにレンダリングされます。これらのアクションの後にはフッターを表示できません。その理由は、アクションを非表示にする2番目のフッター・テキスト・バブルが必要になるためです。
translateプロパティ
autoTranslate
変数設定をオーバーライドするtranslate
プロパティがあります:
-
autoTranslate
変数をfalse
(デフォルト)に設定した場合、translate
プロパティをtrue
に設定しないかぎり、コンポーネントで自動翻訳は行われません。 -
autoTranslate
変数をtrue
に設定した場合、translate
プロパティも暗黙的にtrue
に設定され、これはラベル、タイトル、説明、プロンプトおよびテキスト文字列が翻訳されることを意味します。
autotranslate
をtrue
に設定して有効にした場合、コンポーネントのtranslate
プロパティをfalse
に設定すると、そのプロンプト、タイトル、説明、ラベルおよびテキスト文字列は翻訳されません。逆に、autotranslate
を有効にしないが、コンポーネントのtranslate
プロパティがtrue
に設定されている場合、コンポーネントのプロンプト、タイトル、説明、ラベルおよびテキスト文字列は、構成された翻訳サービスを使用して、検出されたユーザー言語に翻訳されます。(入力コンポーネントによって、ユーザー入力は英語に翻訳されます。)
autoTranslateの設定... | ...コンポーネントのtranslateプロパティの設定... | ...ユーザー入力、プロンプト、ラベル、テキスト、タイトルおよび説明が翻訳される |
---|---|---|
true |
設定されていません | はい |
true |
true |
はい |
true |
false |
いいえ |
false |
設定されていません | いいえ |
false |
false |
いいえ |
false |
true |
はい |
ビジュアル・フロー・デザイナで設計されたフローには、
translate
プロパティまたはautoTranslate
コンテキスト変数がありません。これらのスキルの翻訳を構成するには、「ユーザー入力メッセージの翻訳」および「ボット・レスポンス・メッセージの翻訳」プロパティを使用します。
System.Feedback
System.Feedback
コンポーネントを使用すると、インサイトのフィードバック・データを収集できます。これは、ユーザーがトランザクション・フローを完了した後に評価スケールを表示することで行えます。21.10 SDK以降を使用している場合、このコンポーネントは水平星評価システムを出力します。以前のSDKを使用している場合、コンポーネントはこの評価スケールを単純なリストとして出力し、ユーザーは評価に対応するボタンをタップできます。
このコンポーネントの動作はコンポーネント・プロパティを使用して変更できますが、SDK (バージョン21.10以降)を使用するときにルック・アンド・フィールを変更できます。たとえば、フィードバック・ボタンに使用されるデフォルトの星アイコンを別のアイコンに置き換えることができます。
System.Feedbackコンポーネントのプロパティ
プロパティ | 説明 |
---|---|
maxRating |
ユーザーが送信できる最大評価。デフォルトでは、最大値は5 です。この値は下方に調整できます。
|
enableTextFeedback |
ブール(true に設定すると、評価がthreshold 値以下の場合にユーザーがテキスト・フィードバックを送信できるようになります)。デフォルトでは、このプロパティはfalse (有効なフィードバックなし)に設定されます。
|
threshold |
above アクションとbelow アクション間の遷移を評価するための値。デフォルトでは、正のフィードバックと負のフィードバックのしきい値は、デフォルトのmaxRating 値(5 )に対して2 に設定されます。
|
footerText |
フィードバック・ダイアログの下部に表示されるテキスト。 |
System.Feedbackコンポーネントの遷移
return: "done"
遷移で会話を終了するダイアログ・フローの状態に名前を付ける必要があります。
アクション | 説明 |
---|---|
above |
ユーザー入力がthreshold 値を上回る有効な値である場合に設定します。
|
below |
ユーザー入力が有効な値で、threshold 値以下の場合に設定します。)。
|
cancel |
ユーザーが「スキップ」をクリックして評価を却下するときに設定します。 |
system.userFeedbackRating
– ユーザーの評価を返します。system.userFeedbackText
–enableTextFeedback
がtrue
に設定されている場合、評価がthreshold
値を下回ったときにスキルがフィードバックを要求できます。system.userFeedbackText
はユーザーの入力(${system.userFeedbackText.value}
)を返します。
...
getUserFeedback:
component: "System.Feedback"
properties:
threshold: 2
maxRating: 5
enableTextFeedback: true
transitions:
actions:
above: "positiveFeedback"
below: "negativeFeedback"
cancel: "cancelFeedback"
positiveFeedback:
component: "System.Output"
properties:
text: "Thank you for your rating of ${system.userFeedbackRating.value}."
transitions:
return: "done"
negativeFeedback:
component: "System.Output"
properties:
text: "You gave us a score of ${system.userFeedbackRating.value} and entered ${system.userFeedbackText.value}. We appreciate your feedback."
transitions:
return: "done"
cancelFeedback:
component: "System.Output"
properties:
text: "Feedback canceled."
transitions:
return: "done"
...
System.Text
このコンポーネントは非推奨であり、使用可能なテンプレートはもうありません。かわりに、「コンポーネントの追加」ダイアログの「ユーザー・メッセージング」セクションで提供される共通レスポンス・コンポーネントに基づいて、多数のテンプレートのいずれかを使用できます。
System.Text
コンポーネントを使用すると、テキストを入力するようユーザーに指示して、ボットでコンテキスト変数またはユーザー変数を設定できます。
System.Text
状態になると、テキストの入力をユーザーに求めます。ユーザーが値を入力すると、ダイアログ・エンジンはこの状態に戻ります。コンポーネントはユーザー・レスポンスを処理し、ユーザー入力を変数タイプに変換できる場合は、変数に値を格納します。この変数に値がある場合、ダイアログ・エンジンは別の状態に移行します。
変数にすでに値がある場合、ダイアログ・エンジンは
System.Text
状態をスキップします。
プロパティ | 説明 | 必須? |
---|---|---|
prompt |
ユーザーから必要な入力について説明するテキスト文字列。値式を使用して、これに動的に値を追加できます。例: こんにちは${profile.firstName}さん、ピザをいくつオーダーされますか。 |
はい |
variable |
変数の名前(ユーザー変数、またはcontext ノードで宣言された変数のうちの1つ)。
|
はい |
nlpResultVariable |
エンティティ値を使用してvariable プロパティを設定します(参照される変数に対してそのエンティティ値がまだ設定されていない場合)。NLPの結果を保持する変数を使用して定義すると(サンプル・ボットで使用されているiresult: "nlpresult" など)、nlpResultVariable で値を返すことができます。こうすることで、変数によって参照されるエンティティと一致する解決済エンティティが見つかった場合、nlpResultVariable プロパティはnullであっても値を移入できます。nlpResultVariable によって値が設定されると、ダイアログは次の状態に遷移します。このプロパティは、System.SetVariableコンポーネントのかわりに使用できます。
|
いいえ |
maxPrompts |
コンポーネントがユーザーに有効な入力を求める回数。ユーザー・プロンプト数の制限を参照してください。 | いいえ |
translate |
このプロパティを使用して、autotranslate コンテキスト変数に対して設定したブール値をオーバーライドします。この変数を設定していない場合、またはfalse に設定した場合、このプロパティをtrue に設定して、このコンポーネントに対してのみ自動翻訳を有効にすることができます。autotranslation 変数をtrue に設定した場合、このプロパティをfalse に設定して、このコンポーネントを自動翻訳から除外できます。スキルでの翻訳サービスを参照してください。
|
いいえ |
このコンポーネントで使用できる事前定義済のアクション・タイプについては、共通レスポンス・コンポーネントの遷移を参照してください。
System.Textコンポーネントの使用方法
この例では、type
変数が、PizzaType
エンティティによって予期されている値(cheese
、Veggie Lover
、Hawaiian
など)を保持します。この情報がユーザー入力にない場合でも、ボットのダイアログ・フローはtype
状態に遷移し、そのSystem.Text
コンポーネントが要望を明示的に示すようユーザーに求めるため、ボットは情報を取得できます。この時点でも、次の状態に遷移するには、ユーザー入力がPizzaType
エンティティに解決される必要があることに注意してください。
main: true
name: "PizzaBot"
parameters:
age: 18
context:
variables:
size: "PizzaSize"
type: "PizzaType"
crust: "PizzaCrust"
iResult: "nlpresult"
...
type:
component: "System.Text"
properties:
prompt: "What Type of Pizza do you want?"
variable: "type"
transitions:
...
System.List
このコンポーネントは非推奨であり、使用可能なテンプレートはもうありません。かわりに、「コンポーネントの追加」ダイアログの「ユーザー・メッセージング」セクションで提供される共通レスポンス・コンポーネントに基づいて、多数のテンプレートのいずれかを使用できます。
System.List
コンポーネントは、オプションのリストを出力するように設計されています。変数値が設定されているかどうか(またはこのコンポーネントに対して定義されているかどうか)に応じて、コンポーネントからのナビゲーションを、ユーザーの選択によって、またはユーザー変数かコンテキスト変数に設定された値によってトリガーできます。
プロパティ | 説明 | 必須? |
---|---|---|
options |
カンマ区切りのテキスト文字列やApache FreeMarker式を使用して、およびマップのリストとして、options を指定できます。optionsプロパティとアクション・リストでは、両方とも後者のアプローチの例が提供されます。
|
はい |
prompt |
ユーザーに入力を求めるテキスト文字列。 | はい |
variable |
ユーザー入力によって値が移入される変数の名前。変数値がすでに設定されている場合はダイアログ・エンジンはこの状態をスキップし、ユーザー用のリスト・オプションは出力されません。 | いいえ |
nlpResultVariable |
エンティティ値を使用してvariable プロパティを設定します(参照される変数に対してそのエンティティ値がまだ設定されていない場合)。NLPの結果を保持する変数を使用して定義すると(サンプル・スキルで使用されているiResult: "nlpresult" など)、nlpResultVariable で値を返すことができます。こうすることで、変数によって参照されるエンティティと一致する解決済エンティティが見つかった場合、nlpResultVariable プロパティはnullであっても値を移入できます。nlpResultVariable によって値が設定されると、ダイアログは次の状態に遷移します。このプロパティは、System.SetVariableコンポーネントのかわりに使用できます。アクション・リストでは、variable およびnlpResultVariable プロパティを使用してリスト表示動作を変更する方法について説明します。
|
いいえ—variableプロパティでエンティティ・タイプの変数が指定されている場合は、このプロパティを使用します。 |
maxPrompts |
コンポーネントがユーザーに有効な入力を求める回数。ユーザー・プロンプト数の制限を参照してください。 | いいえ |
translate |
このプロパティを使用して、autotranslate コンテキスト変数に対して設定したブール値をオーバーライドします。この変数を設定していない場合、またはfalse に設定した場合、このプロパティをtrue に設定して、このコンポーネントに対してのみ自動翻訳を有効にすることができます。autotranslation 変数をtrue に設定した場合、このプロパティをfalse に設定して、このコンポーネントを自動翻訳から除外できます。スキルでの翻訳サービスを参照してください。
|
いいえ |
autoNumberPostbackActions |
true に設定すると、このオプションによって、オプションの先頭に番号が付けられます。このオプションをtrue に設定していない場合でも、デジタル・アシスタントの「ポストバック・アクションでの自動採番の有効化」構成がtrue に設定されている場合は、リスト・アイテムに自動採番を適用できます。チャネル固有の自動採番は、デジタル・アシスタントに登録されているすべてのスキルに適用できます:${(system.channelType=='twilio')?then('true','false')} |
いいえ |
footerText |
テキストのみのチャネルでの出力を拡張します。フッターで説明されているように、FreeMarker式を使用して、テキストのみのチャネルのフッター・テキストに条件を設定できます。 | いいえ |
値リスト
次のスニペットに示すように、System.List
コンポーネントを使用して、プリミティブとして(ダイアログ・フロー・テンプレートのgreeting: "string"
など)またはエンティティとして定義されているコンテキスト変数を満たす値を返すことができます。このダイアログ・フローでは、options: "Thick,Thin,Stuffed,Pan"
定義により、crust
変数と一致する値が返されます。sizeに対して定義されたoptions
プロパティは、オプションとしてLarge、Medium、SmallおよびPersonalリスト値を返す値式(${size.type.enumValues}
)です。Apache FreeMarker Template Languageの構文を参照してください。
nlpResultVariable
プロパティのiResult
定義により、コンポーネントでcrust
状態およびsize
状態のvariable
プロパティのエンティティ値を設定する方法も示しています(これらの値が以前に設定されていない場合)。Text
コンポーネントと同様に、System.List
コンポーネントには遷移は必要ありません。
main: true
name: "PizzaBot"
...
context:
variables:
size: "PizzaSize"
crust: "PizzaCrust"
iResult: "nlpresult"
...
states:
...
crust:
component: "System.List"
properties:
options: "Thick,Thin,Stuffed,Pan"
prompt: "What crust do you want for your pizza?"
variable: "crust"
main: true
name: "PizzaBot"
...
context:
variables:
size: "PizzaSize"
crust: "PizzaCrust"
iResult: "nlpresult"
...
states:
...
crust:
component: "System.List"
properties:
options: "Thick,Thin,Stuffed,Pan"
prompt: "What crust do you want for your pizza?"
variable: "crust"
nlpResultVariable: "iresult"
transitions:
next: "size"
size:
component: "System.List"
properties:
options: "${size.type.enumValues}"
prompt: "What size Pizza do you want?"
variable: "size"
nlpResultVariable: "iresult"
transitions:
...

ユーザーは、リストに表示されているオプションに制限されません。エンティティで認識される単語(シノニムなど)を入力することで、エンティティを解決できます。たとえば、ユーザーはリスト内のピザ・サイズのオプションの中から選択するかわりに、big (
PizzaSize
エンティティのLargeオプションに対して定義されているシノニム)を入力できます。カスタム・エンティティを参照してください。
optionsプロパティ
options
プロパティは、次のいずれかを使用して設定できます:
-
マップのリスト—optionsプロパティはテキスト文字列または値式として設定できますが、
options
プロパティをマップのリストとして構成することもできます。それぞれにlabel
プロパティ、value
プロパティおよびオプションのkeyword
プロパティがあります。この方法に従うと、次の例に示すようにリソース・バンドルを参照できるため、リスト・オプションをローカライズできます。ドット表記法の使用の詳細は、スキルのリソース・バンドルを参照してください。keyword
プロパティで指定された値のいずれかと一致する値をユーザーが入力すると、ボットはユーザーがリスト・オプション自体をタップした場合と同じように反応します。askPizzaSize: component: "System.List" properties: prompt: What size do you want?" options: - value: "small" label: "${rb.pizza_size_small}" keyword: "1" - value: "medium" label: "${rb.pizza_size_medium}" keyword: "2" - value: "large" label: "${rb.pizza_size_large}" keyword: "3" variable: "pizzaSize"
-
カンマ区切りのオプションのテキスト文字列(次のスニペットの
"small, medium, large"
など)。options
を文字列として定義した場合、label
およびvalue
プロパティは追加できません。askPizzaSize: component: "System.List" properties: prompt: "What size do you want?" options: "small, medium, large" variable: "pizzaSize"
-
文字列のリストまたはマップのリストをループするApache FreeMarker値式。各マップには
label
とvalue
の両方のプロパティと、オプションでkeyword
プロパティが含まれている必要があります。askPizzaSize: component: "System.List" properties: prompt: "What size do you want?" options: "${pizzaSize.value.enumValues}" variable: "pizzaSize"
アクション・リスト
System.Switch
コンポーネントを使用するかわりに、アクション・リストを使用できます。System.List
のオプションのvariable
およびnlpResultVariable
プロパティは、ユーザー入力に基づいてリスト表示動作および後続の遷移を設定します。
- これらのプロパティを構成しない場合、遷移アクションはスキル・ユーザーが選択したオプションに基づきます:
showMenu: component: "System.List" properties: prompt: "Hello, this is our menu today" options: - value: "pasta" label: "Pasta" - value: "pizza" label: "Pizza" transitions: actions: pasta: "orderPasta" pizza: "orderPizza"
variable
およびnlpResultVariable
プロパティを追加する場合、ユーザーの入力が一致するとリスト表示はバイパスされます。次のスニペットでは、nlpResultVariable
によって、I want to order a large pizzaなどのユーザー入力からsize
変数が設定されると、オプションのリストがバイパスされます。次に、値に適した遷移がトリガーされます。getPizzaSize: component: "System.List" properties: prompt: "What size of pizza" variable: "size" nlpResultVariable: "iResult" options: - label: "Small" value: "Small" - label: "Large" value: "Large" transitions: actions: Large: "Large" Small: "Small"
System.Output
System.Output
コンポーネントを使用して、ユーザー・レスポンスを必要としないメッセージを出力するか、スキルによるユーザーのレスポンスの処理を必要としないメッセージを出力します。
このコンポーネントは非推奨であり、使用可能なテンプレートはもうありません。かわりに、「コンポーネントの追加」ダイアログの「ユーザー・メッセージング」セクションで提供される
System.CommonResponse
に基づいて、多数のテンプレートのいずれかを使用できます。
プロパティ | 説明 | 必須? |
---|---|---|
text |
テキスト文字列 | はい – このフィールドには値が必要です。 |
keepTurn |
ダイアログ・フローのスキルの制御を放棄(false )または保持(true )するためのブール値。ユーザーからの介入を受け入れずに一連のスキル・メッセージをそのまま出力する場合は、keepTurn: true を使用します。
|
いいえ |
translate |
このプロパティを使用して、autotranslate コンテキスト変数に対して設定したブール値をオーバーライドします。この変数を設定していない場合、またはfalse に設定した場合、このプロパティをtrue に設定して、このコンポーネントに対してのみ自動翻訳を有効にすることができます。autotranslation 変数をtrue に設定した場合、このプロパティをfalse に設定して、このコンポーネントを自動翻訳から除外できます。スキルでの翻訳サービスを参照してください。
|
いいえ |
System.Outputコンポーネントの使用方法
System.Output
コンポーネントには、text
プロパティの文字列定義が必要です。次の確認メッセージの例に示すように、この文字列に値式を追加できます。done:
component: "System.Output"
properties:
text: "Your ${size.value}, ${type.value} pizza with ${crust.value} crust is on its way. Thank you for your order."
デフォルトでは、ダイアログ・エンジンはスキルから文を出力した後、ユーザー入力を待機します。この動作をオーバーライドする場合は、オプションのkeepTurn
プロパティを追加し、それをtrue
に設定して、transitions
プロパティで定義されている次の状態にダイアログ・エンジンを移行させます。定義されている遷移がない場合、ダイアログ・エンジンは次の順序の状態に移行します。
wait:
component: "System.Output"
properties:
text: "Please wait, we're reviewing your order"
keepTurn: true
transitions:
next: "ready"
waitmore:
component: "System.Output"
properties:
text: "Almost done..."
keepTurn: true
transitions:
next: "done"
done:
component: "System.Output"
properties:
text: "Your ${size.value}, ${type.value} pizza with ${crust.value} crust is on its way. Thank you for your order."
transitions:
return: "done"
System.Outputコンポーネントの値式の定義
text
プロパティに1つ以上の値式を定義できます。たとえば、次のスニペットでは、オーダー確認用のテキスト(ピザのsizeとtype)を出力するために異なる式を使用します。confirmation:
component: "System.Output"
properties:
text: "Your ${size.value} ${type.value} pizza is on its way."
transitions:
return: "done"
各式は常に値を返す必要があります。式が1つでもnull値を返すと、スキルは文字列の式ごとに未加工のテキストを出力するため、ユーザーには次のように表示されます: Your ${size.value} ${type.value} is on its way.
これは、すべてか、なしかのいずれかです。ユーザーが理解できるテキストがスキルによって常に出力されるようにするには、Apache Freemarkerのデフォルトの値演算子を使用してnull値のかわりにデフォルト値を使用します: ${size.value!\”piping\”} ${type.value!\”hot\”}
。二重引用符は、デフォルト値が変数参照ではなく、演算子で予期される定数値であることを示します。例:text: "Your ${size.value!\"piping\"} ${type.value!\"hot\"} pizza is on its way."
Freemarkerの演算子を使用するときは、デフォルト値を囲む引用符を常にエスケープしてください(
\"...\"
)。デフォルト値演算を定義するたびに、または出力テキストを二重引用符で区切るたびに、このエスケープ・シーケンスを使用しないと、ダイアログ・フローのOBotML構文は有効になりません。たとえば、次のSystem.Output
コンポーネント定義では、ユーザーにYou said, “Cancel this order.”というメッセージが表示されます。confirmCancel:
component: "System.Output"
properties:
text: "You said, \"Cancel this order.\""
transitions:
return: "cancelOrder"
出力テキストの翻訳
translate
プロパティを使用して、System.Output
コンポーネントの自動翻訳済テキストをコンポーネントごとに抑制または有効化できます。次のスニペットのようにfalse
に設定すると、コンポーネントによってテキストは翻訳されずにそのまま出力されます。このプロパティをtrue
に設定することで、autoTranslate
変数がfalse
に設定されているか定義されていない場合に、自動翻訳を有効にすることができます。スキルでの翻訳サービスを参照してください。
通常、リソース・バンドルを使用してテキストを翻訳する場合は、
autoTranslate
変数をtrue
に設定しません。この方法はお薦めしません。
setAutoTranslate:
component: "System.SetVariable"
properties:
variable: "autoTranslate"
value: "true"
transitions:
...
...
pizzaType:
component: "System.Output"
properties:
text: "What type of pizza do you want?"
translate: false
transitions:
...