googleapis
Version:
Google APIs Client Library for Node.js
958 lines (957 loc) • 1.15 MB
TypeScript
/// <reference types="node" />
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { Readable } from 'stream';
export declare namespace dialogflow_v2 {
export interface Options extends GlobalOptions {
version: 'v2';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth;
/**
* 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
* ```js
* const {google} = require('googleapis');
* const dialogflow = google.dialogflow('v2');
* ```
*/
export class Dialogflow {
context: APIRequestContext;
projects: Resource$Projects;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* Represents the natural speech audio to be processed.
*/
export interface Schema$GoogleCloudDialogflowCxV3AudioInput {
/**
* The natural language speech audio to be processed. A single request can contain up to 1 minute of speech audio data. The transcribed text cannot contain more than 256 bytes. For non-streaming audio detect intent, both `config` and `audio` must be provided. For streaming audio detect intent, `config` must be provided in the first request and `audio` must be provided in all following requests.
*/
audio?: string | null;
/**
* Required. Instructs the speech recognizer how to process the speech audio.
*/
config?: Schema$GoogleCloudDialogflowCxV3InputAudioConfig;
}
/**
* Metadata returned for the TestCases.BatchRunTestCases long running operation.
*/
export interface Schema$GoogleCloudDialogflowCxV3BatchRunTestCasesMetadata {
/**
* The test errors.
*/
errors?: Schema$GoogleCloudDialogflowCxV3TestError[];
}
/**
* The response message for TestCases.BatchRunTestCases.
*/
export interface Schema$GoogleCloudDialogflowCxV3BatchRunTestCasesResponse {
/**
* The test case results. The detailed conversation turns are empty in this response.
*/
results?: Schema$GoogleCloudDialogflowCxV3TestCaseResult[];
}
/**
* Represents the natural speech audio to be processed.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1AudioInput {
/**
* The natural language speech audio to be processed. A single request can contain up to 1 minute of speech audio data. The transcribed text cannot contain more than 256 bytes. For non-streaming audio detect intent, both `config` and `audio` must be provided. For streaming audio detect intent, `config` must be provided in the first request and `audio` must be provided in all following requests.
*/
audio?: string | null;
/**
* Required. Instructs the speech recognizer how to process the speech audio.
*/
config?: Schema$GoogleCloudDialogflowCxV3beta1InputAudioConfig;
}
/**
* Metadata returned for the TestCases.BatchRunTestCases long running operation.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1BatchRunTestCasesMetadata {
/**
* The test errors.
*/
errors?: Schema$GoogleCloudDialogflowCxV3beta1TestError[];
}
/**
* The response message for TestCases.BatchRunTestCases.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1BatchRunTestCasesResponse {
/**
* The test case results. The detailed conversation turns are empty in this response.
*/
results?: Schema$GoogleCloudDialogflowCxV3beta1TestCaseResult[];
}
/**
* One interaction between a human and virtual agent. The human provides some input and the virtual agent provides a response.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ConversationTurn {
/**
* The user input.
*/
userInput?: Schema$GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput;
/**
* The virtual agent output.
*/
virtualAgentOutput?: Schema$GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput;
}
/**
* The input from the human user.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ConversationTurnUserInput {
/**
* Parameters that need to be injected into the conversation during intent detection.
*/
injectedParameters?: {
[key: string]: any;
} | null;
/**
* Supports text input, event input, dtmf input in the test case.
*/
input?: Schema$GoogleCloudDialogflowCxV3beta1QueryInput;
/**
* If webhooks should be allowed to trigger in response to the user utterance. Often if parameters are injected, webhooks should not be enabled.
*/
isWebhookEnabled?: boolean | null;
}
/**
* The output from the virtual agent.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ConversationTurnVirtualAgentOutput {
/**
* The Page on which the utterance was spoken. Only name and displayName will be set.
*/
currentPage?: Schema$GoogleCloudDialogflowCxV3beta1Page;
/**
* Required. Input only. The diagnostic info output for the turn.
*/
diagnosticInfo?: {
[key: string]: any;
} | null;
/**
* Output only. If this is part of a result conversation turn, the list of differences between the original run and the replay for this output, if any.
*/
differences?: Schema$GoogleCloudDialogflowCxV3beta1TestRunDifference[];
/**
* The session parameters available to the bot at this point.
*/
sessionParameters?: {
[key: string]: any;
} | null;
/**
* Response error from the agent in the test result. If set, other output is empty.
*/
status?: Schema$GoogleRpcStatus;
/**
* The text responses from the agent for the turn.
*/
textResponses?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageText[];
/**
* The Intent that triggered the response. Only name and displayName will be set.
*/
triggeredIntent?: Schema$GoogleCloudDialogflowCxV3beta1Intent;
}
/**
* Metadata for CreateDocument operation.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1CreateDocumentOperationMetadata {
/**
* The generic information of the operation.
*/
genericMetadata?: Schema$GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata;
}
/**
* Metadata associated with the long running operation for Versions.CreateVersion.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1CreateVersionOperationMetadata {
/**
* Name of the created version. Format: `projects//locations//agents//flows//versions/`.
*/
version?: string | null;
}
/**
* Metadata for DeleteDocument operation.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1DeleteDocumentOperationMetadata {
/**
* The generic information of the operation.
*/
genericMetadata?: Schema$GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata;
}
/**
* Represents the input for dtmf event.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1DtmfInput {
/**
* The dtmf digits.
*/
digits?: string | null;
/**
* The finish digit (if any).
*/
finishDigit?: string | null;
}
/**
* An event handler specifies an event that can be handled during a session. When the specified event happens, the following actions are taken in order: * If there is a `trigger_fulfillment` associated with the event, it will be called. * If there is a `target_page` associated with the event, the session will transition into the specified page. * If there is a `target_flow` associated with the event, the session will transition into the specified flow.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1EventHandler {
/**
* Required. The name of the event to handle.
*/
event?: string | null;
/**
* Output only. The unique identifier of this event handler.
*/
name?: string | null;
/**
* The target flow to transition to. Format: `projects//locations//agents//flows/`.
*/
targetFlow?: string | null;
/**
* The target page to transition to. Format: `projects//locations//agents//flows//pages/`.
*/
targetPage?: string | null;
/**
* The fulfillment to call when the event occurs. Handling webhook errors with a fulfillment enabled with webhook could cause infinite loop. It is invalid to specify such fulfillment for a handler handling webhooks.
*/
triggerFulfillment?: Schema$GoogleCloudDialogflowCxV3beta1Fulfillment;
}
/**
* Represents the event to trigger.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1EventInput {
/**
* Name of the event.
*/
event?: string | null;
}
/**
* The response message for Agents.ExportAgent.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ExportAgentResponse {
/**
* Uncompressed raw byte content for agent.
*/
agentContent?: string | null;
/**
* The URI to a file containing the exported agent. This field is populated only if `agent_uri` is specified in ExportAgentRequest.
*/
agentUri?: string | null;
}
/**
* Metadata returned for the TestCases.ExportTestCases long running operation.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ExportTestCasesMetadata {
}
/**
* The response message for TestCases.ExportTestCases.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ExportTestCasesResponse {
/**
* Uncompressed raw byte content for test cases.
*/
content?: string | null;
/**
* The URI to a file containing the exported test cases. This field is populated only if `gcs_uri` is specified in ExportTestCasesRequest.
*/
gcsUri?: string | null;
}
/**
* A form is a data model that groups related parameters that can be collected from the user. The process in which the agent prompts the user and collects parameter values from the user is called form filling. A form can be added to a page. When form filling is done, the filled parameters will be written to the session.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1Form {
/**
* Parameters to collect from the user.
*/
parameters?: Schema$GoogleCloudDialogflowCxV3beta1FormParameter[];
}
/**
* Represents a form parameter.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1FormParameter {
/**
* The default value of an optional parameter. If the parameter is required, the default value will be ignored.
*/
defaultValue?: any | null;
/**
* Required. The human-readable name of the parameter, unique within the form.
*/
displayName?: string | null;
/**
* Required. The entity type of the parameter. Format: `projects/-/locations/-/agents/-/entityTypes/` for system entity types (for example, `projects/-/locations/-/agents/-/entityTypes/sys.date`), or `projects//locations//agents//entityTypes/` for developer entity types.
*/
entityType?: string | null;
/**
* Required. Defines fill behavior for the parameter.
*/
fillBehavior?: Schema$GoogleCloudDialogflowCxV3beta1FormParameterFillBehavior;
/**
* Indicates whether the parameter represents a list of values.
*/
isList?: boolean | null;
/**
* Indicates whether the parameter content should be redacted in log. If redaction is enabled, the parameter content will be replaced by parameter name during logging. Note: the parameter content is subject to redaction if either parameter level redaction or entity type level redaction is enabled.
*/
redact?: boolean | null;
/**
* Indicates whether the parameter is required. Optional parameters will not trigger prompts; however, they are filled if the user specifies them. Required parameters must be filled before form filling concludes.
*/
required?: boolean | null;
}
/**
* Configuration for how the filling of a parameter should be handled.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1FormParameterFillBehavior {
/**
* Required. The fulfillment to provide the initial prompt that the agent can present to the user in order to fill the parameter.
*/
initialPromptFulfillment?: Schema$GoogleCloudDialogflowCxV3beta1Fulfillment;
/**
* The handlers for parameter-level events, used to provide reprompt for the parameter or transition to a different page/flow. The supported events are: * `sys.no-match-`, where N can be from 1 to 6 * `sys.no-match-default` * `sys.no-input-`, where N can be from 1 to 6 * `sys.no-input-default` * `sys.invalid-parameter` `initial_prompt_fulfillment` provides the first prompt for the parameter. If the user's response does not fill the parameter, a no-match/no-input event will be triggered, and the fulfillment associated with the `sys.no-match-1`/`sys.no-input-1` handler (if defined) will be called to provide a prompt. The `sys.no-match-2`/`sys.no-input-2` handler (if defined) will respond to the next no-match/no-input event, and so on. A `sys.no-match-default` or `sys.no-input-default` handler will be used to handle all following no-match/no-input events after all numbered no-match/no-input handlers for the parameter are consumed. A `sys.invalid-parameter` handler can be defined to handle the case where the parameter values have been `invalidated` by webhook. For example, if the user's response fill the parameter, however the parameter was invalidated by webhook, the fulfillment associated with the `sys.invalid-parameter` handler (if defined) will be called to provide a prompt. If the event handler for the corresponding event can't be found on the parameter, `initial_prompt_fulfillment` will be re-prompted.
*/
repromptEventHandlers?: Schema$GoogleCloudDialogflowCxV3beta1EventHandler[];
}
/**
* A fulfillment can do one or more of the following actions at the same time: * Generate rich message responses. * Set parameter values. * Call the webhook. Fulfillments can be called at various stages in the Page or Form lifecycle. For example, when a DetectIntentRequest drives a session to enter a new page, the page's entry fulfillment can add a static response to the QueryResult in the returning DetectIntentResponse, call the webhook (for example, to load user data from a database), or both.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1Fulfillment {
/**
* Conditional cases for this fulfillment.
*/
conditionalCases?: Schema$GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases[];
/**
* The list of rich message responses to present to the user.
*/
messages?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessage[];
/**
* Set parameter values before executing the webhook.
*/
setParameterActions?: Schema$GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction[];
/**
* The tag used by the webhook to identify which fulfillment is being called. This field is required if `webhook` is specified.
*/
tag?: string | null;
/**
* The webhook to call. Format: `projects//locations//agents//webhooks/`.
*/
webhook?: string | null;
}
/**
* A list of cascading if-else conditions. Cases are mutually exclusive. The first one with a matching condition is selected, all the rest ignored.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases {
/**
* A list of cascading if-else conditions.
*/
cases?: Schema$GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase[];
}
/**
* Each case has a Boolean condition. When it is evaluated to be True, the corresponding messages will be selected and evaluated recursively.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCase {
/**
* A list of case content.
*/
caseContent?: Schema$GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent[];
/**
* The condition to activate and select this case. Empty means the condition is always true. The condition is evaluated against form parameters or session parameters. See the [conditions reference](https://cloud.google.com/dialogflow/cx/docs/reference/condition).
*/
condition?: string | null;
}
/**
* The list of messages or conditional cases to activate for this case.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCasesCaseCaseContent {
/**
* Additional cases to be evaluated.
*/
additionalCases?: Schema$GoogleCloudDialogflowCxV3beta1FulfillmentConditionalCases;
/**
* Returned message.
*/
message?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessage;
}
/**
* Setting a parameter value.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1FulfillmentSetParameterAction {
/**
* Display name of the parameter.
*/
parameter?: string | null;
/**
* The new value of the parameter. A null value clears the parameter.
*/
value?: any | null;
}
/**
* Metadata in google::longrunning::Operation for Knowledge operations.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata {
/**
* Required. Output only. The current state of this operation.
*/
state?: string | null;
}
/**
* Metadata for ImportDocuments operation.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ImportDocumentsOperationMetadata {
/**
* The generic information of the operation.
*/
genericMetadata?: Schema$GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata;
}
/**
* Response message for Documents.ImportDocuments.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ImportDocumentsResponse {
/**
* Includes details about skipped documents or any other warnings.
*/
warnings?: Schema$GoogleRpcStatus[];
}
/**
* Metadata returned for the TestCases.ImportTestCases long running operation.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ImportTestCasesMetadata {
/**
* Errors for failed test cases.
*/
errors?: Schema$GoogleCloudDialogflowCxV3beta1TestCaseError[];
}
/**
* The response message for TestCases.ImportTestCases.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ImportTestCasesResponse {
/**
* The unique identifiers of the new test cases. Format: `projects//locations//agents//testCases/`.
*/
names?: string[] | null;
}
/**
* Instructs the speech recognizer on how to process the audio content.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1InputAudioConfig {
/**
* Required. Audio encoding of the audio content to process.
*/
audioEncoding?: string | null;
/**
* Optional. If `true`, Dialogflow returns SpeechWordInfo in StreamingRecognitionResult with information about the recognized speech words, e.g. start and end time offsets. If false or unspecified, Speech doesn't return any word-level information.
*/
enableWordInfo?: boolean | null;
/**
* Optional. Which Speech model to select for the given request. Select the model best suited to your domain to get best results. If a model is not explicitly specified, then we auto-select a model based on the parameters in the InputAudioConfig. If enhanced speech model is enabled for the agent and an enhanced version of the specified model for the language does not exist, then the speech is recognized using the standard version of the specified model. Refer to [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) for more details.
*/
model?: string | null;
/**
* Optional. Which variant of the Speech model to use.
*/
modelVariant?: string | null;
/**
* Optional. A list of strings containing words and phrases that the speech recognizer should recognize with higher likelihood. See [the Cloud Speech documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints) for more details.
*/
phraseHints?: string[] | null;
/**
* Sample rate (in Hertz) of the audio content sent in the query. Refer to [Cloud Speech API documentation](https://cloud.google.com/speech-to-text/docs/basics) for more details.
*/
sampleRateHertz?: number | null;
/**
* Optional. If `false` (default), recognition does not cease until the client closes the stream. If `true`, the recognizer will detect a single spoken utterance in input audio. Recognition ceases when it detects the audio's voice has stopped or paused. In this case, once a detected intent is received, the client should close the stream and start a new request with a new stream as needed. Note: This setting is relevant only for streaming methods.
*/
singleUtterance?: boolean | null;
}
/**
* An intent represents a user's intent to interact with a conversational agent. You can provide information for the Dialogflow API to use to match user input to an intent by adding training phrases (i.e., examples of user input) to your intent.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1Intent {
/**
* Optional. Human readable description for better understanding an intent like its scope, content, result etc. Maximum character limit: 140 characters.
*/
description?: string | null;
/**
* Required. The human-readable name of the intent, unique within the agent.
*/
displayName?: string | null;
/**
* Indicates whether this is a fallback intent. Currently only default fallback intent is allowed in the agent, which is added upon agent creation. Adding training phrases to fallback intent is useful in the case of requests that are mistakenly matched, since training phrases assigned to fallback intents act as negative examples that triggers no-match event.
*/
isFallback?: boolean | null;
/**
* Optional. The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters from unicase alphabets. Keys must start with a letter. Keys and values can be no longer than 63 characters and no more than 128 bytes. Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed Dialogflow defined labels include: * sys-head * sys-contextual The above labels do not require value. "sys-head" means the intent is a head intent. "sys-contextual" means the intent is a contextual intent.
*/
labels?: {
[key: string]: string;
} | null;
/**
* The unique identifier of the intent. Required for the Intents.UpdateIntent method. Intents.CreateIntent populates the name automatically. Format: `projects//locations//agents//intents/`.
*/
name?: string | null;
/**
* The collection of parameters associated with the intent.
*/
parameters?: Schema$GoogleCloudDialogflowCxV3beta1IntentParameter[];
/**
* The priority of this intent. Higher numbers represent higher priorities. - If the supplied value is unspecified or 0, the service translates the value to 500,000, which corresponds to the `Normal` priority in the console. - If the supplied value is negative, the intent is ignored in runtime detect intent requests.
*/
priority?: number | null;
/**
* The collection of training phrases the agent is trained on to identify the intent.
*/
trainingPhrases?: Schema$GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase[];
}
/**
* Represents the intent to trigger programmatically rather than as a result of natural language processing.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1IntentInput {
/**
* Required. The unique identifier of the intent. Format: `projects//locations//agents//intents/`.
*/
intent?: string | null;
}
/**
* Represents an intent parameter.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1IntentParameter {
/**
* Required. The entity type of the parameter. Format: `projects/-/locations/-/agents/-/entityTypes/` for system entity types (for example, `projects/-/locations/-/agents/-/entityTypes/sys.date`), or `projects//locations//agents//entityTypes/` for developer entity types.
*/
entityType?: string | null;
/**
* Required. The unique identifier of the parameter. This field is used by training phrases to annotate their parts.
*/
id?: string | null;
/**
* Indicates whether the parameter represents a list of values.
*/
isList?: boolean | null;
/**
* Indicates whether the parameter content should be redacted in log. If redaction is enabled, the parameter content will be replaced by parameter name during logging. Note: the parameter content is subject to redaction if either parameter level redaction or entity type level redaction is enabled.
*/
redact?: boolean | null;
}
/**
* Represents an example that the agent is trained on to identify the intent.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1IntentTrainingPhrase {
/**
* Output only. The unique identifier of the training phrase.
*/
id?: string | null;
/**
* 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 `parameter_id` field is set.
*/
parts?: Schema$GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart[];
/**
* Indicates how many times this example was added to the intent.
*/
repeatCount?: number | null;
}
/**
* Represents a part of a training phrase.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1IntentTrainingPhrasePart {
/**
* The parameter used to annotate this part of the training phrase. This field is required for annotated parts of the training phrase.
*/
parameterId?: string | null;
/**
* Required. The text for this part.
*/
text?: string | null;
}
/**
* A Dialogflow CX conversation (session) can be described and visualized as a state machine. The states of a CX session are represented by pages. For each flow, you define many pages, where your combined pages can handle a complete conversation on the topics the flow is designed for. At any given moment, exactly one page is the current page, the current page is considered active, and the flow associated with that page is considered active. Every flow has a special start page. When a flow initially becomes active, the start page page becomes the current page. For each conversational turn, the current page will either stay the same or transition to another page. You configure each page to collect information from the end-user that is relevant for the conversational state represented by the page. For more information, see the [Page guide](https://cloud.google.com/dialogflow/cx/docs/concept/page).
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1Page {
/**
* Required. The human-readable name of the page, unique within the agent.
*/
displayName?: string | null;
/**
* The fulfillment to call when the session is entering the page.
*/
entryFulfillment?: Schema$GoogleCloudDialogflowCxV3beta1Fulfillment;
/**
* Handlers associated with the page to handle events such as webhook errors, no match or no input.
*/
eventHandlers?: Schema$GoogleCloudDialogflowCxV3beta1EventHandler[];
/**
* The form associated with the page, used for collecting parameters relevant to the page.
*/
form?: Schema$GoogleCloudDialogflowCxV3beta1Form;
/**
* The unique identifier of the page. Required for the Pages.UpdatePage method. Pages.CreatePage populates the name automatically. Format: `projects//locations//agents//flows//pages/`.
*/
name?: string | null;
/**
* Ordered list of `TransitionRouteGroups` associated with the page. Transition route groups must be unique within a page. * If multiple transition routes within a page scope refer to the same intent, then the precedence order is: page's transition route -\> page's transition route group -\> flow's transition routes. * If multiple transition route groups within a page contain the same intent, then the first group in the ordered list takes precedence. Format:`projects//locations//agents//flows//transitionRouteGroups/`.
*/
transitionRouteGroups?: string[] | null;
/**
* A list of transitions for the transition rules of this page. They route the conversation to another page in the same flow, or another flow. When we are in a certain page, the TransitionRoutes are evalauted in the following order: * TransitionRoutes defined in the page with intent specified. * TransitionRoutes defined in the transition route groups with intent specified. * TransitionRoutes defined in flow with intent specified. * TransitionRoutes defined in the transition route groups with intent specified. * TransitionRoutes defined in the page with only condition specified. * TransitionRoutes defined in the transition route groups with only condition specified.
*/
transitionRoutes?: Schema$GoogleCloudDialogflowCxV3beta1TransitionRoute[];
}
/**
* Represents page information communicated to and from the webhook.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1PageInfo {
/**
* Always present for WebhookRequest. Ignored for WebhookResponse. The unique identifier of the current page. Format: `projects//locations//agents//flows//pages/`.
*/
currentPage?: string | null;
/**
* Optional for both WebhookRequest and WebhookResponse. Information about the form.
*/
formInfo?: Schema$GoogleCloudDialogflowCxV3beta1PageInfoFormInfo;
}
/**
* Represents form information.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1PageInfoFormInfo {
/**
* Optional for both WebhookRequest and WebhookResponse. The parameters contained in the form. Note that the webhook cannot add or remove any form parameter.
*/
parameterInfo?: Schema$GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo[];
}
/**
* Represents parameter information.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1PageInfoFormInfoParameterInfo {
/**
* Always present for WebhookRequest. Required for WebhookResponse. The human-readable name of the parameter, unique within the form. This field cannot be modified by the webhook.
*/
displayName?: string | null;
/**
* Optional for WebhookRequest. Ignored for WebhookResponse. Indicates if the parameter value was just collected on the last conversation turn.
*/
justCollected?: boolean | null;
/**
* Optional for both WebhookRequest and WebhookResponse. Indicates whether the parameter is required. Optional parameters will not trigger prompts; however, they are filled if the user specifies them. Required parameters must be filled before form filling concludes.
*/
required?: boolean | null;
/**
* Always present for WebhookRequest. Required for WebhookResponse. The state of the parameter. This field can be set to INVALID by the webhook to invalidate the parameter; other values set by the webhook will be ignored.
*/
state?: string | null;
/**
* Optional for both WebhookRequest and WebhookResponse. The value of the parameter. This field can be set by the webhook to change the parameter value.
*/
value?: any | null;
}
/**
* Represents the query input. It can contain one of: 1. A conversational query in the form of text. 2. An intent query that specifies which intent to trigger. 3. Natural language speech audio to be processed. 4. An event to be triggered.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1QueryInput {
/**
* The natural language speech audio to be processed.
*/
audio?: Schema$GoogleCloudDialogflowCxV3beta1AudioInput;
/**
* The DTMF event to be handled.
*/
dtmf?: Schema$GoogleCloudDialogflowCxV3beta1DtmfInput;
/**
* The event to be triggered.
*/
event?: Schema$GoogleCloudDialogflowCxV3beta1EventInput;
/**
* The intent to be triggered.
*/
intent?: Schema$GoogleCloudDialogflowCxV3beta1IntentInput;
/**
* Required. The language of the input. See [Language Support](https://cloud.google.com/dialogflow/cx/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 | null;
/**
* The natural language text to be processed.
*/
text?: Schema$GoogleCloudDialogflowCxV3beta1TextInput;
}
/**
* Metadata for ReloadDocument operation.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ReloadDocumentOperationMetadata {
/**
* The generic information of the operation.
*/
genericMetadata?: Schema$GoogleCloudDialogflowCxV3beta1GenericKnowledgeOperationMetadata;
}
/**
* Represents a response message that can be returned by a conversational agent. Response messages are also used for output audio synthesis. The approach is as follows: * If at least one OutputAudioText response is present, then all OutputAudioText responses are linearly concatenated, and the result is used for output audio synthesis. * If the OutputAudioText responses are a mixture of text and SSML, then the concatenated result is treated as SSML; otherwise, the result is treated as either text or SSML as appropriate. The agent designer should ideally use either text or SSML consistently throughout the bot design. * Otherwise, all Text responses are linearly concatenated, and the result is used for output audio synthesis. This approach allows for more sophisticated user experience scenarios, where the text displayed to the user may differ from what is heard.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ResponseMessage {
/**
* Indicates that the conversation succeeded.
*/
conversationSuccess?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess;
/**
* Output only. A signal that indicates the interaction with the Dialogflow agent has ended. This message is generated by Dialogflow only when the conversation reaches `END_SESSION` page. It is not supposed to be defined by the user. It's guaranteed that there is at most one such message in each response.
*/
endInteraction?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction;
/**
* Hands off conversation to a human agent.
*/
liveAgentHandoff?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff;
/**
* Output only. An audio response message composed of both the synthesized Dialogflow agent responses and responses defined via play_audio. This message is generated by Dialogflow only and not supposed to be defined by the user.
*/
mixedAudio?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio;
/**
* A text or ssml response that is preferentially used for TTS output audio synthesis, as described in the comment on the ResponseMessage message.
*/
outputAudioText?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText;
/**
* Returns a response containing a custom, platform-specific payload.
*/
payload?: {
[key: string]: any;
} | null;
/**
* Signal that the client should play an audio clip hosted at a client-specific URI. Dialogflow uses this to construct mixed_audio. However, Dialogflow itself does not try to read or process the URI in any way.
*/
playAudio?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio;
/**
* Returns a text response.
*/
text?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageText;
}
/**
* Indicates that the conversation succeeded, i.e., the bot handled the issue that the customer talked to it about. Dialogflow only uses this to determine which conversations should be counted as successful and doesn't process the metadata in this message in any way. Note that Dialogflow also considers conversations that get to the conversation end page as successful even if they don't return ConversationSuccess. You may set this, for example: * In the entry_fulfillment of a Page if entering the page indicates that the conversation succeeded. * In a webhook response when you determine that you handled the customer issue.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageConversationSuccess {
/**
* Custom metadata. Dialogflow doesn't impose any structure on this.
*/
metadata?: {
[key: string]: any;
} | null;
}
/**
* Indicates that interaction with the Dialogflow agent has ended. This message is generated by Dialogflow only and not supposed to be defined by the user.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageEndInteraction {
}
/**
* Indicates that the conversation should be handed off to a live agent. Dialogflow only uses this to determine which conversations were handed off to a human agent for measurement purposes. What else to do with this signal is up to you and your handoff procedures. You may set this, for example: * In the entry_fulfillment of a Page if entering the page indicates something went extremely wrong in the conversation. * In a webhook response when you determine that the customer issue can only be handled by a human.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageLiveAgentHandoff {
/**
* Custom metadata for your handoff procedure. Dialogflow doesn't impose any structure on this.
*/
metadata?: {
[key: string]: any;
} | null;
}
/**
* Represents an audio message that is composed of both segments synthesized from the Dialogflow agent prompts and ones hosted externally at the specified URIs. The external URIs are specified via play_audio. This message is generated by Dialogflow only and not supposed to be defined by the user.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudio {
/**
* Segments this audio response is composed of.
*/
segments?: Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment[];
}
/**
* Represents one segment of audio.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageMixedAudioSegment {
/**
* Output only. Whether the playback of this segment can be interrupted by the end user's speech and the client should then start the next Dialogflow request.
*/
allowPlaybackInterruption?: boolean | null;
/**
* Raw audio synthesized from the Dialogflow agent's response using the output config specified in the request.
*/
audio?: string | null;
/**
* Client-specific URI that points to an audio clip accessible to the client. Dialogflow does not impose any validation on it.
*/
uri?: string | null;
}
/**
* A text or ssml response that is preferentially used for TTS output audio synthesis, as described in the comment on the ResponseMessage message.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageOutputAudioText {
/**
* Output only. Whether the playback of this message can be interrupted by the end user's speech and the client can then starts the next Dialogflow request.
*/
allowPlaybackInterruption?: boolean | null;
/**
* The SSML text to be synthesized. For more information, see [SSML](/speech/text-to-speech/docs/ssml).
*/
ssml?: string | null;
/**
* The raw text to be synthesized.
*/
text?: string | null;
}
/**
* Specifies an audio clip to be played by the client as part of the response.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ResponseMessagePlayAudio {
/**
* Output only. Whether the playback of this message can be interrupted by the end user's speech and the client can then starts the next Dialogflow request.
*/
allowPlaybackInterruption?: boolean | null;
/**
* Required. URI of the audio clip. Dialogflow does not impose any validation on this value. It is specific to the client that reads it.
*/
audioUri?: string | null;
}
/**
* The text response message.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1ResponseMessageText {
/**
* Output only. Whether the playback of this message can be interrupted by the end user's speech and the client can then starts the next Dialogflow request.
*/
allowPlaybackInterruption?: boolean | null;
/**
* Required. A collection of text responses.
*/
text?: string[] | null;
}
/**
* Metadata returned for the TestCases.RunTestCase long running operation.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1RunTestCaseMetadata {
}
/**
* The response message for TestCases.RunTestCase.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1RunTestCaseResponse {
/**
* The result.
*/
result?: Schema$GoogleCloudDialogflowCxV3beta1TestCaseResult;
}
/**
* Represents session information communicated to and from the webhook.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1SessionInfo {
/**
* Optional for WebhookRequest. Optional for WebhookResponse. All parameters collected from forms and intents during the session. Parameters can be created, updated, or removed by the webhook. To remove a parameter from the session, the webhook should explicitly set the parameter value to null in WebhookResponse. The map is keyed by parameters' display names.
*/
parameters?: {
[key: string]: any;
} | null;
/**
* Always present for WebhookRequest. Ignored for WebhookResponse. The unique identifier of the session. This field can be used by the webhook to identify a session. Format: `projects//locations//agents//sessions/` or `projects//locations//agents//environments//sessions/` if environment is specified.
*/
session?: string | null;
}
/**
* Represents a test case.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1TestCase {
/**
* Output only. When the test was created.
*/
creationTime?: string | null;
/**
* Required. The human-readable name of the test case, unique within the agent. Limit of 200 characters.
*/
displayName?: string | null;
/**
* The latest test result.
*/
lastTestResult?: Schema$GoogleCloudDialogflowCxV3beta1TestCaseResult;
/**
* The unique identifier of the test case. TestCases.CreateTestCase will populate the name automatically. Otherwise use format: `projects//locations//agents/ /testCases/`.
*/
name?: string | null;
/**
* Additional freeform notes about the test case. Limit of 400 characters.
*/
notes?: string | null;
/**
* Tags are short descriptions that users may apply to test cases for organizational and filtering purposes. Each tag should start with "#" and has a limit of 30 characters.
*/
tags?: string[] | null;
/**
* The conversation turns uttered when the test case was created, in chronological order. These include the canonical set of agent utterances that should occur when the agent is working properly.
*/
testCaseConversationTurns?: Schema$GoogleCloudDialogflowCxV3beta1ConversationTurn[];
/**
* Config for the test case.
*/
testConfig?: Schema$GoogleCloudDialogflowCxV3beta1TestConfig;
}
/**
* Error info for importing a test.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1TestCaseError {
/**
* The status associated with the test case.
*/
status?: Schema$GoogleRpcStatus;
/**
* The test case.
*/
testCase?: Schema$GoogleCloudDialogflowCxV3beta1TestCase;
}
/**
* Represents a result from running a test case in an agent environment.
*/
export interface Schema$GoogleCloudDialogflowCxV3beta1TestCaseResult {
/**
* The conversation turns uttered during the test case replay in chronological order.
*/
conversationTurns?: Schema$GoogleCloudDialogflowCxV3beta1ConversationTurn[];
/**
* Environment where the test was run. If not set, it indicates the draft environment.
*/