· 6 years ago · Oct 01, 2019, 03:06 AM
1/* tslint:disable:no-import-side-effect no-namespace no-shadowed-variable */
2export namespace Dialogflow {
3 /** The basic card message. Useful for displaying information. */
4 export interface BasicCard {
5 /** Optional. The title of the card. */
6 title?: string;
7 /** Optional. The subtitle of the card. */
8 subtitle?: string;
9 /** Required, unless image is present. The body text of the card. */
10 formattedText?: string;
11 /** Optional. The image for the card. */
12 image?: Image;
13 /** Optional. The collection of card buttons. */
14 buttons?: Button[];
15 }
16 /** Optional. Contains information about a button. */
17 export interface Button {
18 /** Optional. The text to show on the button. */
19 text?: string;
20 /** Optional. The text to send back to the Dialogflow API or a URI to open. */
21 postback?: string;
22 }
23 /** The card response message. */
24 export interface Card {
25 /** Optional. The title of the card. */
26 title?: string;
27 /** Optional. The subtitle of the card. */
28 subtitle?: string;
29 /** Optional. The public URI to an image file for the card. */
30 imageUri?: string;
31 /** Optional. The collection of card buttons. */
32 buttons?: Button[];
33 }
34 /** The card for presenting a carousel of options to select from. */
35 export interface CarouselSelect {
36 /** Required. Carousel items. */
37 items: Item[];
38 }
39 /** Represents a context. */
40 export interface Context {
41 /**
42 * Required. The unique identifier of the context. Format: projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>.
43 * The Context ID is always converted to lowercase, may only contain characters in [a-zA-Z0-9_-%] and may be at most 250 bytes long.
44 */
45 name: string;
46 /**
47 * Optional. The number of conversational query requests after which the context expires.
48 * If set to 0 (the default) the context expires immediately.
49 * Contexts expire automatically after 20 minutes if there are no matching queries.
50 */
51 lifespanCount?: number;
52 /** Optional. The collection of parameters associated with this context. Refer to this doc for syntax. */
53 parameters?: Struct;
54 }
55 /** Represents a single followup intent in the chain. */
56 export interface FollowupIntentInfo {
57 /** The unique identifier of the followup intent. Format: projects/<Project ID>/agent/intents/<Intent ID>. */
58 followupIntentName: string;
59 /** The unique identifier of the followup intent's parent. Format: projects/<Project ID>/agent/intents/<Intent ID>. */
60 parentFollowupIntentName?: string;
61 }
62 /** The image response message. */
63 export interface Image {
64 /** Optional. The public URI to an image file. */
65 imageUri?: string;
66 /** Optional. A text description of the image to be used for accessibility, e.g., screen readers. */
67 accessibilityText?: string;
68 }
69 /**
70 * Represents an intent. Intents convert a number of user expressions or patterns into an action.
71 * An action is an extraction of a user command or sentence semantics.
72 */
73 export interface Intent {
74 /**
75 * The unique identifier of this intent. Required for Intents.UpdateIntent and Intents.BatchUpdateIntents methods.
76 * Format: projects/<Project ID>/agent/intents/<Intent ID>.
77 */
78 name?: string;
79 /** Required. The name of this intent. */
80 displayName?: string;
81 /** Represents the different states that webhooks can be in. */
82 webhookState?: WebhookState;
83 /**
84 * Optional. The priority of this intent. Higher numbers represent higher priorities.
85 * If this is zero or unspecified, we use the default priority 500000. Negative numbers mean that the intent is disabled.
86 */
87 priority?: number;
88 /** Optional. Indicates whether this is a fallback intent. */
89 isFallback?: boolean;
90 /**
91 * Optional. Indicates whether Machine Learning is disabled for the intent.
92 * Note: If ml_diabled setting is set to true, then this intent is not taken into account during inference in ML ONLY match mode.
93 * Also, auto-markup in the UI is turned off.
94 */
95 mlDisabled?: boolean;
96 /**
97 * Optional. The list of context names required for this intent to be triggered.
98 * Format: projects/<Project ID>/agent/sessions/-/contexts/<Context ID>.
99 */
100 inputContextNames?: string[];
101 /**
102 * Optional. The collection of event names that trigger the intent.
103 * If the collection of input contexts is not empty,
104 * all of the contexts must be present in the active user session for an event to trigger this intent.
105 */
106 events?: string[];
107 /** Optional. The collection of examples that the agent is trained on. */
108 trainingPhrases?: TrainingPhrase[];
109 /** Optional. The name of the action associated with the intent. Note: The action name must not contain whitespaces. */
110 action?: string;
111 /**
112 * Optional. The collection of contexts that are activated when the intent is matched.
113 * Context messages in this collection should not set the parameters field.
114 * Setting the lifespanCount to 0 will reset the context when the intent is matched.
115 * Format: projects/<Project ID>/agent/sessions/-/contexts/<Context ID>.
116 */
117 outputContexts?: Context[];
118 /** Optional. Indicates whether to delete all contexts in the current session when this intent is matched. */
119 resetContexts?: boolean;
120 /** Optional. The collection of parameters associated with the intent. */
121 parameters?: Parameter[];
122 /** Optional. The collection of rich messages corresponding to the Response field in the Dialogflow console. */
123 messages?: Message[];
124 /**
125 * Optional. The list of platforms for which the first response will be taken from among the messages assigned to the DEFAULT_PLATFORM.
126 */
127 defaultResponsePlatforms?: Platform[];
128 /**
129 * Read-only. The unique identifier of the root intent in the chain of followup intents.
130 * It identifies the correct followup intents chain for this intent.
131 * We populate this field only in the output. Format: projects/<Project ID>/agent/intents/<Intent ID>.
132 */
133 rootFollowupIntentName?: string;
134 /**
135 * Read-only after creation. The unique identifier of the parent intent in the chain of followup intents.
136 * You can set this field when creating an intent, for example with [intents.create][] or [intents.batchUpdate][],
137 * in order to make this intent a followup intent. It identifies the parent followup intent.
138 * Format: projects/<Project ID>/agent/intents/<Intent ID>.
139 */
140 parentFollowupIntentName?: string;
141 /**
142 * Read-only. Information about all followup intents that have this intent as a direct or indirect parent.
143 * We populate this field only in the output.
144 */
145 followupIntentInfo?: FollowupIntentInfo[];
146 }
147 /** An item in the list. */
148 export interface Item {
149 /** Required. Additional information about this option. */
150 info: SelectItemInfo;
151 /** Required. The title of the list item. */
152 title: string;
153 /** Optional. The main text describing the item. */
154 description?: string;
155 /** Optional. The image to display. */
156 image?: Image;
157 }
158 /** The suggestion chip message that allows the user to jump out to the app or website associated with this agent. */
159 export interface LinkOutSuggestion {
160 /** Required. The name of the app or site this chip is linking to. */
161 destinationName: string;
162 /** Required. The URI of the app or site to open when the user taps the suggestion chip. */
163 uri: string;
164 }
165 /** The card for presenting a list of options to select from. */
166 export interface ListSelect {
167 /** Optional. The overall title of the list. */
168 title: string;
169 /** Required. List items. */
170 items: Item[];
171 }
172 /** Corresponds to the Response field in the Dialogflow console. */
173 export interface Message {
174 /** Optional. The platform that this message is intended for. */
175 platform: Platform;
176 // Union field message can be only one of the following:
177 /** The text response. */
178 text?: Text;
179 /** The image response. */
180 image?: Image;
181 /** The quick replies response. */
182 quickReplies?: QuickReplies;
183 /** The card response. */
184 card?: Card;
185 /**
186 * Returns a response containing a custom, platform-specific payload.
187 * See the Intent.Message.Platform type for a description of the structure that may be required for your platform.
188 */
189 payload?: Struct;
190 /** The voice and text-only responses for Actions on Google. */
191 simpleResponses?: SimpleResponses;
192 /** The basic card response for Actions on Google. */
193 basicCard?: BasicCard;
194 /** The suggestion chips for Actions on Google. */
195 suggestions?: Suggestions;
196 /** The link out suggestion chip for Actions on Google. */
197 linkOutSuggestion?: LinkOutSuggestion;
198 /** The list card response for Actions on Google. */
199 listSelect?: ListSelect;
200 /** The carousel card response for Actions on Google. */
201 carouselSelect?: CarouselSelect;
202 // End of list of possible types for union field message.
203 }
204 /** Represents intent parameters. */
205 export interface Parameter {
206 /** The unique identifier of this parameter. */
207 name: string;
208 /** Required. The name of the parameter. */
209 displayName: string;
210 /**
211 * Optional. The definition of the parameter value. It can be:
212 * - a constant string
213 * - a parameter value defined as $parameterName
214 * - an original parameter value defined as $parameterName.original
215 * - a parameter value from some context defined as #contextName.parameter_name
216 */
217 value?: string;
218 /**
219 * Optional. The default value to use when the value yields an empty result.
220 * Default values can be extracted from contexts by using the following syntax: #contextName.parameter_name.
221 */
222 defaultValue?: string;
223 /**
224 * Optional. The name of the entity type, prefixed with @, that describes values of the parameter.
225 * If the parameter is required, this must be provided.
226 */
227 entityTypeDisplayName?: string;
228 /**
229 * Optional. Indicates whether the parameter is required.
230 * That is, whether the intent cannot be completed without collecting the parameter value.
231 */
232 mandatory?: boolean;
233 /** Optional. The collection of prompts that the agent can present to the user in order to collect value for the parameter. */
234 prompts?: string[];
235 /** Optional. Indicates whether the parameter represents a list of values. */
236 isList?: boolean;
237 }
238 /** Represents a part of a training phrase. */
239 export interface Part {
240 /** Required. The text for this part. */
241 text: string;
242 /** Optional. The entity type name prefixed with @. This field is required for annotated parts of the training phrase. */
243 entityType?: string;
244 /**
245 * Optional. The parameter name for the value extracted from the annotated part of the example.
246 * This field is required for annotated parts of the training phrase.
247 */
248 alias?: string;
249 /**
250 * Optional. Indicates whether the text was manually annotated.
251 * This field is set to true when the Dialogflow Console is used to manually annotate the part.
252 * When creating an annotated part with the API, you must set this to true.
253 */
254 userDefined?: boolean;
255 }
256 /** Represents different platforms that a rich message can be intended for. */
257 export enum Platform {
258 /** Not specified. */
259 PLATFORM_UNSPECIFIED,
260 /** Facebook. */
261 FACEBOOK,
262 /** Slack. */
263 SLACK,
264 /** Telegram. */
265 TELEGRAM,
266 /** Kik. */
267 KIK,
268 /** Skype. */
269 SKYPE,
270 /** Line. */
271 LINE,
272 /** Viber. */
273 VIBER,
274 /**
275 * Actions on Google. When using Actions on Google, you can choose one of the specific Intent.Message types that mention support
276 * for Actions on Google, or you can use the advanced Intent.Message.payload field.
277 * The payload field provides access to AoG features not available in the specific message types.
278 * If using the Intent.Message.payload field, it should have a structure similar to the JSON message shown here.
279 * For more information, see Actions on Google Webhook Format
280 */
281 ACTIONS_ON_GOOGLE
282 }
283 /** The quick replies response message. */
284 export interface QuickReplies {
285 /** Optional. The title of the collection of quick replies. */
286 title?: string;
287 /** Optional. The collection of quick replies. */
288 quickReplies?: string[];
289 }
290 /** Additional info about the select item for when it is triggered in a dialog. */
291 export interface SelectItemInfo {
292 /** Required. A unique key that will be sent back to the agent if this response is given. */
293 key: string;
294 /** Optional. A list of synonyms that can also be used to trigger this item in dialog. */
295 synonyms: string[];
296 }
297 /** The simple response message containing speech or text. */
298 export interface SimpleResponse {
299 /** One of textToSpeech or ssml must be provided. The plain text of the speech output. Mutually exclusive with ssml. */
300 textToSpeech?: string;
301 /**
302 * One of textToSpeech or ssml must be provided. Structured spoken response to the user in the SSML format.
303 * Mutually exclusive with textToSpeech.
304 */
305 ssml?: string;
306 /** Optional. The text to display. */
307 displayText: string;
308 }
309 /**
310 * The collection of simple response candidates.
311 * This message in QueryResult.fulfillment_messages and WebhookResponse.fulfillment_messages should contain only one SimpleResponse.
312 */
313 export interface SimpleResponses {
314 simpleResponses: SimpleResponse[];
315 }
316 export interface Struct {
317 [key: string]: any;
318 }
319 /** The suggestion chip message that the user can tap to quickly post a reply to the conversation. */
320 export interface Suggestion {
321 /** Required. The text shown the in the suggestion chip. */
322 title: string;
323 }
324 /** The collection of suggestions. */
325 export interface Suggestions {
326 suggestions: Suggestion[];
327 }
328 /** The text response message. */
329 export interface Text {
330 /** Optional. The collection of the agent's responses. */
331 text?: string[];
332 }
333 /** Represents an example that the agent is trained on. */
334 export interface TrainingPhrase {
335 /** Output only. The unique identifier of this training phrase. */
336 name?: string;
337 /** Required. The type of the training phrase. */
338 type: Type;
339 /**
340 * Required. The ordered list of training phrase parts. The parts are concatenated in order to form the training phrase.
341 * Note: The API does not automatically annotate training phrases like the Dialogflow Console does.
342 * Note: Do not forget to include whitespace at part boundaries,
343 * so the training phrase is well formatted when the parts are concatenated.
344 * If the training phrase does not need to be annotated with parameters,
345 * you just need a single part with only the Part.text field set.
346 * If you want to annotate the training phrase, you must create multiple parts,
347 * where the fields of each part are populated in one of two ways: Part.text is set to a part of the phrase that has no parameters.
348 * Part.text is set to a part of the phrase that you want to annotate, and the entityType, alias, and userDefined fields are all set.
349 */
350 parts: Part[];
351 /**
352 * Optional. Indicates how many times this example was added to the intent.
353 * Each time a developer adds an existing sample by editing an intent or training, this counter is increased.
354 */
355 timesAddedCount?: number;
356 }
357 /** Represents different types of training phrases. */
358 export enum Type {
359 /** Not specified. This value should never be used. */
360 TYPE_UNSPECIFIED,
361 /** Examples do not contain @-prefixed entity type names, but example parts can be annotated with entity types. */
362 EXAMPLE,
363 /**
364 * Templates are not annotated with entity types, but they can contain @-prefixed entity type names as substrings.
365 * Template mode has been deprecated. Example mode is the only supported way to create new training phrases.
366 * If you have existing training phrases that you've created in template mode, those will continue to work.
367 */
368 TEMPLATE
369 }
370 /** Represents the different states that webhooks can be in. */
371 export enum WebhookState {
372 /** Webhook is disabled in the agent and in the intent. */
373 WEBHOOK_STATE_UNSPECIFIED,
374 /** Webhook is enabled in the agent and in the intent. */
375 WEBHOOK_STATE_ENABLED,
376 /** Webhook is enabled in the agent and in the intent. Also, each slot filling prompt is forwarded to the webhook. */
377 WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING
378 }
379}