はじめに
対話型AIプラットフォーム
チャットボットの概要
自然言語処理(NLP)
ボットの概念と用語
クイックスタートガイド
プラットフォームへのアクセス
ボットビルダーの操作
リリースノート
最新バージョン(英語)
以前のバージョン(英語)
廃止機能(英語)
コンセプト
設計
ストーリーボード
ダイアログタスク
ダイアログタスクとは
ダイアログビルダー
ノードタイプ
インテントノード
ダイアログノード
エンティティノード
フォームノード
確認ノード
ロジックノード
ボットアクションノード
サービスノード
Webhookノード
スクリプトノード
グループノード
エージェント転送ノード
ユーザープロンプト
音声通話プロパティ
イベント ハンドラー
ナレッジグラフ
ナレッジグラフの抽出
ナレッジグラフの構築
ボットにナレッジグラフを追加
グラフの作成
ナレッジグラフの構築
既存のソースからFAQを構築
通知タスク
スモールトーク
デジタルスキル
デジタルフォーム
デジタルビュー
デジタルビューとは
パネル
ウィジェット
トレーニング
トレーニングとは
機械学習
機械学習とは
モデル検証
ファンダメンタルミーニング
ナレッジグラフ
示唆
ランキングおよび解決
NLPの詳細設定
NLPのガイドライン
インテリジェンス
インテリジェンスとは
コンテキスト
コンテキストインテント
割り込み
複数インテントの検出
エンティティの変更
デフォルトの会話
センチメント管理
トーン分析
テストとデバッグ
ボットと会話
発話テスト
バッチテスト
会話テスト
デプロイ
チャネル
公開
分析
ボットの分析
NLPメトリクス
会話フロー
Usage Metrics
封じ込め測定
カスタムダッシュボード
カスタムダッシュボードとは
メタタグ
カスタムダッシュボードとウィジェット
LLM and Generative AI
Introduction
LLM Integration
Kore.ai XO GPT Module
Prompts & Requests Library
Co-Pilot Features
Dynamic Conversations Features
ユニバーサルボット
ユニバーサルボットとは
ユニバーサルボットの定義
ユニバーサルボットの作成
ユニバーサルボットのトレーニング
ユニバーサルボットのカスタマイズ
他言語の有効化
ストア
プラントと使用
Overview
Usage Plans
Support Plans
Invoices
管理
ボット認証
複数言語対応ボット
個人を特定できる情報の編集
ボット変数の使用
IVRのシステム連携
一般設定
ボット管理
ハウツー
会話スキルの設計
バンキングボットを作成
バンキングボット – 資金の振り替え
バンキングボット – 残高を更新
ナレッジグラフを構築
スマートアラートの予約方法
Integrations
Actions
Actions Overview
Asana
Configure
Templates
Azure OpenAI
Configure
Templates
BambooHR
Configure
Templates
Bitly
Configure
Templates
Confluence
Configure
Templates
DHL
Configure
Templates
Freshdesk
Configure
Templates
Freshservice
Configure
Templates
Google Maps
Configure
Templates
Here
Configure
Templates
HubSpot
Configure
Templates
JIRA
Configure
Templates
Microsoft Graph
Configure
Templates
Open AI
Configure
Templates
Salesforce
Configure
Templates
ServiceNow
Configure
Templates
Stripe
Configure
Templates
Shopify
Configure
Templates
Twilio
Configure
Templates
Zendesk
Configure
Templates
Agents
Agent Transfer Overview
Custom (BotKit)
Drift
Genesys
Intercom
NiceInContact
NiceInContact(User Hub)
Salesforce
ServiceNow
Configure Tokyo and Lower versions
Configure Utah and Higher versions
Unblu
External NLU Adapters
Overview
Dialogflow Engine
Test and Debug
デジタルスキルの設計
デジタルフォームの設定方法
デジタルビューの設定方法
データテーブルのデータの追加方法
データテーブルのデータの更新方法
Add Data from Digital Forms
ボットのトレーニング
示唆の使用方法
インテントとエンティティのパターンの使用方法
コンテキスト切り替えの管理方法
ボットのデプロイ
エージェント転送の設定方法
ボット関数の使用方法
コンテンツ変数の使用方法
グローバル変数の使用方法
ボットの分析
カスタムダッシュボードの作成方法
カスタムタグを使ってフィルタリング
Data
Overview
Data Table
Table Views
App Definitions
Data as Service
Build a Travel Planning Assistant
Travel Assistant Overview
Create a Travel Virtual Assistant
Design Conversation Skills
Create an ‘Update Booking’ Task
Create a Change Flight Task
Build a Knowledge Graph
Schedule a Smart Alert
Design Digital Skills
Configure Digital Forms
Configure Digital Views
Train the Assistant
Use Traits
Use Patterns
Manage Context Switching
Deploy the Assistant
Use Bot Functions
Use Content Variables
Use Global Variables
Use Web SDK
Build a Banking Assistant
Migrate External Bots
Google Dialogflow Bot
APIs & SDKs
API Reference
API Introduction
Rate Limits
API List
koreUtil Libraries
SDK Reference
SDK Introduction
Web SDK
How the Web SDK Works
SDK Security
SDK Registration
Web Socket Connect and RTM
Tutorials
Widget SDK Tutorial
Web SDK Tutorial
BotKit SDK
BotKit SDK Deployment Guide
Installing the BotKit SDK
Using the BotKit SDK
SDK Events
SDK Functions
Tutorials
BotKit - Blue Prism
BotKit - Flight Search Sample VA
BotKit - Agent Transfer
  1. ホーム
  2. Docs
  3. Virtual Assistants
  4. How Tos
  5. Travel Planing Assistant
  6. Travel VA: Using Bot Functions

Travel VA: Using Bot Functions

In this use case we will explore a scenario in a Travel Planning Assistant, where Bot Functions can help reuse the same functionality in several places. We will see how a travel spend report can be programmed as a function and used, for example, to send to users upon request in different circumstances, to integrate with apps or create digital views

For details on what Bot Functions are and how they are implemented in the Kore.ai Bots platform, refer here.

Problem Statement

In a Travel Planning Assistant used by a travel agency, we have a reporting task that requires the VA to provide information on how much a traveller has spent in different categories, as part of a booking made via the agency. 

This information can be provided in several ways. For the purpose of this article, we will demonstrate how to create a dialog task that sends the user these details upon request, and how to create a widget, as part of a Digital View, that will display the information, say within an app that is integrated via the Widget SDK.

Prerequisites

  • To go through these configurations, you need to know at least the basics of building a Virtual Assistant
  • A pre-built Virtual Assistant. We will use the Travel Planning VA for this example.
  • Following is the Script file with two functions using the message templates to display the data (see here for more on message templates):
    • tableTemplate – takes a two-dimensional array and displays the content in a tabular format
    • pieTemplate – takes a two-dimensional array and displays the content in a pie format
      Copy the following content and save it as a .js file (say, functionEX.js)
      function tableTemplate(data){
       var message = {
         "type": "template",
         "payload": {
         "template_type": "mini_table",
         "layout": "vertical",
         "text":"Travel Spend",
         "elements": []  }
       };
       for (i=0; i < data.length; i++) {
         var j=0;
         var element = {
           "primary":[[data[i][j]],[data[i][j+1],"right"]],
           "additional":[[data[i][j+2],data[i][j+3]],[data[i][j+4],data[i][j+5]]]   };
       message.payload.elements.push(element);
       }
       return JSON.stringify(message);
      };

      function pieTemplate(data){
        var message = {
         "type": "template",
         "payload": {
         "template_type": "piechart",
         "pie_type": "regular",
         "text": "Travel Spend",
         "elements": []   }
        };
       for (i=0; i < data.length; i++) {
        var element = {
         "title": data[i][0],
         "value": data[i][1]   };
        message.payload.elements.push(element);
       }
       return JSON.stringify(message);
      };

Implementation

Import the Bot Function Script

To begin using Bot Functions, you first need to import a script into your assistant, by following the steps below:

  1. Open the Travel Planning Assistant.
  2. Select the Build tab from the top menu
  3. From Configurations select the Bot Functions section.
  4. Click Import (or Import New) to open the Import Custom Script window
  5. Drag and drop or Browse the script file that you saved from the Prerequisites section and click Import.
  6. Once the success message is displayed click Done.
  7. Your Script file is ready to use.

Create a Dialog Task

Open the Dialog Tasks page and create a New Dialog Task called “Get Travel Spend”.

  1. Add entities to capture the Flight Number and Fare.
  2. Ideally, there would be a service call to fetch the =details. Here we will use static values for demonstration purposes.
  3. Add a Script node using the Bot Action and enter the following – we are declaring an array carrying the spent amount on Airlines, Hotels and Experiences.
    context.travelspend = [["Airlines",1264],["Hotels",568],["Experiences", 324];
  4. Add a Message node to send this data to the Bot Function declared earlier and get the report.
    1. From Bot Responses section, click Manage Responses
    2. Add Bot Response, select Web/Mobile Client as the Channel, switch to JavaScript tab and enter the following code to display the values in a tabular format:
      var info = context.travelspend;
      print(tableTemplate(info));
  5. Add another Message node to send this data to the Bot Function declared earlier and get the report.
    1. From Bot Responses section, click Manage Responses
    2. Add Bot Response, select Web/Mobile Client as the Channel, switch to JavaScript tab and enter the following code to display the values in a pie chart:
      var info = context.travelspend;
      print(pieTemplate(info));
  6. Close the Dialog Task.

Create a Widget

The bot function can also be used to create a Widget using Digital Views, as follows:

    1. Go to Build > Digital Skills > Digital Views.
    2. Click Create Widget.
    3. Name your Widget as Travel Spend.
    4. Select Pie Chart as the Template Hint.
    5. You can link the Widget to the Dialog Task you just created. For this example, we will choose JSON as the Source to populate the data for this widget.
    6. Add the following script:
var message =
{
      "templateType": "piechart",
      "pie_type": "regular",
      "title": "Summary",
      "description": "monthly report",
      "elements": [
        {
          "title": "Airlines",
          "value": "1264.0",
          "displayValue": "$ 1,234"
        },
        {
          "title": "Hotels",
          "value": "568",
          "displayValue": "$ 568"
        },
        {
          "title": "Experiences",
          "value": "324",
          "displayValue": "$ 324"
        }
      ]
    };
print(JSON.stringify(message));

Testing

Use Talk to Bot and try both functions. Thus we have used the same function to display the reports in multiple places.

Travel VA: Using Bot Functions

In this use case we will explore a scenario in a Travel Planning Assistant, where Bot Functions can help reuse the same functionality in several places. We will see how a travel spend report can be programmed as a function and used, for example, to send to users upon request in different circumstances, to integrate with apps or create digital views

For details on what Bot Functions are and how they are implemented in the Kore.ai Bots platform, refer here.

Problem Statement

In a Travel Planning Assistant used by a travel agency, we have a reporting task that requires the VA to provide information on how much a traveller has spent in different categories, as part of a booking made via the agency. 

This information can be provided in several ways. For the purpose of this article, we will demonstrate how to create a dialog task that sends the user these details upon request, and how to create a widget, as part of a Digital View, that will display the information, say within an app that is integrated via the Widget SDK.

Prerequisites

  • To go through these configurations, you need to know at least the basics of building a Virtual Assistant
  • A pre-built Virtual Assistant. We will use the Travel Planning VA for this example.
  • Following is the Script file with two functions using the message templates to display the data (see here for more on message templates):
    • tableTemplate – takes a two-dimensional array and displays the content in a tabular format
    • pieTemplate – takes a two-dimensional array and displays the content in a pie format
      Copy the following content and save it as a .js file (say, functionEX.js)
      function tableTemplate(data){
       var message = {
         "type": "template",
         "payload": {
         "template_type": "mini_table",
         "layout": "vertical",
         "text":"Travel Spend",
         "elements": []  }
       };
       for (i=0; i < data.length; i++) {
         var j=0;
         var element = {
           "primary":[[data[i][j]],[data[i][j+1],"right"]],
           "additional":[[data[i][j+2],data[i][j+3]],[data[i][j+4],data[i][j+5]]]   };
       message.payload.elements.push(element);
       }
       return JSON.stringify(message);
      };

      function pieTemplate(data){
        var message = {
         "type": "template",
         "payload": {
         "template_type": "piechart",
         "pie_type": "regular",
         "text": "Travel Spend",
         "elements": []   }
        };
       for (i=0; i < data.length; i++) {
        var element = {
         "title": data[i][0],
         "value": data[i][1]   };
        message.payload.elements.push(element);
       }
       return JSON.stringify(message);
      };

Implementation

Import the Bot Function Script

To begin using Bot Functions, you first need to import a script into your assistant, by following the steps below:

  1. Open the Travel Planning Assistant.
  2. Select the Build tab from the top menu
  3. From Configurations select the Bot Functions section.
  4. Click Import (or Import New) to open the Import Custom Script window
  5. Drag and drop or Browse the script file that you saved from the Prerequisites section and click Import.
  6. Once the success message is displayed click Done.
  7. Your Script file is ready to use.

Create a Dialog Task

Open the Dialog Tasks page and create a New Dialog Task called “Get Travel Spend”.

  1. Add entities to capture the Flight Number and Fare.
  2. Ideally, there would be a service call to fetch the =details. Here we will use static values for demonstration purposes.
  3. Add a Script node using the Bot Action and enter the following – we are declaring an array carrying the spent amount on Airlines, Hotels and Experiences.
    context.travelspend = [["Airlines",1264],["Hotels",568],["Experiences", 324];
  4. Add a Message node to send this data to the Bot Function declared earlier and get the report.
    1. From Bot Responses section, click Manage Responses
    2. Add Bot Response, select Web/Mobile Client as the Channel, switch to JavaScript tab and enter the following code to display the values in a tabular format:
      var info = context.travelspend;
      print(tableTemplate(info));
  5. Add another Message node to send this data to the Bot Function declared earlier and get the report.
    1. From Bot Responses section, click Manage Responses
    2. Add Bot Response, select Web/Mobile Client as the Channel, switch to JavaScript tab and enter the following code to display the values in a pie chart:
      var info = context.travelspend;
      print(pieTemplate(info));
  6. Close the Dialog Task.

Create a Widget

The bot function can also be used to create a Widget using Digital Views, as follows:

    1. Go to Build > Digital Skills > Digital Views.
    2. Click Create Widget.
    3. Name your Widget as Travel Spend.
    4. Select Pie Chart as the Template Hint.
    5. You can link the Widget to the Dialog Task you just created. For this example, we will choose JSON as the Source to populate the data for this widget.
    6. Add the following script:
var message =
{
      "templateType": "piechart",
      "pie_type": "regular",
      "title": "Summary",
      "description": "monthly report",
      "elements": [
        {
          "title": "Airlines",
          "value": "1264.0",
          "displayValue": "$ 1,234"
        },
        {
          "title": "Hotels",
          "value": "568",
          "displayValue": "$ 568"
        },
        {
          "title": "Experiences",
          "value": "324",
          "displayValue": "$ 324"
        }
      ]
    };
print(JSON.stringify(message));

Testing

Use Talk to Bot and try both functions. Thus we have used the same function to display the reports in multiple places.

メニュー