UNPKG

googleapis

Version:
1,399 lines (1,398 loc) 127 kB
/** * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { AxiosPromise } from 'axios'; import { GoogleApis } from '../..'; import { BodyResponseCallback, GlobalOptions, MethodOptions } from '../../lib/api'; /** * Dialogflow API * * An end-to-end development suite for conversational interfaces (e.g., * chatbots, voice-powered apps and devices). * * @example * const google = require('googleapis'); * const dialogflow = google.dialogflow('v2'); * * @namespace dialogflow * @type {Function} * @version v2 * @variation v2 * @param {object=} options Options for Dialogflow */ export declare class Dialogflow { _options: GlobalOptions; google: GoogleApis; root: this; projects: Resource$Projects; constructor(options: GlobalOptions, google: GoogleApis); getRoot(): this; } /** * Represents a conversational agent. */ export interface Schema$GoogleCloudDialogflowV2Agent { /** * Optional. The URI of the agent's avatar. Avatars are used throughout * the Dialogflow console and in the self-hosted [Web * Demo](https://dialogflow.com/docs/integrations/web-demo) integration. */ avatarUri: string; /** * Optional. To filter out false positive results and still get variety in * matched natural language inputs for your agent, you can tune the machine * learning classification threshold. If the returned score value is less than * the threshold value, then a fallback intent is be triggered or, if there * are no fallback intents defined, no intent will be triggered. The score * values range from 0.0 (completely uncertain) to 1.0 (completely certain). * If set to 0.0, the default of 0.3 is used. */ classificationThreshold: number; /** * Required. The default language of the agent as a language tag. See * [Language Support](https://dialogflow.com/docs/reference/language) for a * list of the currently supported language codes. This field cannot be set by * the `Update` method. */ defaultLanguageCode: string; /** * Optional. The description of this agent. The maximum length is 500 * characters. If exceeded, the request is rejected. */ description: string; /** * Required. The name of this agent. */ displayName: string; /** * Optional. Determines whether this agent should log conversation queries. */ enableLogging: boolean; /** * Optional. Determines how intents are detected from user queries. */ matchMode: string; /** * Required. The project of this agent. Format: `projects/<Project ID>`. */ parent: string; /** * Optional. The list of all languages supported by this agent (except for the * `default_language_code`). */ supportedLanguageCodes: string[]; /** * Required. The time zone of this agent from the [time zone * database](https://www.iana.org/time-zones), e.g., America/New_York, * Europe/Paris. */ timeZone: string; } /** * The request message for EntityTypes.BatchCreateEntities. */ export interface Schema$GoogleCloudDialogflowV2BatchCreateEntitiesRequest { /** * Required. The collection of entities to create. */ entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; /** * Optional. The language of entity synonyms defined in `entities`. If not * specified, the agent's default language is used. [More than a dozen * languages](https://dialogflow.com/docs/reference/language) are supported. * Note: languages must be enabled in the agent, before they can be used. */ languageCode: string; } /** * The request message for EntityTypes.BatchDeleteEntities. */ export interface Schema$GoogleCloudDialogflowV2BatchDeleteEntitiesRequest { /** * Required. The canonical `values` of the entities to delete. Note that these * are not fully-qualified names, i.e. they don't start with * `projects/<Project ID>`. */ entityValues: string[]; /** * Optional. The language of entity synonyms defined in `entities`. If not * specified, the agent's default language is used. [More than a dozen * languages](https://dialogflow.com/docs/reference/language) are supported. * Note: languages must be enabled in the agent, before they can be used. */ languageCode: string; } /** * The request message for EntityTypes.BatchDeleteEntityTypes. */ export interface Schema$GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest { /** * Required. The names entity types to delete. All names must point to the * same agent as `parent`. */ entityTypeNames: string[]; } /** * The request message for Intents.BatchDeleteIntents. */ export interface Schema$GoogleCloudDialogflowV2BatchDeleteIntentsRequest { /** * Required. The collection of intents to delete. Only intent `name` must be * filled in. */ intents: Schema$GoogleCloudDialogflowV2Intent[]; } /** * The response message for EntityTypes.BatchCreateEntities. */ export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntitiesRequest { /** * Required. The collection of new entities to replace the existing entities. */ entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; /** * Optional. The language of entity synonyms defined in `entities`. If not * specified, the agent's default language is used. [More than a dozen * languages](https://dialogflow.com/docs/reference/language) are supported. * Note: languages must be enabled in the agent, before they can be used. */ languageCode: string; /** * Optional. The mask to control which fields get updated. */ updateMask: string; } /** * The request message for EntityTypes.BatchUpdateEntityTypes. */ export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest { /** * The collection of entity type to update or create. */ entityTypeBatchInline: Schema$GoogleCloudDialogflowV2EntityTypeBatch; /** * The URI to a Google Cloud Storage file containing entity types to update or * create. The file format can either be a serialized proto (of EntityBatch * type) or a JSON object. Note: The URI must start with "gs://". */ entityTypeBatchUri: string; /** * Optional. The language of entity synonyms defined in `entity_types`. If not * specified, the agent's default language is used. [More than a dozen * languages](https://dialogflow.com/docs/reference/language) are supported. * Note: languages must be enabled in the agent, before they can be used. */ languageCode: string; /** * Optional. The mask to control which fields get updated. */ updateMask: string; } /** * The response message for EntityTypes.BatchUpdateEntityTypes. */ export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse { /** * The collection of updated or created entity types. */ entityTypes: Schema$GoogleCloudDialogflowV2EntityType[]; } /** * The request message for Intents.BatchUpdateIntents. */ export interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsRequest { /** * The collection of intents to update or create. */ intentBatchInline: Schema$GoogleCloudDialogflowV2IntentBatch; /** * The URI to a Google Cloud Storage file containing intents to update or * create. The file format can either be a serialized proto (of IntentBatch * type) or JSON object. Note: The URI must start with "gs://". */ intentBatchUri: string; /** * Optional. The resource view to apply to the returned intent. */ intentView: string; /** * Optional. The language of training phrases, parameters and rich messages * defined in `intents`. If not specified, the agent's default language is * used. [More than a dozen * languages](https://dialogflow.com/docs/reference/language) are supported. * Note: languages must be enabled in the agent, before they can be used. */ languageCode: string; /** * Optional. The mask to control which fields get updated. */ updateMask: string; } /** * The response message for Intents.BatchUpdateIntents. */ export interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsResponse { /** * The collection of updated or created intents. */ intents: Schema$GoogleCloudDialogflowV2Intent[]; } /** * The response message for EntityTypes.BatchUpdateEntityTypes. */ export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse { /** * The collection of updated or created entity types. */ entityTypes: Schema$GoogleCloudDialogflowV2beta1EntityType[]; } /** * The response message for Intents.BatchUpdateIntents. */ export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse { /** * The collection of updated or created intents. */ intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; } /** * Represents a context. */ export interface Schema$GoogleCloudDialogflowV2beta1Context { /** * Optional. The number of conversational query requests after which the * context expires. If set to `0` (the default) the context expires * immediately. Contexts expire automatically after 10 minutes even if there * are no matching queries. */ lifespanCount: number; /** * Required. The unique identifier of the context. Format: * `projects/<Project ID>/agent/sessions/<Session * ID>/contexts/<Context ID>`, or `projects/<Project * ID>/agent/environments/<Environment ID>/users/<User * ID>/sessions/<Session ID>/contexts/<Context ID>`. Note: * Environments and users are under construction and will be available soon. * The Context ID is always converted to lowercase. If <Environment ID> * is not specified, we assume default 'draft' environment. If * <User ID> is not specified, we assume default '-' user. */ name: string; /** * Optional. The collection of parameters associated with this context. Refer * to [this doc](https://dialogflow.com/docs/actions-and-parameters) for * syntax. */ parameters: any; } /** * Represents an entity type. Entity types serve as a tool for extracting * parameter values from natural language queries. */ export interface Schema$GoogleCloudDialogflowV2beta1EntityType { /** * Optional. Indicates whether the entity type can be automatically expanded. */ autoExpansionMode: string; /** * Required. The name of the entity. */ displayName: string; /** * Optional. The collection of entities associated with the entity type. */ entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; /** * Required. Indicates the kind of entity type. */ kind: string; /** * Required for all methods except `create` (`create` populates the name * automatically. The unique identifier of the entity type. Format: * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. */ name: string; } /** * Optional. Represents an entity. */ export interface Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity { /** * Required. A collection of synonyms. For `KIND_LIST` entity types this must * contain exactly one synonym equal to `value`. */ synonyms: string[]; /** * Required. For `KIND_MAP` entity types: A canonical name to be used in * place of synonyms. For `KIND_LIST` entity types: A string that can * contain references to other entity types (with or without aliases). */ value: string; } /** * Events allow for matching intents by event name instead of the natural * language input. For instance, input `<event: { name: “welcome_event”, * parameters: { name: “Sam” } }>` can trigger a personalized welcome * response. The parameter `name` may be used by the agent in the response: * `“Hello #welcome_event.name! What can I do for you today?”`. */ export interface Schema$GoogleCloudDialogflowV2beta1EventInput { /** * Required. The language of this query. See [Language * Support](https://dialogflow.com/docs/languages) for a list of the currently * supported language codes. Note that queries in the same session do not * necessarily need to specify the same language. */ languageCode: string; /** * Required. The unique identifier of the event. */ name: string; /** * Optional. The collection of parameters associated with the event. */ parameters: any; } /** * The response message for Agents.ExportAgent. */ export interface Schema$GoogleCloudDialogflowV2beta1ExportAgentResponse { /** * The exported agent. Example for how to export an agent to a zip file via a * command line: curl \ * 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:export'\ * -X POST \ -H 'Authorization: Bearer '$(gcloud auth * print-access-token) \ -H 'Accept: application/json' \ -H * 'Content-Type: application/json' \ --compressed \ --data-binary * '{}' \ | grep agentContent | sed -e * 's/.*"agentContent": "\([^"]*\)".x/\1/' \ * | base64 --decode > <agent zip file> */ agentContent: string; /** * The URI to a file containing the exported agent. This field is populated * only if `agent_uri` is specified in `ExportAgentRequest`. */ agentUri: string; } /** * Represents an intent. Intents convert a number of user expressions or * patterns into an action. An action is an extraction of a user command or * sentence semantics. */ export interface Schema$GoogleCloudDialogflowV2beta1Intent { /** * Optional. The name of the action associated with the intent. */ action: string; /** * Optional. The list of platforms for which the first response will be taken * from among the messages assigned to the DEFAULT_PLATFORM. */ defaultResponsePlatforms: string[]; /** * Required. The name of this intent. */ displayName: string; /** * Optional. The collection of event names that trigger the intent. If the * collection of input contexts is not empty, all of the contexts must be * present in the active user session for an event to trigger this intent. */ events: string[]; /** * Optional. Collection of information about all followup intents that have * name of this intent as a root_name. */ followupIntentInfo: Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo[]; /** * Optional. The list of context names required for this intent to be * triggered. Format: `projects/<Project * ID>/agent/sessions/-/contexts/<Context ID>`. */ inputContextNames: string[]; /** * Optional. Indicates whether this is a fallback intent. */ isFallback: boolean; /** * Optional. The collection of rich messages corresponding to the `Response` * field in the Dialogflow console. */ messages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; /** * Optional. Indicates whether Machine Learning is disabled for the intent. * Note: If `ml_disabled` setting is set to true, then this intent is not * taken into account during inference in `ML ONLY` match mode. Also, * auto-markup in the UI is turned off. */ mlDisabled: boolean; /** * Optional. Indicates whether Machine Learning is enabled for the intent. * Note: If `ml_enabled` setting is set to false, then this intent is not * taken into account during inference in `ML ONLY` match mode. Also, * auto-markup in the UI is turned off. DEPRECATED! Please use `ml_disabled` * field instead. NOTE: If neither `ml_enabled` nor `ml_disabled` field is * set, then the default value is determined as follows: - Before April 15th, * 2018 the default is: ml_enabled = false / ml_disabled = true. - After * April 15th, 2018 the default is: ml_enabled = true / ml_disabled = false. */ mlEnabled: boolean; /** * Required for all methods except `create` (`create` populates the name * automatically. The unique identifier of this intent. Format: * `projects/<Project ID>/agent/intents/<Intent ID>`. */ name: string; /** * Optional. The collection of contexts that are activated when the intent is * matched. Context messages in this collection should not set the parameters * field. Setting the `lifespan_count` to 0 will reset the context when the * intent is matched. Format: `projects/<Project * ID>/agent/sessions/-/contexts/<Context ID>`. */ outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; /** * Optional. The collection of parameters associated with the intent. */ parameters: Schema$GoogleCloudDialogflowV2beta1IntentParameter[]; /** * The unique identifier of the parent intent in the chain of followup * intents. It identifies the parent followup intent. Format: * `projects/<Project ID>/agent/intents/<Intent ID>`. */ parentFollowupIntentName: string; /** * Optional. The priority of this intent. Higher numbers represent higher * priorities. Zero or negative numbers mean that the intent is disabled. */ priority: number; /** * Optional. Indicates whether to delete all contexts in the current session * when this intent is matched. */ resetContexts: boolean; /** * The unique identifier of the root intent in the chain of followup intents. * It identifies the correct followup intents chain for this intent. Format: * `projects/<Project ID>/agent/intents/<Intent ID>`. */ rootFollowupIntentName: string; /** * Optional. The collection of examples/templates that the agent is trained * on. */ trainingPhrases: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase[]; /** * Required. Indicates whether webhooks are enabled for the intent. */ webhookState: string; } /** * Represents a single followup intent in the chain. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo { /** * The unique identifier of the followup intent. Format: `projects/<Project * ID>/agent/intents/<Intent ID>`. */ followupIntentName: string; /** * The unique identifier of the followup intent parent. Format: * `projects/<Project ID>/agent/intents/<Intent ID>`. */ parentFollowupIntentName: string; } /** * Corresponds to the `Response` field in the Dialogflow console. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessage { /** * Displays a basic card for Actions on Google. */ basicCard: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard; /** * Displays a card. */ card: Schema$GoogleCloudDialogflowV2beta1IntentMessageCard; /** * Displays a carousel card for Actions on Google. */ carouselSelect: Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect; /** * Displays an image. */ image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; /** * Displays a link out suggestion chip for Actions on Google. */ linkOutSuggestion: Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion; /** * Displays a list card for Actions on Google. */ listSelect: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect; /** * Returns a response containing a custom payload. */ payload: any; /** * Optional. The platform that this message is intended for. */ platform: string; /** * Displays quick replies. */ quickReplies: Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies; /** * Returns a voice or text-only response for Actions on Google. */ simpleResponses: Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses; /** * Displays suggestion chips for Actions on Google. */ suggestions: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions; /** * Returns a text response. */ text: Schema$GoogleCloudDialogflowV2beta1IntentMessageText; } /** * The basic card message. Useful for displaying information. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard { /** * Optional. The collection of card buttons. */ buttons: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton[]; /** * Required, unless image is present. The body text of the card. */ formattedText: string; /** * Optional. The image for the card. */ image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; /** * Optional. The subtitle of the card. */ subtitle: string; /** * Optional. The title of the card. */ title: string; } /** * The button object that appears at the bottom of a card. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton { /** * Required. Action to take when a user taps on the button. */ openUriAction: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction; /** * Required. The title of the button. */ title: string; } /** * Opens the given URI. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction { /** * Required. The HTTP or HTTPS scheme URI. */ uri: string; } /** * The card response message. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCard { /** * Optional. The collection of card buttons. */ buttons: Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton[]; /** * Optional. The public URI to an image file for the card. */ imageUri: string; /** * Optional. The subtitle of the card. */ subtitle: string; /** * Optional. The title of the card. */ title: string; } /** * Optional. Contains information about a button. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton { /** * Optional. The text to send back to the Dialogflow API or a URI to open. */ postback: string; /** * Optional. The text to show on the button. */ text: string; } /** * The card for presenting a carousel of options to select from. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect { /** * Required. Carousel items. */ items: Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem[]; } /** * An item in the carousel. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem { /** * Optional. The body text of the card. */ description: string; /** * Optional. The image to display. */ image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; /** * Required. Additional info about the option item. */ info: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; /** * Required. Title of the carousel item. */ title: string; } /** * The image response message. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageImage { /** * Optional. A text description of the image to be used for accessibility, * e.g., screen readers. */ accessibilityText: string; /** * Optional. The public URI to an image file. */ imageUri: string; } /** * The suggestion chip message that allows the user to jump out to the app or * website associated with this agent. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion { /** * Required. The name of the app or site this chip is linking to. */ destinationName: string; /** * Required. The URI of the app or site to open when the user taps the * suggestion chip. */ uri: string; } /** * The card for presenting a list of options to select from. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect { /** * Required. List items. */ items: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem[]; /** * Optional. The overall title of the list. */ title: string; } /** * An item in the list. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem { /** * Optional. The main text describing the item. */ description: string; /** * Optional. The image to display. */ image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; /** * Required. Additional information about this option. */ info: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; /** * Required. The title of the list item. */ title: string; } /** * The quick replies response message. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies { /** * Optional. The collection of quick replies. */ quickReplies: string[]; /** * Optional. The title of the collection of quick replies. */ title: string; } /** * Additional info about the select item for when it is triggered in a dialog. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo { /** * Required. A unique key that will be sent back to the agent if this response * is given. */ key: string; /** * Optional. A list of synonyms that can also be used to trigger this item in * dialog. */ synonyms: string[]; } /** * The simple response message containing speech or text. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse { /** * Optional. The text to display. */ displayText: string; /** * One of text_to_speech or ssml must be provided. Structured spoken response * to the user in the SSML format. Mutually exclusive with text_to_speech. */ ssml: string; /** * One of text_to_speech or ssml must be provided. The plain text of the * speech output. Mutually exclusive with ssml. */ textToSpeech: string; } /** * The collection of simple response candidates. This message in * `QueryResult.fulfillment_messages` and `WebhookResponse.fulfillment_messages` * should contain only one `SimpleResponse`. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses { /** * Required. The list of simple responses. */ simpleResponses: Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse[]; } /** * The suggestion chip message that the user can tap to quickly post a reply to * the conversation. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion { /** * Required. The text shown the in the suggestion chip. */ title: string; } /** * The collection of suggestions. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions { /** * Required. The list of suggested replies. */ suggestions: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion[]; } /** * The text response message. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageText { /** * Optional. The collection of the agent's responses. */ text: string[]; } /** * Represents intent parameters. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentParameter { /** * Optional. The default value to use when the `value` yields an empty result. * Default values can be extracted from contexts by using the following * syntax: `#context_name.parameter_name`. */ defaultValue: string; /** * Required. The name of the parameter. */ displayName: string; /** * Optional. The name of the entity type, prefixed with `@`, that describes * values of the parameter. If the parameter is required, this must be * provided. */ entityTypeDisplayName: string; /** * Optional. Indicates whether the parameter represents a list of values. */ isList: boolean; /** * Optional. Indicates whether the parameter is required. That is, whether the * intent cannot be completed without collecting the parameter value. */ mandatory: boolean; /** * The unique identifier of this parameter. */ name: string; /** * Optional. The collection of prompts that the agent can present to the user * in order to collect value for the parameter. */ prompts: string[]; /** * Optional. The definition of the parameter value. It can be: - a constant * string, - a parameter value defined as `$parameter_name`, - an original * parameter value defined as `$parameter_name.original`, - a parameter value * from some context defined as `#context_name.parameter_name`. */ value: string; } /** * Represents an example or template that the agent is trained on. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase { /** * Required. The unique identifier of this training phrase. */ name: string; /** * Required. The collection of training phrase parts (can be annotated). * Fields: `entity_type`, `alias` and `user_defined` should be populated only * for the annotated parts of the training phrase. */ parts: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart[]; /** * Optional. Indicates how many times this example or template was added to * the intent. Each time a developer adds an existing sample by editing an * intent or training, this counter is increased. */ timesAddedCount: number; /** * Required. The type of the training phrase. */ type: string; } /** * Represents a part of a training phrase. */ export interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart { /** * Optional. The parameter name for the value extracted from the annotated * part of the example. */ alias: string; /** * Optional. The entity type name prefixed with `@`. This field is required * for the annotated part of the text and applies only to examples. */ entityType: string; /** * Required. The text corresponding to the example or template, if there are * no annotations. For annotated examples, it is the text for one of the * example's parts. */ text: string; /** * Optional. Indicates whether the text was manually annotated by the * developer. */ userDefined: boolean; } /** * Represents the contents of the original request that was passed to the * `[Streaming]DetectIntent` call. */ export interface Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest { /** * Optional. This field is set to the value of `QueryParameters.payload` field * passed in the request. */ payload: any; /** * The source of this request, e.g., `google`, `facebook`, `slack`. It is set * by Dialogflow-owned servers. Possible values of this field correspond to * Intent.Message.Platform. */ source: string; } /** * Represents the result of conversational query or event processing. */ export interface Schema$GoogleCloudDialogflowV2beta1QueryResult { /** * The action name from the matched intent. */ action: string; /** * This field is set to: - `false` if the matched intent has required * parameters and not all of the required parameter values have been * collected. - `true` if all required parameter values have been collected, * or if the matched intent doesn't contain any required parameters. */ allRequiredParamsPresent: boolean; /** * The free-form diagnostic info. For example, this field could contain * webhook call latency. */ diagnosticInfo: any; /** * The collection of rich messages to present to the user. */ fulfillmentMessages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; /** * The text to be pronounced to the user or shown on the screen. */ fulfillmentText: string; /** * The intent that matched the conversational query. Some, not all fields are * filled in this message, including but not limited to: `name`, * `display_name` and `webhook_state`. */ intent: Schema$GoogleCloudDialogflowV2beta1Intent; /** * The intent detection confidence. Values range from 0.0 (completely * uncertain) to 1.0 (completely certain). */ intentDetectionConfidence: number; /** * The language that was triggered during intent detection. See [Language * Support](https://dialogflow.com/docs/reference/language) for a list of the * currently supported language codes. */ languageCode: string; /** * The collection of output contexts. If applicable, * `output_contexts.parameters` contains entries with name `<parameter * name>.original` containing the original parameter values before the * query. */ outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; /** * The collection of extracted parameters. */ parameters: any; /** * The original conversational query text: - If natural language text was * provided as input, `query_text` contains a copy of the input. - If * natural language speech audio was provided as input, `query_text` contains * the speech recognition result. If speech recognizer produced multiple * alternatives, a particular one is picked. - If an event was provided as * input, `query_text` is not set. */ queryText: string; /** * The Speech recognition confidence between 0.0 and 1.0. A higher number * indicates an estimated greater likelihood that the recognized words are * correct. The default of 0.0 is a sentinel value indicating that confidence * was not set. You should not rely on this field as it isn't guaranteed * to be accurate, or even set. In particular this field isn't set in * Webhook calls and for StreamingDetectIntent since the streaming endpoint * has separate confidence estimates per portion of the audio in * StreamingRecognitionResult. */ speechRecognitionConfidence: number; /** * If the query was fulfilled by a webhook call, this field is set to the * value of the `payload` field returned in the webhook response. */ webhookPayload: any; /** * If the query was fulfilled by a webhook call, this field is set to the * value of the `source` field returned in the webhook response. */ webhookSource: string; } /** * The request message for a webhook call. */ export interface Schema$GoogleCloudDialogflowV2beta1WebhookRequest { /** * Optional. The contents of the original request that was passed to * `[Streaming]DetectIntent` call. */ originalDetectIntentRequest: Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest; /** * The result of the conversational query or event processing. Contains the * same value as `[Streaming]DetectIntentResponse.query_result`. */ queryResult: Schema$GoogleCloudDialogflowV2beta1QueryResult; /** * The unique identifier of the response. Contains the same value as * `[Streaming]DetectIntentResponse.response_id`. */ responseId: string; /** * The unique identifier of detectIntent request session. Can be used to * identify end-user inside webhook implementation. Format: * `projects/<Project ID>/agent/sessions/<Session ID>`. */ session: string; } /** * The response message for a webhook call. */ export interface Schema$GoogleCloudDialogflowV2beta1WebhookResponse { /** * Optional. Makes the platform immediately invoke another `DetectIntent` call * internally with the specified event as input. */ followupEventInput: Schema$GoogleCloudDialogflowV2beta1EventInput; /** * Optional. The collection of rich messages to present to the user. This * value is passed directly to `QueryResult.fulfillment_messages`. */ fulfillmentMessages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; /** * Optional. The text to be shown on the screen. This value is passed directly * to `QueryResult.fulfillment_text`. */ fulfillmentText: string; /** * Optional. The collection of output contexts. This value is passed directly * to `QueryResult.output_contexts`. */ outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; /** * Optional. This value is passed directly to `QueryResult.webhook_payload`. */ payload: any; /** * Optional. This value is passed directly to `QueryResult.webhook_source`. */ source: string; } /** * Represents a context. */ export interface Schema$GoogleCloudDialogflowV2Context { /** * Optional. The number of conversational query requests after which the * context expires. If set to `0` (the default) the context expires * immediately. Contexts expire automatically after 10 minutes even if there * are no matching queries. */ lifespanCount: number; /** * Required. The unique identifier of the context. Format: * `projects/<Project ID>/agent/sessions/<Session * ID>/contexts/<Context ID>`. */ name: string; /** * Optional. The collection of parameters associated with this context. Refer * to [this doc](https://dialogflow.com/docs/actions-and-parameters) for * syntax. */ parameters: any; } /** * The request to detect user's intent. */ export interface Schema$GoogleCloudDialogflowV2DetectIntentRequest { /** * Optional. The natural language speech audio to be processed. This field * should be populated iff `query_input` is set to an input audio config. A * single request can contain up to 1 minute of speech audio data. */ inputAudio: string; /** * Required. The input specification. It can be set to: 1. an audio config * which instructs the speech recognizer how to process the speech audio, 2. * a conversational query in the form of text, or 3. an event that specifies * which intent to trigger. */ queryInput: Schema$GoogleCloudDialogflowV2QueryInput; /** * Optional. The parameters of this query. */ queryParams: Schema$GoogleCloudDialogflowV2QueryParameters; } /** * The message returned from the DetectIntent method. */ export interface Schema$GoogleCloudDialogflowV2DetectIntentResponse { /** * The results of the conversational query or event processing. */ queryResult: Schema$GoogleCloudDialogflowV2QueryResult; /** * The unique identifier of the response. It can be used to locate a response * in the training example set or for reporting issues. */ responseId: string; /** * Specifies the status of the webhook request. `webhook_status` is never * populated in webhook requests. */ webhookStatus: Schema$GoogleRpcStatus; } /** * Represents an entity type. Entity types serve as a tool for extracting * parameter values from natural language queries. */ export interface Schema$GoogleCloudDialogflowV2EntityType { /** * Optional. Indicates whether the entity type can be automatically expanded. */ autoExpansionMode: string; /** * Required. The name of the entity. */ displayName: string; /** * Optional. The collection of entities associated with the entity type. */ entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; /** * Required. Indicates the kind of entity type. */ kind: string; /** * Required for all methods except `create` (`create` populates the name * automatically. The unique identifier of the entity type. Format: * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. */ name: string; } /** * This message is a wrapper around a collection of entity types. */ export interface Schema$GoogleCloudDialogflowV2EntityTypeBatch { /** * A collection of entity types. */ entityTypes: Schema$GoogleCloudDialogflowV2EntityType[]; } /** * Optional. Represents an entity. */ export interface Schema$GoogleCloudDialogflowV2EntityTypeEntity { /** * Required. A collection of synonyms. For `KIND_LIST` entity types this must * contain exactly one synonym equal to `value`. */ synonyms: string[]; /** * Required. For `KIND_MAP` entity types: A canonical name to be used in * place of synonyms. For `KIND_LIST` entity types: A string that can * contain references to other entity types (with or without aliases). */ value: string; } /** * Events allow for matching intents by event name instead of the natural * language input. For instance, input `<event: { name: “welcome_event”, * parameters: { name: “Sam” } }>` can trigger a personalized welcome * response. The parameter `name` may be used by the agent in the response: * `“Hello #welcome_event.name! What can I do for you today?”`. */ export interface Schema$GoogleCloudDialogflowV2EventInput { /** * Required. The language of this query. See [Language * Support](https://dialogflow.com/docs/languages) for a list of the currently * supported language codes. Note that queries in the same session do not * necessarily need to specify the same language. */ languageCode: string; /** * Required. The unique identifier of the event. */ name: string; /** * Optional. The collection of parameters associated with the event. */ parameters: any; } /** * The request message for Agents.ExportAgent. */ export interface Schema$GoogleCloudDialogflowV2ExportAgentRequest { /** * Optional. The Google Cloud Storage URI to export the agent to. Note: The * URI must start with "gs://". If left unspecified, the serialized * agent is returned inline. */ agentUri: string; } /** * The response message for Agents.ExportAgent. */ export interface Schema$GoogleCloudDialogflowV2ExportAgentResponse { /** * The exported agent. Example for how to export an agent to a zip file via a * command line: curl \ * 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:export'\ * -X POST \ -H 'Authorization: Bearer '$(gcloud auth * print-access-token) \ -H 'Accept: application/json' \ -H * 'Content-Type: application/json' \ --compressed \ --data-binary * '{}' \ | grep agentContent | sed -e * 's/.*"agentContent": "\([^"]*\)".x/\1/' \ * | base64 --decode > <agent zip file> */ agentContent: string; /** * The URI to a file containing the exported agent. This field is populated * only if `agent_uri` is specified in `ExportAgentRequest`. */ agentUri: string; } /** * The request message for Agents.ImportAgent. */ export interface Schema$GoogleCloudDialogflowV2ImportAgentRequest { /** * The agent to import. Example for how to import an agent via the command * line: curl \ * 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:import\ * -X POST \ -H 'Authorization: Bearer '$(gcloud auth * print-access-token) \ -H 'Accept: application/json' \ -H * 'Content-Type: application/json' \ --compressed \ --data-binary * "{ 'agentContent': '$(cat <agent zip file> | * base64 -w 0)' }" */ agentContent: string; /** * The URI to a Google Cloud Storage file containing the agent to import. * Note: The URI must start with "gs://". */ agentUri: string; } /** * Instructs the speech recognizer how to process the audio content. */ export interface Schema$GoogleCloudDialogflowV2InputAudioConfig { /** * Required. Audio encoding of the audio content to process. */ audioEncoding: string; /** * Required. The language of the supplied audio. Dialogflow does not do * translations. See [Language Support](https://dialogflow.com/docs/languages) * for a list of the currently supported language codes. Note that queries in * the same session do not necessarily need to specify the same language. */ languageCode: string; /** * Optional. The collection of phrase hints which are used to boost accuracy * of speech recognition. Refer to [Cloud Speech API * documentation](/speech/docs/basics#phrase-hints) for more details. */ phraseHints: string[]; /** * Required. Sample rate (in Hertz) of the audio content sent in the query. * Refer to [Cloud Speech API documentation](/speech/docs/basics) for more * details. */ sampleRateHertz: number; } /** * Represents an intent. Intents convert a number of user expressions or * patterns into an action. An action is an extraction of a user command or * sentence semantics. */ export interface Schema$GoogleCloudDialogflowV2Intent { /** * Optional. The name of the action associated with the intent. */ action: string; /** * Optional. The list of platforms for which the first response will be taken * from among the messages assigned to the DEFAULT_PLATFORM. */ defaultResponsePlatforms: string[]; /** * Required. The name of this intent. */ displayName: string; /** * Optional. The collection of event names that trigger the intent. If the * collection of input contexts is not empty, all of the contexts must be * present in the active user session for an event to trigger this intent. */ events: string[]; /** * Optional. Collection of information about all followup intents that have * name of this intent as a root_name. */ followupIntentInfo: Schema$GoogleCloudDialogflowV2IntentFollowupIntentInfo[]; /** * Optional. The list of context names required for this intent to be * triggered. Format: `projects/<Project * ID>/agent/sessions/-/contexts/<Context ID>`. */ inputContextNames: string[]; /** * Optional. Indicates whether this is a fallback intent. */ isFallback: boolean; /** * Optional. The collection of rich messages corresponding to the `Response` * field in the Dialogflow console. */ messages: Schema$GoogleCloudDialogflowV2IntentMessage[]; /** * Optional. Indicates whether Machine Learning is disabled for the intent. * Note: If `ml_diabled` setting is set to true, then this intent is not taken * into account during inference in `ML ONLY` match mode. Also, auto-markup in * the UI is turned off. */ mlDisabled: boolean; /** * Required for all methods except `create` (`create` populates the name * automatically. The unique identifier of this intent. Format: * `projects/<Project ID>/agent/intents/<Intent ID>`. */ name: string; /** * Optional. The collection of contexts that are activated when the intent is * matched. Context messages in this collection should not set the parameters * field. Setting the `lifespan_count` to 0 will reset the context when the * intent is matched. Format: `projects/<Project * ID>/agent/sessions/-/contexts/<Context ID>`. */ outputContexts: Schema$GoogleCloudDialogflowV2Context[]; /** * Optional. The collection of parameters associated with the intent. */ parameters: Schema$GoogleCloudDialogflowV2IntentParameter[]; /** * The unique identifier of the parent intent in the chain of followup * intents. It identifies the parent followup intent. Format: * `projects/<Project ID>/agent/intents/<Intent ID>`. */ parentFollowupIntentName: string; /** * Optional. The priority of this intent. Higher numbers represent higher * priorities. Zero or negative numbers mean that the intent is disabled. */ priority: number; /** * Optional. Indicates whether to delete all contexts in the current session * when this intent is matched.