Bot
1 つ以上のバージョンを使用できる Einstein Bot 設定の定義を表します。有効にできるバージョンは 1 つのみです。Metadata メタデータ型を拡張し、その fullName 項目を継承します。
ファイルのサフィックスおよびディレクトリの場所
Bot コンポーネントのサフィックスは .bot で、bot フォルダに保存されます。
バージョン
Bot コンポーネントは、API バージョン 43.0 以降で使用できます。
特別なアクセスルール
Bot を使用できるのは、組織でチャットと Einstein Bots が有効になっている場合のみです。
項目
| 項目名 | 項目の型 | 説明 |
|---|---|---|
| botMlDomain | LocalMlDomain | ボットに関連付けられたインテント、エンティティ、変数をグループ化する Einstein Intent セットを表します。同じボットのすべての Einstein ボットバージョンは、インテントセットを共有するようになりました。API バージョン 44.0 以降で利用できます。 |
| botUser | string | ボットに関連付けられたユーザプロファイルを表します。API バージョン 46.0 以降で使用できます。 |
| botVersions | BotVersion | ダイアログ、インテント、エンティティ、変数など、特定の Einstein ボットバージョンの設定の詳細を表します。 |
| contextVariables | ConversationContextVariable | チャネルに関係なくボットで顧客情報を収集できるようにするコンテキスト変数を表します。API 45.0 以降で使用できます。 |
| conversationChannelProviders | ConversationDefinitionChannelProvider [] | ボットにリンクされた会話チャネルのリストを表します。API バージョン 51.0 以降で使用できます。 |
| description | string | ボットの説明。 |
| label | string | Salesforce ユーザインターフェース全体でボットを識別する表示ラベル。 |
| logPrivateConversationData | boolean | 顧客の入力を会話データの一部としてログに記録するか (true)、否か (false) を指定します。API バージョン 48.0 以降で利用できます。 |
ConversationDefinitionChannelProvider
ボットにリンクされた会話チャネルの API 参照名を表します。API バージョン 51.0 以降で使用できます。
| 項目名 | 項目の型 | 説明 |
|---|---|---|
| agentRequired | boolean | ボットを有効化するにはエージェントをオンラインにする必要があるか (true)、否か (false) を指定します。デフォルトは false です。 |
| chatButtonName | string | 必須。LiveChatButton メタデータコンポーネントの API 参照名。 |
ConversationContextVariable
現在のボットバージョンにローカルのコンテキスト変数。API バージョン 45.0 以降で利用できます。
| 項目名 | 項目の型 | 説明 |
|---|---|---|
| contextVariableMappings | ConversationContextVariableMapping | コンテキスト変数、チャネル種別、および sObject 項目間の対応付けを表します。 |
| dataType | ConversationDataType (string 型の列挙) | 必須。コンテキスト変数のデータ型を表します。有効な値は、次のとおりです。
|
| developerName | string | 必須。コンテキスト変数の名前を表します。アンダースコアと英数字のみを使用でき、組織内で一意にする必要があります。最初は文字であること、空白は使用しない、最後にアンダースコアを使用しない、2 つ続けてアンダースコアを使用しないという制約があります。 |
| label | string | 必須。Salesforce ユーザインターフェース全体でコンテキスト変数を識別する表示ラベル。 |
| SObjectType | string | 有効な値は、次のとおりです。
|
ConversationContextVariableMapping
コンテキスト変数、チャネル種別、および sObject 項目間の対応付けを表します。
| 項目名 | 項目の型 | 説明 |
|---|---|---|
| fieldName | string | 必須。対応付けの一部として使用する sObject 項目の API 参照名。 |
| messageType | MessageType (string 型の列挙) | 必須。チャネル (SMS メッセージまたはチャットのいずれか) を表します。有効な値は、次のとおりです。
|
| SObjectType | string | 必須。対応付けの一部として定義する項目プロパティの sObject 型。有効な値は、次のとおりです。
|
LocalMlDomain
現在のボットバージョンのローカルの Einstein Intent セット。
| 項目名 | 項目の型 | 説明 |
|---|---|---|
| label | string | Salesforce ユーザインターフェース全体で、現在のボットバージョンのローカルの Einstein Intent セットを表す表示ラベル。 |
| mlIntents | MlIntent[] | このローカルインテントセットに関連付けられたインテントのリスト。 |
| mlSlotClasses | MlSlotClass[] | このローカルインテントセットに関連付けられたエンティティのリスト。 |
| name | string | 必須。一意の名前を使用して、他のローカル Einstein Intent セットとの競合を回避します。この名前は、アンダースコアと英数字のみを使用でき、組織内で一意にする必要があります。最初は文字であること、空白は使用しない、最後にアンダースコアを使用しない、2 つ続けてアンダースコアを使用しないという制約があります。 |
宣言的なメタデータの定義のサンプル
次に、ボットの例を示します。この例は、見やすくするために一部省略されています。
1<?xml version="1.0" encoding="UTF-8"?>
2<Bot xmlns="http://soap.sforce.com/2006/04/metadata">
3 <botMlDomain>
4 <label>Astros Pizza</label>
5 <mlIntents>
6 <developerName>New_Order</developerName>
7 <label>New Order</label>
8 <mlIntentUtterances>
9 <utterance>Today is pie day so I want pie</utterance>
10 </mlIntentUtterances>
11 </mlIntents>
12 <mlSlotClasses>
13 <developerName>Size</developerName>
14 <extractionType>Value</extractionType>
15 <label>Size</label>
16 <mlSlotClassValues>
17 <synonymGroup>
18 <languages>en_US</languages>
19 <terms>Big</terms>
20 <terms>Extra Large</terms>
21 <terms>X-Large</terms>
22 <terms>Grande</terms>
23 <terms>Huge</terms>
24 </synonymGroup>
25 <value>Large</value>
26 </mlSlotClassValues>
27 </mlSlotClasses>
28 <name>Astros_Pizza_ld1</name>
29 </botMlDomain>
30 <botVersions>
31 <fullName>v1</fullName>
32 <botDialogGroups>
33 <developerName>Order_Management</developerName>
34 <label>Order Management</label>
35 </botDialogGroups>
36 <botDialogs>
37 <botDialogGroup>Order_Management</botDialogGroup>
38 <botSteps>
39 <botMessages>
40 <message>🍕🍕🍕Pizza Time! 🍕🍕🍕</message>
41 </botMessages>
42 <type>Message</type>
43 </botSteps>
44 <botSteps>
45 <botStepConditions>
46 <leftOperandName>Verified_User</leftOperandName>
47 <leftOperandType>ConversationVariable</leftOperandType>
48 <operatorType>Equals</operatorType>
49 <rightOperandValue>false</rightOperandValue>
50 </botStepConditions>
51 <botSteps>
52 <botNavigation>
53 <botNavigationLinks>
54 <targetBotDialog>Customer_Verification</targetBotDialog>
55 </botNavigationLinks>
56 <type>Call</type>
57 </botNavigation>
58 <type>Navigation</type>
59 </botSteps>
60 <type>Group</type>
61 </botSteps>
62 <botSteps>
63 <botStepConditions>
64 <leftOperandName>Location</leftOperandName>
65 <leftOperandType>ConversationVariable</leftOperandType>
66 <operatorType>IsNotSet</operatorType>
67 </botStepConditions>
68 <botSteps>
69 <botNavigation>
70 <botNavigationLinks>
71 <targetBotDialog>Select_Location</targetBotDialog>
72 </botNavigationLinks>
73 <type>Call</type>
74 </botNavigation>
75 <type>Navigation</type>
76 </botSteps>
77 <type>Group</type>
78 </botSteps>
79 <botSteps>
80 <botVariableOperation>
81 <botInvocation>
82 <invocationActionName>CreateOrderService</invocationActionName>
83 <invocationActionType>apex</invocationActionType>
84 <invocationMappings>
85 <parameterName>customer</parameterName>
86 <type>Input</type>
87 <variableName>Contact</variableName>
88 <variableType>ConversationVariable</variableType>
89 </invocationMappings>
90 <invocationMappings>
91 <parameterName>location</parameterName>
92 <type>Input</type>
93 <variableName>Location</variableName>
94 <variableType>ConversationVariable</variableType>
95 </invocationMappings>
96 <invocationMappings>
97 <parameterName>output</parameterName>
98 <type>Output</type>
99 <variableName>Pizza_Order</variableName>
100 <variableType>ConversationVariable</variableType>
101 </invocationMappings>
102 </botInvocation>
103 <type>Set</type>
104 </botVariableOperation>
105 <type>VariableOperation</type>
106 </botSteps>
107 <botSteps>
108 <botMessages>
109 <message>Perfect, let's work on your order from our {!Location.Name} location</message>
110 </botMessages>
111 <type>Message</type>
112 </botSteps>
113 <botSteps>
114 <botNavigation>
115 <botNavigationLinks>
116 <targetBotDialog>Add_Items_to_Order</targetBotDialog>
117 </botNavigationLinks>
118 <type>Redirect</type>
119 </botNavigation>
120 <type>Navigation</type>
121 </botSteps>
122 <developerName>New_Order</developerName>
123 <label>New Order</label>
124 <mlIntent>New_Order</mlIntent>
125 <showInFooterMenu>false</showInFooterMenu>
126 </botDialogs>
127 <conversationVariables>
128 <dataType>Object</dataType>
129 <developerName>Contact</developerName>
130 <label>Contact</label>
131 </conversationVariables>
132 <conversationVariables>
133 <dataType>Text</dataType>
134 <developerName>Delivery_Address</developerName>
135 <label>Delivery Address</label>
136 </conversationVariables>
137 <conversationVariables>
138 <dataType>Object</dataType>
139 <developerName>Pizza_Order</developerName>
140 <label>Pizza Order</label>
141 </conversationVariables>
142 <entryDialog>Welcome</entryDialog>
143 <mainMenuDialog>Main_Menu</mainMenuDialog>
144 </botVersions>
145 <contextVariables>
146 <contextVariableMappings>
147 <SObjectType>LiveChatTranscript</SObjectType>
148 <fieldName>LiveChatTranscript.ChatKey</fieldName>
149 <messageType>WebChat</messageType>
150 </contextVariableMappings>
151 <dataType>Text</dataType>
152 <developerName>ChatKey</developerName>
153 <label>Chat Key</label>
154 </contextVariables>
155 <contextVariables>
156 <contextVariableMappings>
157 <SObjectType>LiveChatTranscript</SObjectType>
158 <fieldName>LiveChatTranscript.ContactId</fieldName>
159 <messageType>WebChat</messageType>
160 </contextVariableMappings>
161 <dataType>Id</dataType>
162 <developerName>ContactId</developerName>
163 <label>Contact Id</label>
164 </contextVariables>
165 <contextVariables>
166 <contextVariableMappings>
167 <SObjectType>LiveChatTranscript</SObjectType>
168 <fieldName>LiveChatTranscript.LiveChatVisitorId</fieldName>
169 <messageType>WebChat</messageType>
170 </contextVariableMappings>
171 <dataType>Id</dataType>
172 <developerName>EndUserId</developerName>
173 <label>End User Id</label>
174 </contextVariables>
175 <contextVariables>
176 <contextVariableMappings>
177 <SObjectType>LiveChatTranscript</SObjectType>
178 <fieldName>LiveChatTranscript.Id</fieldName>
179 <messageType>WebChat</messageType>
180 </contextVariableMappings>
181 <dataType>Id</dataType>
182 <developerName>RoutableId</developerName>
183 <label>Routable Id</label>
184 </contextVariables>
185....<conversationChannelProviders>
186 <agentRequired>false</agentRequired>
187 <chatButtonName>Chat_Button_For_Bot</chatButtonName>
188 </conversationChannelProviders>
189 <label>Astro's Pizza</label>
190</Bot>前の定義を参照する package.xml の例を次に示します。
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>Pizza_Bot</members>
5 <name>Bot</name>
6 </types>
7 <version>45.0</version>
8</Package>マニフェストファイル内のワイルドカードのサポート
このメタデータ型では、package.xml マニフェストファイル内のワイルドカード文字 * (アスタリスク) がサポートされます。マニフェストファイルの使用についての詳細は、「zip ファイルを使用したメタデータのリリースと取得」を参照してください。