ユーザー・インタフェースのコンポーネント

これらは、YAMLベースのダイアログ・フロー・エディタのユーザー・インタフェース・カテゴリで使用可能なコンポーネントです。

テキストの表示およびユーザーとのインタフェースのために、これらのコンポーネントを使用します:

System.CommonResponse

System.CommonResponseコンポーネントを使用すると、イメージやアクション・ボタンを含むカード・カルーセルや、表と入力フィールドを含むフォームなどの豊富なUI機能を持つメッセージを作成できます。

ノート

このトピックでは、このコンポーネントをYAMLモードで使用する方法について説明します。ビジュアル・フロー・デザイナでの使用方法の詳細は、「一般的なレスポンス・コンポーネント・テンプレート」を参照してください。

System.CommonResponseのテンプレートは、「コンポーネントの追加」ダイアログの「ユーザー・メッセージング」セクションで使用できます。

このコンポーネントに基づいてメッセージを作成する方法は、スキルのダイアログ・モードによって異なります。YAMLモードでは、OBotMLコンポーネント状態テンプレートを編集します。プロセスはビジュアル・モードで簡略化され、「共通レスポンス」コンポーネントベースのユーザー・メッセージング・テンプレートのプロパティ・ウィンドウでフィールドとレスポンス・アイテムのメタデータを更新するだけで、これらのリッチUIメッセージを作成できます。YAMLベースのスキルの場合、CrcPizzaBot (サンプル・ボットのうちの1つ)で、System.CommonResponseコンポーネントを使用する例を確認できます。PizzaBotのこのスピンでは、クイック・アクション「今すぐオーダー」ボタンがあるイメージが豊富なメニューを表示できます。 System.CommonResponseコンポーネントのコンテキストでは、様々なタイプのメッセージはレスポンス・タイプと呼ばれ、CrcPizzaBotでは、特に、ボット・ユーザーがどのようにアクション・ボタンを使用してプロンプトに応答し、ピザのメニューを一連のカード・アイテムとして表示できるかが示されています。

「コンポーネントの追加」メニューから、カード、テキスト、アタッチメント・レスポンスおよび(CbPizzaBotで示されている)コンポジット・バッグ・エンティティ用の様々なSystem.CommonResponseテンプレートを選択できます。これらのテンプレートには、これらのレスポンス・タイプすべてに共通のプロパティと個々のレスポンス・タイプに固有のプロパティの両方が含まれています。「コンポーネントの追加」メニューでは、レスポンス・タイプごとに個別の状態が追加されますが、1つ以上のレスポンス・タイプを1つの状態に結合できます。CrcPizzaBotでは、ShowMenu (テキスト・レスポンス)状態とOrderPizza (テキスト・レスポンスおよびカード・レスポンス)状態で、両方の例が示されています。

ノート

開発サイクルの早期にターゲット・チャネル内の各スキルをテストして、コンポーネントが目的どおりにレンダリングされることを確認する必要があります。

コンポーネントのプロパティ

System.CommonResponseコンポーネントの構成には、ダイアログ・エンジンに指示するプロパティと、コンポーネントによるメッセージの配信方法(テキスト・プロンプト、カードまたは添付として)のみでなく、メッセージ自体の内容および動作も設定するメタデータ・プロパティの設定が必要です。

名前 説明 必須?
metadata このコンポーネントで作成されるチャット・レスポンスは、metadataプロパティのコンテンツによって制御されます。「共通のレスポンス・コンポーネントのmetadataプロパティ」を参照してください。 はい
processUserMessage ユーザーがテキストを入力するかボタンをタップした後に状態に戻るようダイアログ・エンジンに指示するには、このプロパティをtrueに設定します。ユーザー入力が必要ではない(または予期されない)場合は、このプロパティをfalseに設定します。

ロケーションを設定するときは、このプロパティをtrueに設定します。

はい
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オブジェクトとして格納されます(組込みエンティティ値のようになります)。これで、valueprimaryLanguageValueoriginalStringなどのプロパティにアクセスするための式を作成できます。これは、現在複数言語である(またはいずれ複数言語になる可能性がある)スキルにとって特に重要です。 いいえ
maxPrompts System.CommonResponseコンポーネントでは、ユーザーが入力したテキストから、variableプロパティに対して指定した変数値への移入の前に、変数タイプに対して値が検証されます。これは、エンティティ・タイプの検証であるか、またはプリミティブ型の場合には、プリミティブ型に強制変換できる値です。

コンポーネントで値を検証できない場合、ダイアログ・エンジンはメッセージ・テキストおよびオプションを再度送信します。(このメッセージは、検証の失敗を反映するように変更できます。)ユーザーが有効な値を入力できないことが続いて無限ループになることを避けるには、このプロパティを使用して、ユーザーに与えられる試行回数に制限を設定します。ユーザーがこの割当てを超えると、System.CommonResponseコンポーネントはcancelアクションに遷移します。ユーザー・プロンプト数の制限を参照してください。

コンポジット・バッグ・エンティティの作成で説明されているように、「最大ユーザー入力試行回数」オプションが設定されている場合は、コンポジット・バッグ内の個々のエンティティはこの設定をオーバーライドできます。

いいえ
keepTurn keepTurnプロパティは、processUserMessageプロパティをfalseに設定した場合にのみ適用されます。このプロパティの設定方法は、System.Outputを参照してください。 いいえ
translate このプロパティを使用して、autotranslateコンテキスト変数に対して設定したブール値をオーバーライドします。この変数を設定していない場合、またはfalseに設定した場合、このプロパティをtrueに設定して、このコンポーネントに対してのみ自動翻訳を有効にすることができます。autotranslation変数をtrueに設定した場合、このプロパティをfalseに設定して、このコンポーネントを自動翻訳から除外できます。スキルでの翻訳サービスを参照してください。 いいえ
footerText テキストのみのチャネルでの出力を拡張します。フッターで説明されているように、FreeMarker式を使用して、テキストのみのチャネルのフッター・テキストに条件を設定できます。 いいえ
transitionAfterMatch (非推奨) ブール。これをtrueに設定すると、このコンポーネントによって実行されるエンティティ一致から別の状態への一時的な遷移が可能になります。このプロパティはサポートされていません。この機能を取得するには、エンティティ・イベント・ハンドラを使用します いいえ
cancelPolicy cancel遷移のタイミングを決定します:
  • immediate—バッグ・アイテムの「最大ユーザー入力試行回数」に対して設定された値に達した直後。この値が設定されていない場合、コンポーネント全体のmaxPrompts値に達したときに、コンポーネントによってこの遷移が起動されます。

  • lastEntity—バッグ内の最後のエンティティが値と一致したとき。

エンティティ・イベント・ハンドラを項目レベルまたはイベント・レベルの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

ノート

このトピックでは、このコンポーネントをYAMLモードで使用する方法について説明します。ビジュアル・フロー・デザイナでの使用方法の詳細は、「Webビュー・コンポーネント」を参照してください。

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チャネルでのユーザー入力を可能にします。
  • false—グローバルなautoNumberPostbackActions変数をオーバーライドします。

  • true

    取消しボタンの先頭に連番を付けます。これが入力されると、ユーザーが番号に相当するものを入力したのではなくボタンをタップしたかのように、ボタンのポストバック・ペイロードが実行されます。
いいえ
translate このプロパティを使用して、autotranslateコンテキスト変数に対して設定したブール値をオーバーライドします。この変数を設定していない場合、またはfalseに設定した場合、このプロパティをtrueに設定して、このコンポーネントに対してのみ自動翻訳を有効にすることができます。autotranslation変数をtrueに設定した場合、このプロパティをfalseに設定して、このコンポーネントを自動翻訳から除外できます。スキルでの翻訳サービスを参照してください。 いいえ

System.Webviewコンポーネントの遷移

トランザクション 説明
next Webアプリケーションからの正常なコールバック後のダイアログ・フロー内の次の状態を指定します。
return Webアプリケーションからの正常なコールバック後に会話を終了します。
error エラーを処理する状態を指定します。
actions
  • cancel—ユーザーが取消しをタップするシナリオを処理する状態を指定します。
  • textReceived—ユーザーがいずれかのボタンをタップするのではなく、テキストを入力したときの状態を指定します。

System.IncidentCreation

System.IncidentCreationコンポーネントを使用して、カスタマ・サービス・サイトにインシデントを作成できます。インスタンスでこのコンポーネントを使用するには、「設定」→「追加サービス」→「カスタマ・サービス統合」ページからカスタマ・サービス統合を作成する必要があります。

ノート

このトピックでは、このコンポーネントをYAMLモードで使用する方法について説明します。ビジュアル・フロー・デザイナでの使用方法の詳細は、インシデントの作成を参照してください。

次の例では、このコンポーネントを使用して会話を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を含めることができます。

emailを指定しない場合は、firstNamelastNameの両方を指定する必要があります。

Oracle B2C Serviceの場合のみ
incidentNumberVariable インシデント番号を格納する文字列コンテキスト変数の名前。 いいえ

System.IntelligentAdvisor

このコンポーネントを使用して、スキルからOracle Intelligent Advisorインタビューにアクセスします。

ノート

このトピックでは、このコンポーネントをYAMLモードで使用する方法について説明します。ビジュアル・フロー・デザイナでの使用方法の詳細は、インテリジェント・アドバイザを参照してください。

このコンポーネントを使用する前に、インテリジェント・アドバイザ・サービス統合を作成する必要があります。インテリジェント・アドバイザ・サービスの追加を参照してください。また、インタビューがインテリジェント・アドバイザ・ハブにデプロイされ、チャット・サービス・チャネルでアクティブ化されている必要があります。インタビューは匿名ユーザー向けである必要があります。ポータル・ユーザーまたはエージェント・ユーザーのインタビューにはアクセスできません。

コンポーネントのプロパティを使用して、次のインタビュー設定を指定できます:

  • タイトルと説明を表示するかどうか
  • 肯定、否定、不確実のボタンのラベル
  • リセット、前の質問に戻る(元に戻す)、インタビューの終了のために、ユーザーが入力する文字列
  • インタビューの終了時に表示するテキスト
  • 説明を表示するかどうかという質問を表現する方法
  • ファイルのアップロードが完了したことを示すためにユーザーが入力する文字列
  • インタビューに渡す属性値とコネクタ・パラメータ
  • 使用するプロジェクトロケール

次の例は、次のとおりです:

  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 - <property name>キーのメッセージを変更します。スキルのリソース・バンドルを使用してデフォルトを変更する場合は、コンポーネントにラベル・プロパティを含める必要はありません(デフォルトをオーバーライドする場合を除きます)。

構成リソース・バンドルでは、IntelligentAdvisor - defaultValueIntelligentAdvisor - doneHelpIntelligentAdvisor - maskLabelIntelligentAdvisor - outOfOrderMessageIntelligentAdvisor - resumeSessionPromptIntelligentAdvisor - numberMinMaxIntelligentAdvisor - outOfOrderMessageIntelligentAdvisor - resumeSessionPromptIntelligentAdvisor - 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 ファイルのアップロードが完了したことを示すためにユーザーが入力するテキスト。

デフォルトは/doneです。

いいえ
endLabel インタビューの終了時にチャットに表示するテキスト。

デフォルトはInterview endedです。このプロパティを""に設定すると、テキストが表示されないようにできます。

いいえ
exitLabel インタビューを終了することを示すためにユーザーが入力するテキスト。

デフォルトは/exitです。

いいえ
explanationAskLabel showExplanationaskに設定されている場合に尋ねる質問。

デフォルトはDo you want to see the explanation?です。

いいえ
hideScreenTitle インタビューの画面タイトルをすべて非表示にするかどうかを示します。

デフォルトはfalseで、画面タイトルを表示する必要があることを意味します。

いいえ
intelligentAdvisorService 「設定」→「追加サービス」で構成されたインテリジェント・アドバイザ・サービスの名前。 はい
interviewAttributes インタビューの属性値を格納する文字列型のコンテキスト変数の名前。属性値は、キーと値のペアの配列として格納されます。 いいえ
locale

このプロパティは、ターゲットのインタビューと日付および数値の解決の両方に影響します。

コンポーネントは、コンポーネントのlocaleプロパティで指定された言語に関連付けられている名前付きインタビュー(デプロイメント)のバージョンを開始します。指定したロケールにハブ・デプロイメントがない場合、コンポーネントはデプロイメントに関連付けられているデフォルト・ロケールを使用します。

日付および数値入力の場合、値はDATEおよびNUMBERエンティティ設定に従って解決されます。エンティティの「エンド・ユーザー・ロケールの検討」を「オン」に切り替えると、このプロパティで指定されたロケール(または指定されていない場合はデフォルト)の値が解決されます。ロケールベースのエンティティ解決を参照してください。

このプロパティのデフォルト値はprofile.localeです。profile.localeに値がない場合、チャネルのロケールが使用されます。

いいえ
noLabel ブールのFALSE値を表すために使用するラベル。

デフォルトは「いいえ」です。

いいえ
params インタビューの開始時に渡されるキー/値接続パラメータのマップ。これは通常、外部データ統合とのインタビューに必要です。 いいえ
removeHtml テキストからHTMLマークアップを削除するかどうかを示します。デフォルトはfalseです。 いいえ
resetLabel 最初の質問に戻ることを示すためにユーザーが入力するテキスト。

デフォルトは/resetです。

いいえ
seedData インタビューに渡すインテリジェント・アドバイザの属性名と値のマップ。日付や時刻の属性には、インテリジェント・アドバイザの標準の日付と時刻の書式を使用します。例: start_date: "2010-01-31"

値を渡す属性では、ポリシー・モデリングで「URLパラメータからのシード」オプションが有効になっている必要があります。

いいえ
showExplanation インテリジェント・アドバイザの説明を表示するかどうかを指定します。指定できる値は、neveralwaysおよびaskです。

askに設定した場合は、explanationAskLabelプロパティを使用して、説明を見るかどうかをユーザーに尋ねるテキストを指定します。

デフォルトはneverです。

いいえ
uncertainLabel 値がわからない場合にユーザーが入力できるラベル。このラベルは、オプションのブール・ラジオ・ボタンに表示されます。

デフォルトはUncertainです。

いいえ
undoLabel 直前の質問に戻ることを示すためにユーザーが入力するテキスト。

デフォルトは/backです。

いいえ
yesLabel ブールのTRUE値を表すために使用するラベル。

デフォルトはYesです。

いいえ

例: スキルにおけるインテリジェント・アドバイザ・コンポーネントの使用

  ####################    
  # 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

ノート

このトピックでは、このコンポーネントをYAMLモードで使用する方法について説明します。ビジュアル・フロー・デザイナでの使用方法の詳細は、ナレッジ検索を参照してください。

このコンポーネントを使用して、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"  

ヒント:

defaultAttachmentLabelnoResultTextおよびresultLinkLabelプロパティのデフォルト値は、スキルのリソース・バンドルに格納されます。デフォルトを変更するには、スキルの「リソース・バンドル」ページを開き、「リソース・バンドル」アイコンをクリックして「構成」タブを選択し、KnowledgeSearch - <property name>キーのメッセージを変更します。スキルのリソース・バンドルを使用してデフォルトを変更する場合は、コンポーネントにプロパティを含める必要はありません(デフォルトをオーバーライドする場合を除きます)。
プロパティ 説明 必須?
cardLayout 結果カードを垂直方向と水平方向のどちらで表示するかを指定します。デフォルトはhorizontalです。 いいえ
customFilters 名前と値のペアとして表示される検索結果フィルタのリスト。使用可能なフィルタ名は、productおよびcategoryです。それぞれが、1つのフィルタ宣言のみを許可します。「製品およびカテゴリ別の結果のフィルタ」を参照してください。 いいえ
customProperties Oracle B2C Serviceのみ: 検索サービスに送信するキー/値ペアのマップ。現在、このプロパティはword_connectorキーのみをサポートしています。word_connectorプロパティをANDに設定して、検索語のすべての単語の前に+を付加します。 いいえ
defaultAttachmentLabel

アタッチメントに表示名が構成されていないときに常にアタッチメントにリンクされた結果カードのURLアクションに使用するデフォルトのラベル。使用される場合は、索引番号が付加されます。たとえば、2番目のアタッチメントに表示名がない場合、デフォルトのアタッチメント・ラベルに2が付加されます。

デフォルトは、Downloadです。

いいえ
locale デフォルトは、profile.locale変数の値です。

Oracle B2C Serviceマルチインタフェース・ナレッジ統合サービスの場合、検索の実行に使用するインタフェースを指定する5文字のISOまたはBCPロケール・コード(例: en_GB)。ロケールをサポートするインタフェースがない場合は、デフォルトのインタフェースが使用されます。多言語ナレッジ検索の実装を参照してください。

Oracle Fusion Serviceの場合、指定したロケールに関連付けられている記事をフェッチします。一致する記事がロケールに存在しない場合、noResultが返されます。

いいえ
noResultText

使用可能な検索結果がない場合に出力するテキスト。

デフォルトは、KnowledgeSearch - noResultTextリソース・バンドル・エントリのテキストです。

いいえ
resultLinkLabel

Webバージョンの情報にリンクする結果カードのURLアクション(ボタン)に使用するラベル。

デフォルトは、KnowledgeSearch - resultLinkLabelリソース・バンドル・エントリのテキストです。

このプロパティを${r""}に設定すると、結果リンク・ボタンは表示されず、全文が出力されます。これは、通常サイズのスキル・ウィジェットで読みにくい記事が非常に長い場合はお薦めしません。

いいえ
resultSizeLimit

表示する最大結果数。

デフォルトは10です。

いいえ
resultVersion

Oracle B2C Serviceのみ: 結果に複数のバージョンがある場合に返す優先バージョン。

このプロパティをAnswerまたはSpecial Responseのいずれかに設定できます。

特別なレスポンスを利用すると、Webページではなく、チャット会話専用に調整された出力を表示できます。

デフォルトのバージョンはAnswerです。デフォルトは、新しいリリースで変更される可能性があります。

いいえ
resultVersionExclusive

Oracle B2C Serviceのみ: 優先バージョンで使用可能な結果のみを表示するかどうかを指定します。

falseの場合は、まず、優先バージョン(resultVersion)のすべての一致回答を含めます。含まれる回答数が制限未満の場合は、制限に達するまで優先バージョン以外の回答を含めます。

デフォルトはfalseです。

いいえ
searchLinkLabel

Oracle B2C Service: 完全検索結果リストが掲載されているWebページにリンクされたカード・メッセージ・ペイロード・アクションに使用するラベル。

Oracle Fusion Service: ホーム検索ページにリンクされているカード・メッセージ・ペイロード処理に使用するラベル。

このプロパティが設定されていない場合、カード・メッセージ・ペイロードにアクションは表示されません。

いいえ
searchPrelude

検索結果が表示される前に出力するテキスト。

このプロパティが設定されていない場合、KnowledgeSearch - searchPreludeリソース・バンドル・エントリのテキストが出力されます。

検索のプリロードを表示しない場合は、このプロパティを${r""}に設定します。

いいえ
searchServiceName 「設定」で構成されたナレッジ検索統合の名前。 はい
searchTerm ナレッジ検索起動の検索語として使用するテキスト。Oracle Fusion Service Knowledge Managementには検索語が必要です。Oracle B2C Service Knowledge Foundationでは、検索語が指定されていない場合、最も人気のある記事が返されます。

検索用語の手法は、ナレッジ検索コンポーネントの使用を参照してください。

はい

System.KnowledgeSearchの遷移

アクション 説明
resultSent 検索で結果が少なくとも1つ返されました。
noResult 検索語の結果がありませんでした。
serverError サーバー・エラー障害や予期しないエラー障害など、起動中にナレッジ検索サービスのサーバーでエラーが発生しました。

このエラーが発生すると、エラー・メッセージはsystem.state.<state-name>.serverError.messageに格納されます。

例: YAMLダイアログ・フローでの関連質問と検索語の関連付け

次の図に、ダイアログ・フローがYAMLモードで作成されている場合の単一状態メソッドの実装方法を示します。1)マップ・コンテキスト変数を使用して、ナレッジ・インテントを検索語に関連付けます。2)各ナレッジ・インテントを設定しますIntent状態のアクション。マップを使用してsearchTermコンテキスト変数をインテントの検索語に設定するデータ・フローに遷移します。3)次に、searchTerm値をナレッジ・ベースで検索する状態に遷移します。

kf-assoc-intent-with-term.pngの説明が続きます
図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コンポーネントを使用して、会話をチャット・サービスに戻します。会話は、チャット・サービスで構成されているチャット・ルールによってライブ・エージェントにルーティングされます。

ノート

このトピックでは、このコンポーネントをYAMLモードで使用する方法について説明します。ビジュアル・フロー・デザイナでの使用方法の詳細は、エージェント転送を参照してください。

このコンポーネントは、デジタル・アシスタント(エージェント)のフレームワークの動作で説明されているように、サービスのチャットで発生した会話用です。スキルで発生した会話の場合は、かわりに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以降のスキルでは、acceptedMessageerrorMessagerejectedMessageおよびwaitingMessageプロパティのデフォルト値はスキルのリソース・バンドルに格納されます。デフォルトを変更するには、スキルの「リソース・バンドル」ページを開き、「リソース・バンドル」アイコンをクリックして「構成」タブを選択し、AgentTransfer - <property name>キーのメッセージを変更します。スキルのリソース・バンドルを使用してデフォルト・メッセージを変更する場合は、コンポーネントにメッセージ・プロパティを含める必要はありません(デフォルトをオーバーライドする場合を除きます)。
プロパティ 説明 必須?
agentStatusVariable エージェント可用性ステータス情報の格納に使用する、タイプ・マップのコンテキスト変数の名前。プロパティが指定されていない場合、情報は格納されません。マップ変数を参照するには、${<mapVariableName>.value.<key>}のような値式を使用します。たとえば、agentStatus.value.expectedWaitMinutesです。

この変数で返される値について学習するには、System.AgentTransferConditionを参照してください。

いいえ
allowTransferIf スキルがチャット・セッションを転送する条件を指定します。
  • agentsAreRequestingNewEngagements: (デフォルト)チャットをプルする(新しいエンゲージメントをリクエストする)必要があるOracle B2C Serviceエージェントにとって、これは最も限定的な条件セットです。ユーザーはあまり待たずにエージェントと話すことができます。スキルが会話を転送しようとするのは、新しいエンゲージメントをリクエストしたエージェントが存在する場合のみです。他のすべてのケースで、このオプションの動作はagentSessionsAreAvailableと同じです。新しいエンゲージメントをリクエストしているOracle Fusion Serviceエージェントの合計は常に0であるため、このオプションforOracle Fusionサービス・チャットを使用しないでください。
  • agentSessionsAreAvailable: スキルは、使用可能なエージェントのいずれかが一度に保持できるチャットの最大数に達していない場合、会話を転送しようとします。エージェントが長時間実行中の会話に関与している場合またはチャット後のフォローアップを実行している場合、ユーザーは待機が必要になる場合があります。
  • agentsAreAvailable: スキルは、チャットの最大数に達しているか、新しいエンゲージメントをリクエストしているかに関係なく、オンラインのエージェントがいる場合、会話を転送しようとします。このオプションでは、ユーザーが長時間待機する可能性があります。

指定した条件が満たされない場合、rejectedアクションが発生します。

いいえ
customProperties サービスに渡す情報を保持するマップ。サービスへの情報の受渡しを参照してください。 いいえ
errorMessage エージェントへのチャット・セッションの転送中にシステム・エラーが発生したときにユーザーに表示されるメッセージ。デフォルトは、「システム・エラーのため転送できません」です。このプロパティを空白または空の文字列に設定して、メッセージ出力を抑制できます。 いいえ
maxEngagementsInQueue 宛先キューで待機するエンゲージメントの最大許容数。チャット・リクエストが送信されると、チャット・サービスは、キュー内で待機している現在のエンゲージメント数を使用して応答します。この値がmaxEngagementsInQueueを超えると、rejectedアクションが発生します。デフォルトは-1で、エンゲージメントの制限がないことを意味します。

Oracle Fusion Service Chatの場合、レスポンスは常に0であるため、このプロパティはOracle Fusion Serviceの値ではありません。

いいえ
maxWaitSeconds 許容される予測待機秒数の最大値。チャット・サービスは、転送リクエストを受け取ると、予測待機時間を使用して応答します。この値がmaxWaitSecondsを超えると、rejectedアクションが発生します。このプロパティのデフォルトは-1であり、これは最大待機時間がないことを意味します。-1に設定されていると、予測待機時間に関係なく、デジタル・アシスタントはユーザーを人間のエージェントに転送します。

rejectedアクションは、実績待機時間ではなく、予測待機時間に基づくことに注意してください。会話の転送後は、デジタル・アシスタントは会話を制御できず、会話に関する情報にもアクセスできません。したがって、実績待機時間が予測待機時間を超えることがあります。

いいえ
rejectedMessage 次のいずれかが発生した場合に常にユーザーに表示されるメッセージ:
  • allowTransferIf条件が満たされていなかった。
  • 予測待機時間がmaxWaitSecondsを超える。
  • キュー内のエンゲージメント数がmaxEngagementsInQueueを超えています。
デフォルトはAgent rejectedです。このプロパティを空白または空の文字列に設定して、メッセージ出力を抑制できます。
いいえ
waitingMessage ユーザーがキューに転送されたときにユーザーに表示されるメッセージ。デフォルトは、「エージェント・チャット・セッションが確立されました。エージェントの参加を待機中」です。このプロパティを空白または空の文字列に設定して、メッセージ出力を抑制できます。 いいえ

このコンポーネントは、次のアクションを返すことができます:

アクション 説明
accepted accepted遷移は、チャットがキューに正常に転送されたときに設定されます。

チャット・リクエストが受け入れられた後は、会話はreturnで終了する必要があることに注意してください。たとえば、(ユーザーには表示されない)文字列を出力する状態にナビゲートしたり、変数を設定できます。

    transitions:
      actions:
        accepted: "reset"
        rejected: "handleRejected"
        error: "offerMoreHelp"
      next: "reset"
rejected rejected遷移は、次のいずれかが発生したときに設定されます:
  • allowTransferIf条件が満たされていなかった。
  • 予測待機時間がmaxWaitSecondsを超える
  • キュー内のエンゲージメント数がmaxEngagementsInQueueを超えています。
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_cYに設定されています。ルールは、このカスタム・プロパティを使用して、Yに設定されている場合に会話がデジタル・アシスタント・エージェントにルーティングされないようにできます。(Oracle B2C Serviceでは、「状態を移行して停止」構成によってルーティングが決まります。)

System.AgentTransferCondition

DA-as-agentデジタル・アシスタントでSystem.AgentTransferConditionコンポーネントを使用して、エージェントが使用可能かどうか、および可能であれば予想される待機時間を判断できます。

ノート

このトピックでは、このコンポーネントをYAMLモードで使用する方法について説明します。ビジュアル・フロー・デザイナでの使用方法の詳細は、エージェント転送条件を参照してください。

コンポーネントのプロパティを使用して転送条件を指定し、条件が満たされたかどうかを示すアクションを返します。また、名前付きコンテキスト・マップ変数の値を次のように設定します。

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 満たす必要がある条件の基本セットを指定します。
  • agentsAreRequestingNewEngagements: (デフォルト)チャットをプル(新しいエンゲージメントをリクエスト)する必要があるB2Cエージェントの場合、エージェントがチャットをプルする必要があります。他のすべてのケースで、このオプションの動作はagentSessionsAreAvailableと同じです。
  • agentSessionsAreAvailable:エージェントがチャットをリクエストしていることが必要です。
  • agentsAreAvailable:チャットの最大数に達したか、新しいエンゲージメントをリクエストしているかにかかわらず、少なくとも1つのエージェントがアクティブである必要があります。

指定した条件が一致しない場合、conditionsNotMetアクションが発生します。

いいえ
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であり、これは最大待機時間がないことを意味します。

conditionsNotMetアクションは、実績待機時間ではなく、見積待機時間に基づくことに注意してください。

いいえ

このコンポーネントは、次のアクションを返すことができます:

アクション 説明
conditionsMet conditionsMet遷移は、営業時間内であり、maxWaitSecondsmaxEngagementsInQueueおよびallowTransferIf条件が満たされた場合に設定されます。
conditionsNotMet conditionsNotMet遷移は、次のいずれかが発生したときに設定されます:
  • 営業時間外です。
  • allowTransferIf条件が満たされていなかった。
  • 予測待機時間がmaxWaitSecondsを超える
  • キュー内のエンゲージメント数がmaxEngagementsInQueueを超えています。
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以降のスキルでは、agentActionsMessageerrorMessagerejectedMessageresumedMessageおよびwaitingMessageプロパティのデフォルト値はスキルのリソース・バンドルに格納されます。デフォルトを変更するには、スキルの「リソース・バンドル」ページを開き、「リソース・バンドル」アイコンをクリックして「構成」タブを選択し、AgentInitiation - <property name>キーのメッセージを変更します。スキルのリソース・バンドルを使用してデフォルト・メッセージを変更する場合は、コンポーネントにメッセージ・プロパティを含める必要はありません(デフォルトをオーバーライドする場合を除きます)。
プロパティ 説明 必須?
agentActions チャットを終了してフローを遷移アクションに定義された状態に移動させるために、エージェントがトリガーできるアクションのリスト。顧客サービス担当のコンソールでは、次の例に示すように、エージェントの会話が開始されるときにスラッシュ・コマンドとしてこれらのアクションが表示されます:
Here are the available actions that you can send to transfer the conversation
back to the bot. Prepend the action with a forward slash (for example, /actionName).
/OrderPizza : Order Pizza : Order a pizza.
/ShowMenu : Show Menu : Show order options.

アクション名は、System.AgentConversationactionsプロパティに対応している必要があります。たとえば、次のagentInitiation状態では、agentActionsプロパティのShowMenuおよびOrderPizzaエントリは、agentConversation状態に対して定義されているアクションに対応します:

  agentInitiation:
    component: "System.AgentInitiation"
    ...
    properties:
      agentChannel: "ServiceCloudIntegration"
      agentActions:
      - action: "OrderPizza"
        label: "Order Pizza"
        description: "Order a pizza."
      - action: "ShowMenu"
        label: "Show Menu"
        description: "Show order options. "
      …
  agentConversation:
    component: "System.AgentConversation"
    ...
    transitions:
      next: "terminatedWithoutAction"
      actions:
        ShowMenu: "ShowMenu"
        OrderPizza: "OrderPizza"

agentActionsリスト要素は、複数の方法で定義できます:

  • マップのリストとして。各マップにはアクション・プロパティ、値プロパティおよび説明プロパティ(オプション)を含める必要があります。例:
          - action: "action1"
            label: "label1"
            description: "description1"
          - action: "action2" 
            label: "label2"
            description: "description2"
  • JSON配列として。配列の各オブジェクトにはアクション・プロパティ、値プロパティおよび説明プロパティ(オプション)を含める必要があります。例:
          [
          {action: "action1",
          label: "label1",
          description: "description1"},
          {action: "action2",
          label: "label2",
          description: "description2"}      
          ]
  • アクション値のカンマ区切り文字列として。ラベルと説明はアクション値と同じです。例:
    "action1, action2"
いいえ
agentActionsMessage agentActionsプロパティが設定されている場合、エージェント・コンソールには、デフォルト・メッセージのかわりにこの値が表示されます。例:

agentActionsMessage: "\nYou can terminate when done or send one of these actions.\n"

いいえ
agentChannel エージェント統合チャネルを指定します。この値(エージェント統合チャネルの名前)とSystem.AgentConversationコンポーネントに定義されたagentChannelプロパティは、すべて一致する必要があります。 はい
allowTransferIf スキルがチャット・セッションを転送する条件を指定します。このコンポーネントは、queueId値を使用して、統計を取得するキューを識別します。会話がチャット・ルールによって他のキューではなく特定のキューに実際に転送されることを確認する必要があります。
  • agentsAreRequestingNewEngagements: これは最も制限の厳しい条件セットです。スキルが会話を転送しようとするのは、新しいエンゲージメントをリクエストし(チャットをプルし)、指定のキューに割り当てられたエージェントが存在する場合、あるいはチャット・サーバーがチャットをエージェントに自動的にプッシュした際に、チャットを受信でき、チャットの最大数に達しておらず、指定のキューに割り当てられているエージェントが存在する場合のみです。このオプションでは、ユーザーがエージェントと会話するまであまり長く待つ必要はありません。
  • agentSessionsAreAvailable: スキルが会話を転送しようとするのは、チャットの最大数に達しておらず、指定のキューに割り当てられている使用可能なエージェントが存在する場合です。エージェントが長時間実行中の会話に関与している場合またはチャット後のフォローアップを実行している場合、ユーザーは待機が必要になる場合があります。
  • agentsAreAvailable: スキルが会話を転送しようとするのは、指定のキューに割り当てられたオンラインのエージェントが存在する場合です。チャットの最大数に達しているか、新しいエンゲージメントをリクエストしているかには関係ありません。このオプションでは、ユーザーが長時間待機する可能性があります。

指定された条件が満たされない場合、コンポーネントはrejectedを返します。

このプロパティを含める場合は、queueIdプロパティも含める必要があります。

このプロパティは、Oracle Cloud Infrastructure (Generation 2クラウド・インフラストラクチャとも呼ばれる)にプロビジョニングされたOracle Digital Assistantのインスタンスでのみ使用できます。

いいえ
chatResponseVariable エージェントのレスポンス情報を保持するマップ変数を指定します。System.AgentInitiationコンポーネントが正常に接続されると、マップには次のプロパティが含まれます:
{
  "sessionID": "string", // agent session id

  "completedSurveyID": {
    "id": "int"
  },

  "engagementID": { // survey id
    "id": "int"
  },

  "cancelledSurveyID": {
    "id": "int"
  }
}
いいえ
customProperties サービスに渡す、インシデントID、インタフェース、連絡先またはカスタム・フィールド(またはそれらの組合せ)を保持するマップ。マップ変数を参照するには、${mapVariableName.value}のような値式を使用します。ライブ・チャットへの顧客情報の受渡しを参照してください。 いいえ
errorMessage Oracle B2C Serviceとの接続の確立中に問題が発生した場合に表示するメッセージ。たとえば、エージェント統合チャネルのパスワードが有効でなくなった場合や、サーバーに問題がある場合などです。 いいえ
nlpResultVariable 顧客の問合せメッセージを格納する変数。 いいえ
rejectedMessage AgentInitiationハンドシェイクが拒否された場合(構成済の営業時間外の場合など)に表示されるメッセージ。例:

rejectedMessaage: "Sorry, no agents are available at this time."

いいえ
resumedMessage 顧客と顧客サービス担当とのチャットが再開されるときに表示されるメッセージ(「少々お待ちください。エージェントにおつなぎしています。」など)。このプロパティを追加すると、すでにリクエストがキューに登録されている顧客は、ライブ・チャットを繰り返しリクエストしたときに、誤解を招く「エージェントとのチャットを再開しています」メッセージを受け取りません。 いいえ
subject エージェント・プラットフォームへのハンドオフ後にエージェントのコンソールに表示される件名。デフォルトでは、これはnlpResultVariableプロパティに格納されている最後の顧客メッセージですが、ダイアログ・フロー定義で以前に設定した変数を使用して定義することもできます。たとえば、System.AgentInitiationコンポーネントより前に値が設定されるstring型のコンテキスト変数を定義できます:

subject: "A customer needs help regarding ${context_variable.value}"

いいえ
queueId 指定したallowTransferIf条件が満たされるかどうかを判断するためにコンポーネントが使用する必要があるキューのID。これは、Oracle B2C Serviceチャット・ルールが会話をルーティングする先のキューのIDである必要があります。

allowTransferIfプロパティが存在しない場合、このプロパティは無視されます。

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 顧客がエージェントへの接続を待機している間に表示されるメッセージ。例:

waitingMessage: "You’ve joined the chat session. An agent will be right with you.

いいえ

System.AgentInitiation遷移

System.AgentInitiationコンポーネントは、acceptedrejectedおよび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により、接続リクエストが拒否されました。接続リクエストが拒否される理由として、次のようなものがあります:
  • 使用可能なエージェントがありません(allowTransferIfおよびqueueIdプロパティが必要です)
  • 構成済の営業時間外である
  • 休日である
  • チャット・サーバーに問題がある

allowTransferIfおよびqueueIdを設定しない場合、使用可能なエージェントがなくても拒否されたアクションは発生せず、転送は待機状態のままになります。

例: エージェント開始拒否とシステム・エラーの処理

システム・エラーと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オブジェクト

次の例では、interfaceIDcontactIDを設定します。

ヒント:

WSDLでinterfaceIDNamedID型であると指定されているため、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マップ変数のフィールドの定義
マップ値を設定する際にカスタム・コンポーネントを使用するか、ダイアログ・フローを使用するかにかかわらず、マップ・オブジェクトを構造化する必要があります。エージェント統合チャネルがバージョン20.1より前に作成されている場合、またはチャネルで19Aより前のOracle B2C Serviceバージョンに接続する場合を除き、標準オブジェクト・フォーマットを使用します。次に、標準フォーマットの例を示します:

  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への接続に問題がある場合にチャットに表示されるメッセージ。

デフォルト・メッセージはChat session error. The reason is {cause}です。

このプロパティは、Oracle Cloud Infrastructure (Generation 2クラウド・インフラストラクチャとも呼ばれる)にプロビジョニングされたOracle Digital Assistantのインスタンスでのみ動作します。

いいえ
exitKeywords ライブ・エージェントとの会話を終了するために顧客が使用する一般的な終了語のカンマ区切りリスト。例:

exitKeywords: "bye, exit, take care, goodbye, quit"

このプロパティ値のデフォルトはbye, take care, see you, goodbyeです。

いいえ
expiryMessage expiredアクションがトリガーされたときに表示されるメッセージ。デフォルト・メッセージは、「チャット・セッションの有効期限が切れました。ありがとうございました」です。

expiryMessageが出力される場合はconclusionMessageは出力されないことに注意してください。

サービス・クラウドのUSER_WAIT_QUEUE_TIMEOUTが超過したために会話が終了した場合、期限切れメッセージは出力されません。

いいえ
nlpResultVariable 顧客の問合せメッセージを保持するnlpResultVariable変数。 いいえ
waitExpiryMessage エージェントの待機中にチャットが期限切れになったときにユーザーに表示されるメッセージ。デフォルトのメッセージはThe request for live chat expired while waiting for an agent.です いいえ
waitMessage デフォルトでは、会話の転送が開始された後、ライブ・チャット・サービスがスキルに送信する待機メッセージ(キューの位置や待機時間など)がスキルに表示されます。このプロパティを使用してメッセージをカスタマイズします。例:

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')}."

いいえ

System.AgentConversation遷移

System.AgentConversationは、expiredagentLefterrorまたは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アクションを参照してください。

ユーザーがキーワードを入力して会話から離れた場合、このアクションは返されないことに注意してください。その場合、フローはnext遷移で指定された状態に、またはnext遷移がない場合はフローの次の状態に遷移します。

error

ライブ・エージェント・サービスへの接続中に問題が発生しました。

このアクションは、Oracle Cloud Infrastructure (Generation 2クラウド・インフラストラクチャとも呼ばれる)にプロビジョニングされたOracle Digital Assistantのインスタンスでのみ動作します。

expired

Oracle B2C ServiceのCS_IDLE_TIMEOUTがエージェント統合チャネルの「セッションの有効期限」設定以上である場合、エンドユーザーもエージェントもセッションの有効期限内にメッセージを送信しないと、このアクションがトリガーされます。CS_IDLE_TIMEOUTがエージェント統合チャネルの「セッションの有効期限」設定より短く、アクティビティが発生しない場合、Oracle B2C Serviceはチャットを終了し、かわりにagentLeftアクションをトリガーします。

デフォルトでは、CS_IDLE_TIMEOUTは10分です。

サービス・クラウドのUSER_WAIT_QUEUE_TIMEOUTが超過したために会話が終了した場合、expiredアクションは返されません。この構成の値は、7200秒(2時間)など高く設定することを検討してください。

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"

次に、ダイアログ・フローを構成するための基本ステップを示します:

  1. ライブ・エージェント転送を開始します。

    1. System.AgentInitiationコンポーネントの状態を追加します。

    2. 状態の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プロパティを追加して、このような顧客が誤解を招く「エージェントとのチャットを再開しています」メッセージを受信しないようにします。
  2. 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キューへのチャットの転送

  1. まだ定義していない場合は、コンテキスト・ノードで、System.AgentInitiationコンポーネントのcustomPropertiesプロパティで使用するマップ変数を定義します。例:

    context:
      variables:
        greeting: "string"
        name: "string"
        liveChatInfo: "map"
    
  2. マップ変数のフィールドを定義します。

    次に、バージョン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"
  3. 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

ノート

このトピックでは、このコンポーネントをYAMLモードで使用する方法について説明します。ビジュアル・フロー・デザイナでの使用方法の詳細は、「エンティティの解決」を参照してください。

コンポジット・バッグ内のすべてのエンティティ・フィールドを反復し、ユーザーと会話してすべてのフィールドを解決します。コンポーネントは、各エンティティに対して指定されるプロンプトをランダムに選択しながら、そのエンティティを解決します。

プロパティ 説明 必須
variable このコンポーネントによって移入されるコンポジット・バッグ・エンティティ・コンテキスト変数を参照します。コンポジット・エンティティ変数のすべての子エンティティにすでに値がある場合、ダイアログ・フローはユーザーにメッセージを送信せずに次の状態に遷移します。 はい
nlpResultVariable nlpresultコンテキスト変数に格納された値を使用して、(コンポジット・バッグ・エンティティ変数を参照する) variableプロパティに移入します。このプロパティは、nlpresult変数(通常はiResult)を指定することで定義できます。フレームワークによって単一の子エンティティが解決されると、そのエンティティ値のみがvariableプロパティに移入されます。nlpresult変数がすべての子エンティティの値を保持すると、ダイアログ・フローは次の状態に遷移します。このプロパティは、子エンティティ値に移入するSetVariable状態のかわりに使用できます。 いいえ
maxPrompts 子エンティティ・タイプに一致する有効な値を入力するためにユーザーに割り当てられる試行回数を指定します。最初の子エンティティについて最大試行回数を超えた場合、このプロパティは0にリセットされ、ボットは次の子エンティティを要求するプロンプトを出力します。コンポジット・バッグ・エンティティの作成で説明されているように、「最大ユーザー入力試行回数」オプションが設定されている場合は、コンポジット・バッグ内の個々のエンティティはこの設定をオーバーライドできます。 いいえ
autoNumberPostbackActions trueに設定すると、このオプションによって、オプションの先頭に番号が付けられます。このオプションをtrueに設定していない場合でも、デジタル・アシスタントの「ポストバック・アクションでの自動採番の有効化」構成がtrueに設定されている場合は、リスト・アイテムに自動採番を適用できます。チャネル固有の自動採番は、デジタル・アシスタントに登録されているどのスキル・ボットにも適用できます:
${(system.channelType=='twilio')?then('true','false')}
いいえ
useFullEntityMatches trueに設定すると、カスタム・エンティティ値がJSONオブジェクトとして格納されます(組込みエンティティ値のようになります)。これで、valueprimaryLanguageValueoriginalStringなどのプロパティにアクセスするための式を作成できます。これは、現在複数言語である(またはいずれ複数言語になる可能性がある)スキルにとって特に重要です。  
footerText テキストのみのチャネルでの出力を拡張します。フッターで説明されているように、FreeMarker式を使用して、テキストのみのチャネルのフッター・テキストに条件を設定できます。 いいえ
headerText コンポーネントがユーザーにバッグ内の次のアイテムを要求する前に表示されるメッセージ。このヘッダーを使用して、バッグ内の一致した(または更新された)前のエンティティに関するフィードバックを提供できます。
headerText: "<#list system.entityToResolve.value.updatedEntities>I have updated <#items as ent>${ent.description}<#sep> and </#items>. </#list><#list system.entityToResolve.value.outOfOrderMatches>I got <#items as ent>${ent.description}<#sep> and </#items>. </#list>"
いいえ
transitionAfterMatch trueに設定した場合に、このコンポーネントによって実行されたエンティティ一致からカスタム・コンポーネントへの一時的な遷移を可能にするブール。デフォルトでは、これはfalseです。エンティティ・イベント・ハンドラを登録している場合、このプロパティは無視されます(match遷移はトリガーされません)。 いいえ
cancelPolicy cancel遷移のタイミングを決定します:
  • immediate—バッグ内のエンティティに対して、割当て済maxPrompts試行に達した直後。

  • lastEntity—バッグ内の最後のエンティティが値と照合されたとき。

エンティティ・イベント・ハンドラを項目レベルまたはイベント・レベルのmaxPromptsReachedハンドラに登録している場合、このプロパティは無視されます。
いいえ

カレンダ・コンポーネント

次のカレンダ・コンポーネントを使用して、OutlookやGoogleのカレンダとの相互作用を行います:

カレンダの認可

スキルとカレンダ・プロバイダ間の対話を有効にするには、サービスを設定し、スキルおよびダイアログ・フローを変更して、ユーザーがそのサービスを介してカレンダにサインインできるようにする必要があります。

カレンダ・コンポーネントを使用する前に、アプリケーションをカレンダ・プロバイダに登録し、認可コード・サービスを作成する必要があります。方法は、次の項目を参照してください:

ダイアログ・フローで、System.OAuth2AccountLinkコンポーネントを使用して、作成した認可コード・サービスを介してカレンダにサインインするようユーザーに求めます。このコンポーネントをカレンダ・コンポーネントの認可に使用する場合は、コンポーネントのenableSingleSignOnプロパティをtrueに設定できないことに注意してください。

「認可が必要」機能を利用すると、ユーザーがカレンダ・コンポーネントを起動する前に、サインインしていること(アクセス・トークンを取得していること)を自動的に確認できます。この機能によって、ユーザーがまだアクセス・トークンを持っていない場合、または期限が切れてリフレッシュできない場合のみ、ユーザーがサインインを求められます。スキルの「認可が必要」構成を使用してスキル全体のデフォルトを設定し、状態レベルのrequiresAuthorization設定を使用してデフォルトをオーバーライドできます。つまり、スキルの設定を使用してデフォルトを設定し、デフォルトが適用されない状態にのみコンポーネントのrequiresAuthorization設定を含めます。

「認可が必要」機能を使用するには、defaultTransitionsノードにsystem.authorizeUserアクションを追加して、認可フローを開始する状態を指定する必要があります。例:

defaultTransitions:
  error: "globalErrorHandler"
  actions:
    system.authorizeUser: "userAuthN.performOAuth"

スキルは、認可が必要な状態に遷移する前に、カレンダ・サービスにとって有効なアクセス・トークンがあるかどうかを確認します。ない場合は、次の処理を実行します:

  1. defaultTransitionsノードのsystem.authorizedUserアクションに定義した状態を起動します。

  2. ユーザーにサインインを求めます。

  3. 認可が必要な状態(${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状態を実行できます。したがって、それらの状態では、requiresAuthorizationfalseに設定されます。カレンダ・コンポーネントで作動する状態には、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エンティティ、およびローカル・タイムゾーンの関係を理解することが重要です。

イベントを作成、更新または取得する場合は、startendの値にローカル日時を使用し、timezoneOffsetまたはtimezoneプロパティを使用して、協定世界時(UTC)の計算方法をコンポーネントに指示します。

カレンダ・コンポーネントのtimezoneOffsetprofile.timezoneOffsetとは異なります。カレンダ・コンポーネントの場合、timezoneOffsetは、UTCを得るためにコンポーネントがstartendの値に追加する必要がある値です。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のカレンダにイベントを追加します。繰返しイベントまたは終日イベントは作成できないことに注意してください。

ユーザーがこのコンポーネントにアクセスするには、カレンダ・プロバイダにサインインする必要があります。カレンダの認可で説明されているように、「認可が必要」機能を使用してユーザーのサインインを管理できます。

startendの値の設定方法の詳細は、カレンダの日付と時刻の操作を参照してください。

このコンポーネントの使用例を次に示します:この例では、コンポジット・バッグ・エンティティを使用して、日付、開始時刻と終了時刻、件名、場所および参加者を取得します。


  ####################
  # 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を掛ける必要があります。

timezoneOffsetまたはtimezoneを指定できますが、両方は指定できません。

いいえ
timezone

https://www.iana.org/time-zonesによって指定されるローカル・タイムゾーンのID。TZデータベース名とも呼ばれます。例: America/Los_Angeles。デフォルトはUTCです。timezoneOffsetまたはtimezoneを指定できますが、両方は指定できません。

いいえ

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値です。startendの値の変換方法の詳細は、カレンダの日付と時刻の操作を参照してください。

このコンポーネントの使用例を次に示します:

  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
}, …]

startendの値の設定方法の詳細は、カレンダの日付と時刻の操作を参照してください。このトピックでは、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 リストのタイプを示します。次のいずれかである必要があります:
  • ALL: カレンダ所有者のすべてのタイプの会議
  • DELETE:カレンダ所有者が削除できる会議すべて
  • UPDATE:カレンダ所有者が更新できる会議すべて
  • INVITED: カレンダ所有者が招待された会議すべて
はい
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

リスト・タイプINVITEDの場合、デフォルトは開始日時の14日後です。他のすべてのタイプの場合、デフォルトは開始日時の24時間後です。

いいえ
attendees 大/小文字が区別されない文字列のカンマ区切りリスト。参加者によってリストをフィルタ処理するために使用されます。1つ以上のattendee値にリストの1つ以上の文字列が含まれている会議のみが出力されます。 いいえ
response 招待の状態のカンマ区切りリスト。listTypeINVITEDのときにリストをフィルタ処理するために使用されます。指定できる状態は次のとおりです:
  • ACCEPTED
  • TENTATIVE
  • DECLINED
  • PENDING

デフォルトはPENDING,TENTATIVEです。レスポンスを待機している招待、または仮受付けされた招待のみが出力されます。

いいえ
timezoneOffset ユーザーのタイムゾーンの標準時刻を取得するために、世界標準時(UTC)に追加する時間(ミリ秒単位)。たとえば、ローカル・タイムゾーンがUTC-2の場合、timezoneOffset-7200000です。デフォルト値は0です。
ノート

ユーザー・コンテキスト変数profile.timezoneOffsetの値に基づいて、現在のユーザーのtimezoneOffsetプロパティを導出できます。ただし、そのためには、profile.timezoneOffsetに-1を掛ける必要があります。

timezoneOffsetまたはtimezoneを指定できますが、両方は指定できません。

いいえ
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人以上が含まれるイベント
  • 特定の日時より後に開始する会議
  • 特定の日時より前に終了する会議

ユーザーがこのコンポーネントにアクセスするには、カレンダ・プロバイダにサインインする必要があります。カレンダの認可で説明されているように、「認可が必要」機能を使用してユーザーのサインインを管理できます。

startendの値の設定方法の詳細は、カレンダの日付と時刻の操作を参照してください。

このコンポーネントの使用例を次に示します:

  ############################
  # 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 リストのタイプを示します。次のいずれかである必要があります:
  • ALL: カレンダ所有者のすべてのタイプの会議
  • DELETE:カレンダ所有者が削除できる会議すべて
  • UPDATE:カレンダ所有者が更新できる会議すべて
  • INVITED: カレンダ所有者が開催するものではないが、カレンダ所有者が招待されている会議すべて
はい
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

リスト・タイプINVITEDの場合、デフォルトは開始日時の14日後です。他のすべてのタイプの場合、デフォルトは開始日時の24時間後です。

いいえ
attendees 大/小文字が区別されない文字列のカンマ区切りリスト。参加者によってリストをフィルタ処理するために使用されます。1つ以上のattendee値にリストの1つ以上の文字列が含まれている会議のみが出力されます。 いいえ
response 招待の状態のカンマ区切りリスト。listTypeINVITEDのときにリストをフィルタ処理するために使用されます。指定できる状態は次のとおりです:
  • ACCEPTED
  • TENTATIVE
  • DECLINED
  • PENDING

デフォルトはPENDING,TENTATIVEです。レスポンスを待機している招待、または仮受付けされた招待のみが出力されます。

いいえ
prompt リストの前に表示されるテキスト。デフォルトはYou have the following meeting(s):です。デフォルトをオーバーライドする場合を除き、このプロパティを含める必要はありません。

ヒント:

プラットフォーム・バージョンが21.04以降のスキルでは、デフォルト値はスキルのリソース・バンドルに格納されます。デフォルトを変更するには、スキルの「リソース・バンドル」ページを開き、「リソース・バンドル」アイコンをクリックして「構成」タブを選択し、SelectCalendarEvent - promptキーのメッセージを変更します。
いいえ
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を掛ける必要があります。

timezoneOffsetまたはtimezoneを指定できますが、両方は指定できません。

いいえ
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 送信するレスポンス。指定できるレスポンスは次のとおりです:
  • ACCEPTED
  • TENTATIVE
  • DECLINED
はい

System.UpdateCalendarEvent

このコンポーネントを使用して、OutlookまたはGoogleのカレンダ・イベントを変更します。繰返しイベントまたは終日イベントは更新できないことに注意してください。

ユーザーがこのコンポーネントにアクセスするには、カレンダ・プロバイダにサインインする必要があります。カレンダの認可で説明されているように、「認可が必要」機能を使用してユーザーのサインインを管理できます。

startendの値の設定方法の詳細は、カレンダの日付と時刻の操作を参照してください。

このコンポーネントの使用例を次に示します:この例では、コンポジット・バッグ・エンティティを使用して、日付、開始時刻および終了時刻を取得します。


  ####################
  # 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を掛ける必要があります。

timezoneOffsetまたはtimezoneを指定できますが、両方は指定できません。

いいえ
timezone https://www.iana.org/time-zonesによって指定されるローカル・タイムゾーンのID。TZデータベース名とも呼ばれます。例: America/Los_Angeles。デフォルトはUTCです。timezoneOffsetまたはtimezoneを指定できますが、両方は指定できません。 いいえ

フッター

ボットがテキストのみのチャネルで実行される場合、追加のユーザー・ガイダンス用にSystem.ListおよびSystem.CommonResponseでフッターを使用します。
フッター・テキストの実行時のイメージ。
このフッターは、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プロパティ

YAMLベースのユーザー・インタフェースおよび入力コンポーネントのすべてに、グローバルなautoTranslate変数設定をオーバーライドするtranslateプロパティがあります:
  • autoTranslate変数をfalse (デフォルト)に設定した場合、translateプロパティをtrueに設定しないかぎり、コンポーネントで自動翻訳は行われません。

  • autoTranslate変数をtrueに設定した場合、translateプロパティも暗黙的にtrueに設定され、これはラベル、タイトル、説明、プロンプトおよびテキスト文字列が翻訳されることを意味します。

たとえば、autotranslatetrueに設定して有効にした場合、コンポーネントのtranslateプロパティをfalseに設定すると、そのプロンプト、タイトル、説明、ラベルおよびテキスト文字列は翻訳されません。逆に、autotranslateを有効にしないが、コンポーネントのtranslateプロパティがtrueに設定されている場合、コンポーネントのプロンプト、タイトル、説明、ラベルおよびテキスト文字列は、構成された翻訳サービスを使用して、検出されたユーザー言語に翻訳されます。(入力コンポーネントによって、ユーザー入力は英語に翻訳されます。)
autoTranslateの設定... ...コンポーネントのtranslateプロパティの設定... ...ユーザー入力、プロンプト、ラベル、テキスト、タイトルおよび説明が翻訳される
true 設定されていません はい
true true はい
true false いいえ
false 設定されていません いいえ
false false いいえ
false true はい
ノート

ビジュアル・フロー・デザイナで設計されたフローには、translateプロパティまたはautoTranslateコンテキスト変数がありません。これらのスキルの翻訳を構成するには、「ユーザー入力メッセージの翻訳」および「ボット・レスポンス・メッセージの翻訳」プロパティを使用します。

System.Feedback

ノート

このトピックでは、このコンポーネントをYAMLモードで使用する方法について説明します。ビジュアル・フロー・デザイナでの使用方法の詳細は、ユーザー・フィードバックを参照してください。

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.userFeedbackTextenableTextFeedbacktrueに設定されている場合、評価が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エンティティによって予期されている値(cheeseVeggie LoverHawaiianなど)を保持します。この情報がユーザー入力にない場合でも、ボットのダイアログ・フローは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値式。各マップにはlabelvalueの両方のプロパティと、オプションでkeywordプロパティが含まれている必要があります。
    askPizzaSize:
      component: "System.List" 
      properties:
        prompt: "What size do you want?"
        options: "${pizzaSize.value.enumValues}"
        variable: "pizzaSize"
構文の詳細は、Apache FreeMarker Manualを参照してください。

アクション・リスト

条件付きナビゲーションに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:
     ...