UNPKG

googleapis

Version:
1,071 lines 193 kB
/** * Copyright 2019 Google LLC * * 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 { OAuth2Client, JWT, Compute, UserRefreshClient } from 'google-auth-library'; import { GoogleConfigurable, MethodOptions, GlobalOptions, BodyResponseCallback, APIRequestContext } from 'googleapis-common'; import { GaxiosPromise } from 'gaxios'; export declare namespace dialogflow_v2 { interface Options extends GlobalOptions { version: 'v2'; } interface StandardParameters { /** * V1 error format. */ '$.xgafv'?: string; /** * OAuth access token. */ access_token?: string; /** * Data format for response. */ alt?: string; /** * JSONP */ callback?: string; /** * Selector specifying which fields to include in a partial response. */ fields?: string; /** * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ key?: string; /** * OAuth 2.0 token for the current user. */ oauth_token?: string; /** * Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; /** * Legacy upload protocol for media (e.g. "media", "multipart"). */ uploadType?: string; /** * Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; } /** * Dialogflow API * * Builds conversational interfaces (for example, chatbots, and 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 */ class Dialogflow { context: APIRequestContext; projects: Resource$Projects; constructor(options: GlobalOptions, google?: GoogleConfigurable); } /** * Represents a conversational agent. */ 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://cloud.google.com/dialogflow-enterprise/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 will 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://cloud.google.com/dialogflow-enterprise/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. */ interface Schema$GoogleCloudDialogflowV2BatchCreateEntitiesRequest { /** * Required. The 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. [Many languages](https://cloud.google.com/dialogflow-enterprise/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. */ 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. [Many languages](https://cloud.google.com/dialogflow-enterprise/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. */ 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. */ interface Schema$GoogleCloudDialogflowV2BatchDeleteIntentsRequest { /** * Required. The collection of intents to delete. Only intent `name` must be filled in. */ intents?: Schema$GoogleCloudDialogflowV2Intent[]; } /** * The request message for EntityTypes.BatchUpdateEntities. */ interface Schema$GoogleCloudDialogflowV2BatchUpdateEntitiesRequest { /** * Required. The entities to update or create. */ entities?: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; /** * Optional. The language of entity synonyms defined in `entities`. If not specified, the agent's default language is used. [Many languages](https://cloud.google.com/dialogflow-enterprise/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. */ interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest { /** * The collection of entity types 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. [Many languages](https://cloud.google.com/dialogflow-enterprise/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. */ interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse { /** * The collection of updated or created entity types. */ entityTypes?: Schema$GoogleCloudDialogflowV2EntityType[]; } /** * The request message for Intents.BatchUpdateIntents. */ 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. [Many languages](https://cloud.google.com/dialogflow-enterprise/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. */ interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsResponse { /** * The collection of updated or created intents. */ intents?: Schema$GoogleCloudDialogflowV2Intent[]; } /** * The response message for EntityTypes.BatchUpdateEntityTypes. */ interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse { /** * The collection of updated or created entity types. */ entityTypes?: Schema$GoogleCloudDialogflowV2beta1EntityType[]; } /** * The response message for Intents.BatchUpdateIntents. */ interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse { /** * The collection of updated or created intents. */ intents?: Schema$GoogleCloudDialogflowV2beta1Intent[]; } /** * Represents a context. */ 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 20 minutes 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>`. 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. 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://cloud.google.com/dialogflow-enterprise/docs/intents-actions-parameters) for syntax. */ parameters?: { [key: string]: any; }; } /** * Represents an entity type. Entity types serve as a tool for extracting parameter values from natural language queries. */ interface Schema$GoogleCloudDialogflowV2beta1EntityType { /** * Optional. Indicates whether the entity type can be automatically expanded. */ autoExpansionMode?: string; /** * Required. The name of the entity type. */ displayName?: string; /** * Optional. The collection of entity entries associated with the entity type. */ entities?: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; /** * Required. Indicates the kind of entity type. */ kind?: string; /** * The unique identifier of the entity type. Required for EntityTypes.UpdateEntityType and EntityTypes.BatchUpdateEntityTypes methods. Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. */ name?: string; } /** * An **entity entry** for an associated entity type. */ interface Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity { /** * Required. A collection of value synonyms. For example, if the entity type is *vegetable*, and `value` is *scallions*, a synonym could be *green onions*. For `KIND_LIST` entity types: * This collection must contain exactly one synonym equal to `value`. */ synonyms?: string[]; /** * Required. The primary value associated with this entity entry. For example, if the entity type is *vegetable*, the value could be *scallions*. For `KIND_MAP` entity types: * A canonical value 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?"`. */ interface Schema$GoogleCloudDialogflowV2beta1EventInput { /** * Required. The language of this query. See [Language Support](https://cloud.google.com/dialogflow-enterprise/docs/reference/language) 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?: { [key: string]: any; }; } /** * The response message for Agents.ExportAgent. */ interface Schema$GoogleCloudDialogflowV2beta1ExportAgentResponse { /** * The exported agent. Example for how to export an agent to a zip file via a command line: <pre>curl \ 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:export'\ -X POST \ -H 'Authorization: Bearer '$(gcloud auth application-default 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></pre> */ 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. */ interface Schema$GoogleCloudDialogflowV2beta1Intent { /** * Optional. The name of the action associated with the intent. Note: The action name must not contain whitespaces. */ 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. Indicates that this intent ends an interaction. Some integrations (e.g., Actions on Google or Dialogflow phone gateway) use this information to close interaction with an end user. Default is false. */ endInteraction?: boolean; /** * 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[]; /** * Read-only. Information about all followup intents that have this intent as a direct or indirect parent. We populate this field only in the output. */ 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 both `ml_enabled` and `ml_disabled` are either not set or false, 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; /** * The unique identifier of this intent. Required for Intents.UpdateIntent and Intents.BatchUpdateIntents methods. 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[]; /** * Read-only after creation. The unique identifier of the parent intent in the chain of followup intents. You can set this field when creating an intent, for example with CreateIntent or BatchUpdateIntents, in order to make this intent a followup intent. 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. If this is zero or unspecified, we use the default priority 500000. 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; /** * Read-only. The unique identifier of the root intent in the chain of followup intents. It identifies the correct followup intents chain for this intent. We populate this field only in the output. Format: `projects/<Project ID>/agent/intents/<Intent ID>`. */ rootFollowupIntentName?: string; /** * Optional. The collection of examples that the agent is trained on. */ trainingPhrases?: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase[]; /** * Optional. Indicates whether webhooks are enabled for the intent. */ webhookState?: string; } /** * Represents a single followup intent in the chain. */ 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's parent. Format: `projects/<Project ID>/agent/intents/<Intent ID>`. */ parentFollowupIntentName?: string; } /** * Corresponds to the `Response` field in the Dialogflow console. */ 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, platform-specific payload. See the Intent.Message.Platform type for a description of the structure that may be required for your platform. */ payload?: { [key: string]: 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; /** * Plays audio from a file in Telephony Gateway. */ telephonyPlayAudio?: Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio; /** * Synthesizes speech in Telephony Gateway. */ telephonySynthesizeSpeech?: Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech; /** * Transfers the call in Telephony Gateway. */ telephonyTransferCall?: Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall; /** * Returns a text response. */ text?: Schema$GoogleCloudDialogflowV2beta1IntentMessageText; } /** * The basic card message. Useful for displaying information. */ 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. */ 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. */ interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction { /** * Required. The HTTP or HTTPS scheme URI. */ uri?: string; } /** * The card response message. */ 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. */ 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. */ interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect { /** * Required. Carousel items. */ items?: Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem[]; } /** * An item in the carousel. */ 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. */ interface Schema$GoogleCloudDialogflowV2beta1IntentMessageImage { /** * A text description of the image to be used for accessibility, e.g., screen readers. Required if image_uri is set for CarouselSelect. */ 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. */ 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. */ interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect { /** * Required. List items. */ items?: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem[]; /** * Optional. The overall title of the list. */ title?: string; } /** * An item in the list. */ 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. */ 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. */ 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. */ 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`. */ 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. */ interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion { /** * Required. The text shown the in the suggestion chip. */ title?: string; } /** * The collection of suggestions. */ interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions { /** * Required. The list of suggested replies. */ suggestions?: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion[]; } /** * Plays audio from a file in Telephony Gateway. */ interface Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonyPlayAudio { /** * Required. URI to a Google Cloud Storage object containing the audio to play, e.g., "gs://bucket/object". The object must contain a single channel (mono) of linear PCM audio (2 bytes / sample) at 8kHz. This object must be readable by the `service-<Project Number>@gcp-sa-dialogflow.iam.gserviceaccount.com` service account where <Project Number> is the number of the Telephony Gateway project (usually the same as the Dialogflow agent project). If the Google Cloud Storage bucket is in the Telephony Gateway project, this permission is added by default when enabling the Dialogflow V2 API. For audio from other sources, consider using the `TelephonySynthesizeSpeech` message with SSML. */ audioUri?: string; } /** * Synthesizes speech and plays back the synthesized audio to the caller in Telephony Gateway. Telephony Gateway takes the synthesizer settings from `DetectIntentResponse.output_audio_config` which can either be set at request-level or can come from the agent-level synthesizer config. */ interface Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonySynthesizeSpeech { /** * The SSML to be synthesized. For more information, see [SSML](https://developers.google.com/actions/reference/ssml). */ ssml?: string; /** * The raw text to be synthesized. */ text?: string; } /** * Transfers the call in Telephony Gateway. */ interface Schema$GoogleCloudDialogflowV2beta1IntentMessageTelephonyTransferCall { /** * Required. The phone number to transfer the call to in [E.164 format](https://en.wikipedia.org/wiki/E.164). We currently only allow transferring to US numbers (+1xxxyyyzzzz). */ phoneNumber?: string; } /** * The text response message. */ interface Schema$GoogleCloudDialogflowV2beta1IntentMessageText { /** * Optional. The collection of the agent's responses. */ text?: string[]; } /** * Represents intent parameters. */ 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 that the agent is trained on. */ interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase { /** * Output only. The unique identifier of this training phrase. */ name?: string; /** * Required. The ordered list of training phrase parts. The parts are concatenated in order to form the training phrase. Note: The API does not automatically annotate training phrases like the Dialogflow Console does. Note: Do not forget to include whitespace at part boundaries, so the training phrase is well formatted when the parts are concatenated. If the training phrase does not need to be annotated with parameters, you just need a single part with only the Part.text field set. If you want to annotate the training phrase, you must create multiple parts, 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. - `Part.text` is set to a part of the phrase that you want to annotate, and the `entity_type`, `alias`, and `user_defined` fields are all set. */ parts?: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart[]; /** * Optional. Indicates how many times this example 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. */ interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart { /** * Optional. The parameter name for the value extracted from the annotated part of the example. This field is required for annotated parts of the training phrase. */ alias?: string; /** * Optional. The entity type name prefixed with `@`. This field is required for annotated parts of the training phrase. */ entityType?: string; /** * Required. The text for this part. */ text?: string; /** * Optional. Indicates whether the text was manually annotated. This field is set to true when the Dialogflow Console is used to manually annotate the part. When creating an annotated part with the API, you must set this to true. */ userDefined?: boolean; } /** * Represents the result of querying a Knowledge base. */ interface Schema$GoogleCloudDialogflowV2beta1KnowledgeAnswers { /** * A list of answers from Knowledge Connector. */ answers?: Schema$GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer[]; } /** * An answer from Knowledge Connector. */ interface Schema$GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer { /** * The piece of text from the `source` knowledge base document that answers this conversational query. */ answer?: string; /** * The corresponding FAQ question if the answer was extracted from a FAQ Document, empty otherwise. */ faqQuestion?: string; /** * The system's confidence score that this Knowledge answer is a good match for this conversational query. The range is from 0.0 (completely uncertain) to 1.0 (completely certain). Note: The confidence score is likely to vary somewhat (possibly even for identical requests), as the underlying model is under constant improvement. It may be deprecated in the future. We recommend using `match_confidence_level` which should be generally more stable. */ matchConfidence?: number; /** * The system's confidence level that this knowledge answer is a good match for this conversational query. NOTE: The confidence level for a given `<query, answer>` pair may change without notice, as it depends on models that are constantly being improved. However, it will change less frequently than the confidence score below, and should be preferred for referencing the quality of an answer. */ matchConfidenceLevel?: string; /** * Indicates which Knowledge Document this answer was extracted from. Format: `projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`. */ source?: string; } /** * Metadata in google::longrunning::Operation for Knowledge operations. */ interface Schema$GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata { /** * Required. The current state of this operation. */ state?: string; } /** * Represents the contents of the original request that was passed to the `[Streaming]DetectIntent` call. */ interface Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest { /** * Optional. This field is set to the value of the `QueryParameters.payload` field passed in the request. Some integrations that query a Dialogflow agent may provide additional information in the payload. In particular for the Telephony Gateway this field has the form: <pre>{ "telephony": { "caller_id": "+18558363987" } }</pre> Note: The caller ID field (`caller_id`) will be redacted for Standard Edition agents and populated with the caller ID in [E.164 format](https://en.wikipedia.org/wiki/E.164) for Enterprise Edition agents. */ payload?: { [key: string]: any; }; /** * The source of this request, e.g., `google`, `facebook`, `slack`. It is set by Dialogflow-owned servers. */ source?: string; /** * Optional. The version of the protocol used for this request. This field is AoG-specific. */ version?: string; } /** * Represents the result of conversational query or event processing. */ 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. The string keys of the Struct's fields map can change without notice. */ diagnosticInfo?: { [key: string]: 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. Note: This is a legacy field, `fulfillment_messages` should be preferred. */ 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). If there are `multiple knowledge_answers` messages, this value is set to the greatest `knowledgeAnswers.match_confidence` value in the list. */ intentDetectionConfidence?: number; /** * The result from Knowledge Connector (if any), ordered by decreasing `KnowledgeAnswers.match_confidence`. */ knowledgeAnswers?: Schema$GoogleCloudDialogflowV2beta1KnowledgeAnswers; /** * The language that was triggered during intent detection. See [Language Support](https://cloud.google.com/dialogflow-enterprise/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?: { [key: string]: 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 sentiment analysis result, which depends on the `sentiment_analysis_request_config` specified in the request. */ sentimentAnalysisResult?: Schema$GoogleCloudDialogflowV2beta1SentimentAnalysisResult; /** * 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. This field is not guaranteed to be accurate or set. In particular this field isn't set 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?: { [key: string]: 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 sentiment, such as positive/negative feeling or association, for a unit of analysis, such as the query text. */ interface Schema$GoogleCloudDialogflowV2beta1Sentiment { /** * A non-negative number in the [0, +inf) range, which represents the absolute magnitude of sentiment, regardless of score (positive or negative). */ magnitude?: number; /** * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment). */ score?: number; } /** * The result of sentiment analysis as configured by `sentiment_analysis_request_config`. */ interface Schema$GoogleCloudDialogflowV2beta1SentimentAnalysisResult { /** * The sentiment analysis result for `query_text`. */ queryTextSentiment?: Schema$GoogleCloudDialogflowV2beta1Sentiment; } /** * The request message for a webhook call. */ interface Schema$GoogleCloudDialogflowV2beta1WebhookRequest { /** * Alternative query results from KnowledgeService. */ alternativeQueryResults?: Schema$GoogleCloudDialogflowV2beta1QueryResult[]; /** * 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; /** *