UNPKG

@google-cloud/dialogflow

Version:
753 lines 120 kB
import type * as gax from 'google-gax'; import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, LocationsClient, LocationProtos } from 'google-gax'; import { Transform } from 'stream'; import * as protos from '../../protos/protos'; /** * Service for managing * {@link protos.google.cloud.dialogflow.v2.Conversation|Conversations}. * @class * @memberof v2 */ export declare class ConversationsClient { private _terminated; private _opts; private _providedCustomServicePath; private _gaxModule; private _gaxGrpc; private _protos; private _defaults; private _universeDomain; private _servicePath; private _log; auth: gax.GoogleAuth; descriptors: Descriptors; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: { [name: string]: Function; }; locationsClient: LocationsClient; pathTemplates: { [name: string]: gax.PathTemplate; }; conversationsStub?: Promise<{ [name: string]: Function; }>; /** * Construct an instance of ConversationsClient. * * @param {object} [options] - The configuration object. * The options accepted by the constructor are described in detail * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). * The common options are: * @param {object} [options.credentials] - Credentials object. * @param {string} [options.credentials.client_email] * @param {string} [options.credentials.private_key] * @param {string} [options.email] - Account email address. Required when * using a .pem or .p12 keyFilename. * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or * .p12 key downloaded from the Google Developers Console. If you provide * a path to a JSON file, the projectId option below is not necessary. * NOTE: .pem and .p12 require you to specify options.email as well. * @param {number} [options.port] - The port on which to connect to * the remote host. * @param {string} [options.projectId] - The project ID from the Google * Developer's Console, e.g. 'grape-spaceship-123'. We will also check * the environment variable GCLOUD_PROJECT for your project ID. If your * app is running in an environment which supports * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. * For more information, please check the * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you * need to avoid loading the default gRPC version and want to use the fallback * HTTP implementation. Load only fallback version and pass it to the constructor: * ``` * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC * const client = new ConversationsClient({fallback: true}, gax); * ``` */ constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback); /** * Initialize the client. * Performs asynchronous operations (such as authentication) and prepares the client. * This function will be called automatically when any class method is called for the * first time, but if you need to initialize it before calling an actual method, * feel free to call initialize() directly. * * You can await on this method if you want to make sure the client is initialized. * * @returns {Promise} A promise that resolves to an authenticated service stub. */ initialize(): Promise<{ [name: string]: Function; }>; /** * The DNS address for this API service. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get servicePath(): string; /** * The DNS address for this API service - same as servicePath. * @deprecated Use the apiEndpoint method of the client instance. * @returns {string} The DNS address for this service. */ static get apiEndpoint(): string; /** * The DNS address for this API service. * @returns {string} The DNS address for this service. */ get apiEndpoint(): string; get universeDomain(): string; /** * The port for this API service. * @returns {number} The default port for this service. */ static get port(): number; /** * The scopes needed to make gRPC calls for every method defined * in this service. * @returns {string[]} List of default scopes. */ static get scopes(): string[]; getProjectId(): Promise<string>; getProjectId(callback: Callback<string, undefined, undefined>): void; /** * Creates a new conversation. Conversations are auto-completed after 24 * hours. * * Conversation Lifecycle: * There are two stages during a conversation: Automated Agent Stage and * Assist Stage. * * For Automated Agent Stage, there will be a dialogflow agent responding to * user queries. * * For Assist Stage, there's no dialogflow agent responding to user queries. * But we will provide suggestions which are generated from conversation. * * If * {@link protos.google.cloud.dialogflow.v2.Conversation.conversation_profile|Conversation.conversation_profile} * is configured for a dialogflow agent, conversation will start from * `Automated Agent Stage`, otherwise, it will start from `Assist Stage`. And * during `Automated Agent Stage`, once an * {@link protos.google.cloud.dialogflow.v2.Intent|Intent} with * {@link protos.google.cloud.dialogflow.v2.Intent.live_agent_handoff|Intent.live_agent_handoff} * is triggered, conversation will transfer to Assist Stage. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. Resource identifier of the project creating the conversation. * Format: `projects/<Project ID>/locations/<Location ID>`. * @param {google.cloud.dialogflow.v2.Conversation} request.conversation * Required. The conversation to create. * @param {string} [request.conversationId] * Optional. Identifier of the conversation. Generally it's auto generated by * Google. Only set it if you cannot wait for the response to return a * auto-generated one to you. * * The conversation ID must be compliant with the regression formula * `{@link protos.a-zA-Z0-9_-|a-zA-Z}*` with the characters length in range of [3,64]. * If the field is provided, the caller is responsible for * 1. the uniqueness of the ID, otherwise the request will be rejected. * 2. the consistency for whether to use custom ID or not under a project to * better ensure uniqueness. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.dialogflow.v2.Conversation|Conversation}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.create_conversation.js</caption> * region_tag:dialogflow_v2_generated_Conversations_CreateConversation_async */ createConversation(request?: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.IConversation, protos.google.cloud.dialogflow.v2.ICreateConversationRequest | undefined, {} | undefined ]>; createConversation(request: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, options: CallOptions, callback: Callback<protos.google.cloud.dialogflow.v2.IConversation, protos.google.cloud.dialogflow.v2.ICreateConversationRequest | null | undefined, {} | null | undefined>): void; createConversation(request: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, callback: Callback<protos.google.cloud.dialogflow.v2.IConversation, protos.google.cloud.dialogflow.v2.ICreateConversationRequest | null | undefined, {} | null | undefined>): void; /** * Retrieves the specific conversation. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the conversation. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.dialogflow.v2.Conversation|Conversation}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.get_conversation.js</caption> * region_tag:dialogflow_v2_generated_Conversations_GetConversation_async */ getConversation(request?: protos.google.cloud.dialogflow.v2.IGetConversationRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.IConversation, protos.google.cloud.dialogflow.v2.IGetConversationRequest | undefined, {} | undefined ]>; getConversation(request: protos.google.cloud.dialogflow.v2.IGetConversationRequest, options: CallOptions, callback: Callback<protos.google.cloud.dialogflow.v2.IConversation, protos.google.cloud.dialogflow.v2.IGetConversationRequest | null | undefined, {} | null | undefined>): void; getConversation(request: protos.google.cloud.dialogflow.v2.IGetConversationRequest, callback: Callback<protos.google.cloud.dialogflow.v2.IConversation, protos.google.cloud.dialogflow.v2.IGetConversationRequest | null | undefined, {} | null | undefined>): void; /** * Completes the specified conversation. Finished conversations are purged * from the database after 30 days. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. Resource identifier of the conversation to close. * Format: `projects/<Project ID>/locations/<Location * ID>/conversations/<Conversation ID>`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.dialogflow.v2.Conversation|Conversation}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.complete_conversation.js</caption> * region_tag:dialogflow_v2_generated_Conversations_CompleteConversation_async */ completeConversation(request?: protos.google.cloud.dialogflow.v2.ICompleteConversationRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.IConversation, protos.google.cloud.dialogflow.v2.ICompleteConversationRequest | undefined, {} | undefined ]>; completeConversation(request: protos.google.cloud.dialogflow.v2.ICompleteConversationRequest, options: CallOptions, callback: Callback<protos.google.cloud.dialogflow.v2.IConversation, protos.google.cloud.dialogflow.v2.ICompleteConversationRequest | null | undefined, {} | null | undefined>): void; completeConversation(request: protos.google.cloud.dialogflow.v2.ICompleteConversationRequest, callback: Callback<protos.google.cloud.dialogflow.v2.IConversation, protos.google.cloud.dialogflow.v2.ICompleteConversationRequest | null | undefined, {} | null | undefined>): void; /** * Data ingestion API. * Ingests context references for an existing conversation. * * @param {Object} request * The request object that will be sent. * @param {string} request.conversation * Required. Resource identifier of the conversation to ingest context * information for. Format: `projects/<Project ID>/locations/<Location * ID>/conversations/<Conversation ID>`. * @param {number[]} request.contextReferences * Required. The context references to ingest. The key is the name of the * context reference and the value contains the contents of the context * reference. The key is used to incorporate ingested context references to * enhance the generator. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.dialogflow.v2.IngestContextReferencesResponse|IngestContextReferencesResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.ingest_context_references.js</caption> * region_tag:dialogflow_v2_generated_Conversations_IngestContextReferences_async */ ingestContextReferences(request?: protos.google.cloud.dialogflow.v2.IIngestContextReferencesRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.IIngestContextReferencesResponse, protos.google.cloud.dialogflow.v2.IIngestContextReferencesRequest | undefined, {} | undefined ]>; ingestContextReferences(request: protos.google.cloud.dialogflow.v2.IIngestContextReferencesRequest, options: CallOptions, callback: Callback<protos.google.cloud.dialogflow.v2.IIngestContextReferencesResponse, protos.google.cloud.dialogflow.v2.IIngestContextReferencesRequest | null | undefined, {} | null | undefined>): void; ingestContextReferences(request: protos.google.cloud.dialogflow.v2.IIngestContextReferencesRequest, callback: Callback<protos.google.cloud.dialogflow.v2.IIngestContextReferencesResponse, protos.google.cloud.dialogflow.v2.IIngestContextReferencesRequest | null | undefined, {} | null | undefined>): void; /** * Suggests summary for a conversation based on specific historical messages. * The range of the messages to be used for summary can be specified in the * request. * * @param {Object} request * The request object that will be sent. * @param {string} request.conversation * Required. The conversation to fetch suggestion for. * Format: `projects/<Project ID>/locations/<Location * ID>/conversations/<Conversation ID>`. * @param {string} [request.latestMessage] * Optional. The name of the latest conversation message used as context for * compiling suggestion. If empty, the latest message of the conversation will * be used. * * Format: `projects/<Project ID>/locations/<Location * ID>/conversations/<Conversation ID>/messages/<Message ID>`. * @param {number} [request.contextSize] * Optional. Max number of messages prior to and including * [latest_message] to use as context when compiling the * suggestion. By default 500 and at most 1000. * @param {google.cloud.dialogflow.v2.AssistQueryParameters} [request.assistQueryParams] * Optional. Parameters for a human assist query. Only used for POC/demo * purpose. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.dialogflow.v2.SuggestConversationSummaryResponse|SuggestConversationSummaryResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.suggest_conversation_summary.js</caption> * region_tag:dialogflow_v2_generated_Conversations_SuggestConversationSummary_async */ suggestConversationSummary(request?: protos.google.cloud.dialogflow.v2.ISuggestConversationSummaryRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.ISuggestConversationSummaryResponse, protos.google.cloud.dialogflow.v2.ISuggestConversationSummaryRequest | undefined, {} | undefined ]>; suggestConversationSummary(request: protos.google.cloud.dialogflow.v2.ISuggestConversationSummaryRequest, options: CallOptions, callback: Callback<protos.google.cloud.dialogflow.v2.ISuggestConversationSummaryResponse, protos.google.cloud.dialogflow.v2.ISuggestConversationSummaryRequest | null | undefined, {} | null | undefined>): void; suggestConversationSummary(request: protos.google.cloud.dialogflow.v2.ISuggestConversationSummaryRequest, callback: Callback<protos.google.cloud.dialogflow.v2.ISuggestConversationSummaryResponse, protos.google.cloud.dialogflow.v2.ISuggestConversationSummaryRequest | null | undefined, {} | null | undefined>): void; /** * Generates and returns a summary for a conversation that does not have a * resource created for it. * * @param {Object} request * The request object that will be sent. * @param {google.cloud.dialogflow.v2.GenerateStatelessSummaryRequest.MinimalConversation} request.statelessConversation * Required. The conversation to suggest a summary for. * @param {google.cloud.dialogflow.v2.ConversationProfile} request.conversationProfile * Required. A ConversationProfile containing information required for Summary * generation. * Required fields: {language_code, security_settings} * Optional fields: {agent_assistant_config} * @param {string} [request.latestMessage] * Optional. The name of the latest conversation message used as context for * generating a Summary. If empty, the latest message of the conversation will * be used. The format is specific to the user and the names of the messages * provided. * @param {number} [request.maxContextSize] * Optional. Max number of messages prior to and including * [latest_message] to use as context when compiling the * suggestion. By default 500 and at most 1000. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.dialogflow.v2.GenerateStatelessSummaryResponse|GenerateStatelessSummaryResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.generate_stateless_summary.js</caption> * region_tag:dialogflow_v2_generated_Conversations_GenerateStatelessSummary_async */ generateStatelessSummary(request?: protos.google.cloud.dialogflow.v2.IGenerateStatelessSummaryRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.IGenerateStatelessSummaryResponse, protos.google.cloud.dialogflow.v2.IGenerateStatelessSummaryRequest | undefined, {} | undefined ]>; generateStatelessSummary(request: protos.google.cloud.dialogflow.v2.IGenerateStatelessSummaryRequest, options: CallOptions, callback: Callback<protos.google.cloud.dialogflow.v2.IGenerateStatelessSummaryResponse, protos.google.cloud.dialogflow.v2.IGenerateStatelessSummaryRequest | null | undefined, {} | null | undefined>): void; generateStatelessSummary(request: protos.google.cloud.dialogflow.v2.IGenerateStatelessSummaryRequest, callback: Callback<protos.google.cloud.dialogflow.v2.IGenerateStatelessSummaryResponse, protos.google.cloud.dialogflow.v2.IGenerateStatelessSummaryRequest | null | undefined, {} | null | undefined>): void; /** * Generates and returns a suggestion for a conversation that does not have a * resource created for it. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The parent resource to charge for the Suggestion's generation. * Format: `projects/<Project ID>/locations/<Location ID>`. * @param {google.cloud.dialogflow.v2.Generator} request.generator * Uncreated generator. It should be a complete generator that includes all * information about the generator. * @param {string} request.generatorName * The resource name of the existing created generator. Format: * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>` * @param {number[]} [request.contextReferences] * Optional. A section of ingested context information. The key is the name of * the context reference and the value contains the contents of the context * reference. The key is used to incorporate ingested context references to * enhance the generator. * @param {google.cloud.dialogflow.v2.ConversationContext} [request.conversationContext] * Optional. Context of the conversation, including transcripts. * @param {number[]} [request.triggerEvents] * Optional. A list of trigger events. Generator will be triggered only if * it's trigger event is included here. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.dialogflow.v2.GenerateStatelessSuggestionResponse|GenerateStatelessSuggestionResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.generate_stateless_suggestion.js</caption> * region_tag:dialogflow_v2_generated_Conversations_GenerateStatelessSuggestion_async */ generateStatelessSuggestion(request?: protos.google.cloud.dialogflow.v2.IGenerateStatelessSuggestionRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.IGenerateStatelessSuggestionResponse, protos.google.cloud.dialogflow.v2.IGenerateStatelessSuggestionRequest | undefined, {} | undefined ]>; generateStatelessSuggestion(request: protos.google.cloud.dialogflow.v2.IGenerateStatelessSuggestionRequest, options: CallOptions, callback: Callback<protos.google.cloud.dialogflow.v2.IGenerateStatelessSuggestionResponse, protos.google.cloud.dialogflow.v2.IGenerateStatelessSuggestionRequest | null | undefined, {} | null | undefined>): void; generateStatelessSuggestion(request: protos.google.cloud.dialogflow.v2.IGenerateStatelessSuggestionRequest, callback: Callback<protos.google.cloud.dialogflow.v2.IGenerateStatelessSuggestionResponse, protos.google.cloud.dialogflow.v2.IGenerateStatelessSuggestionRequest | null | undefined, {} | null | undefined>): void; /** * Get answers for the given query based on knowledge documents. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The parent resource contains the conversation profile * Format: 'projects/<Project ID>' or `projects/<Project * ID>/locations/<Location ID>`. * @param {google.cloud.dialogflow.v2.TextInput} request.query * Required. The natural language text query for knowledge search. * @param {string} request.conversationProfile * Required. The conversation profile used to configure the search. * Format: `projects/<Project ID>/locations/<Location * ID>/conversationProfiles/<Conversation Profile ID>`. * @param {string} request.sessionId * Required. The ID of the search session. * The session_id can be combined with Dialogflow V3 Agent ID retrieved from * conversation profile or on its own to identify a search session. The search * history of the same session will impact the search result. It's up to the * API caller to choose an appropriate `Session ID`. It can be a random number * or some type of session identifiers (preferably hashed). The length must * not exceed 36 characters. * @param {string} [request.conversation] * Optional. The conversation (between human agent and end user) where the * search request is triggered. Format: `projects/<Project * ID>/locations/<Location ID>/conversations/<Conversation ID>`. * @param {string} [request.latestMessage] * Optional. The name of the latest conversation message when the request is * triggered. * Format: `projects/<Project ID>/locations/<Location * ID>/conversations/<Conversation ID>/messages/<Message ID>`. * @param {google.cloud.dialogflow.v2.SearchKnowledgeRequest.QuerySource} [request.querySource] * Optional. The source of the query in the request. * @param {google.protobuf.Struct} [request.endUserMetadata] * Optional. Information about the end-user to improve the relevance and * accuracy of generative answers. * * This will be interpreted and used by a language model, so, for good * results, the data should be self-descriptive, and in a simple structure. * * Example: * * ```json * { * "subscription plan": "Business Premium Plus", * "devices owned": [ * {"model": "Google Pixel 7"}, * {"model": "Google Pixel Tablet"} * ] * } * ``` * @param {google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig} [request.searchConfig] * Optional. Configuration specific to search queries with data stores. * @param {boolean} [request.exactSearch] * Optional. Whether to search the query exactly without query rewrite. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.dialogflow.v2.SearchKnowledgeResponse|SearchKnowledgeResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.search_knowledge.js</caption> * region_tag:dialogflow_v2_generated_Conversations_SearchKnowledge_async */ searchKnowledge(request?: protos.google.cloud.dialogflow.v2.ISearchKnowledgeRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.ISearchKnowledgeResponse, protos.google.cloud.dialogflow.v2.ISearchKnowledgeRequest | undefined, {} | undefined ]>; searchKnowledge(request: protos.google.cloud.dialogflow.v2.ISearchKnowledgeRequest, options: CallOptions, callback: Callback<protos.google.cloud.dialogflow.v2.ISearchKnowledgeResponse, protos.google.cloud.dialogflow.v2.ISearchKnowledgeRequest | null | undefined, {} | null | undefined>): void; searchKnowledge(request: protos.google.cloud.dialogflow.v2.ISearchKnowledgeRequest, callback: Callback<protos.google.cloud.dialogflow.v2.ISearchKnowledgeResponse, protos.google.cloud.dialogflow.v2.ISearchKnowledgeRequest | null | undefined, {} | null | undefined>): void; /** * Generates all the suggestions using generators configured in the * conversation profile. A generator is used only if its trigger event is * matched. * * @param {Object} request * The request object that will be sent. * @param {string} request.conversation * Required. The conversation for which the suggestions are generated. Format: * `projects/<Project ID>/locations/<Location * ID>/conversations/<Conversation ID>`. * * The conversation must be created with a conversation profile which has * generators configured in it to be able to get suggestions. * @param {string} [request.latestMessage] * Optional. The name of the latest conversation message for which the request * is triggered. Format: `projects/<Project ID>/locations/<Location * ID>/conversations/<Conversation ID>/messages/<Message ID>`. * @param {number[]} [request.triggerEvents] * Optional. A list of trigger events. Only generators configured in the * conversation_profile whose trigger_event is listed here will be triggered. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link protos.google.cloud.dialogflow.v2.GenerateSuggestionsResponse|GenerateSuggestionsResponse}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.generate_suggestions.js</caption> * region_tag:dialogflow_v2_generated_Conversations_GenerateSuggestions_async */ generateSuggestions(request?: protos.google.cloud.dialogflow.v2.IGenerateSuggestionsRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.IGenerateSuggestionsResponse, protos.google.cloud.dialogflow.v2.IGenerateSuggestionsRequest | undefined, {} | undefined ]>; generateSuggestions(request: protos.google.cloud.dialogflow.v2.IGenerateSuggestionsRequest, options: CallOptions, callback: Callback<protos.google.cloud.dialogflow.v2.IGenerateSuggestionsResponse, protos.google.cloud.dialogflow.v2.IGenerateSuggestionsRequest | null | undefined, {} | null | undefined>): void; generateSuggestions(request: protos.google.cloud.dialogflow.v2.IGenerateSuggestionsRequest, callback: Callback<protos.google.cloud.dialogflow.v2.IGenerateSuggestionsResponse, protos.google.cloud.dialogflow.v2.IGenerateSuggestionsRequest | null | undefined, {} | null | undefined>): void; /** * Returns the list of all conversations in the specified project. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The project from which to list all conversation. * Format: `projects/<Project ID>/locations/<Location ID>`. * @param {number} [request.pageSize] * Optional. The maximum number of items to return in a single page. By * default 100 and at most 1000. * @param {string} [request.pageToken] * Optional. The next_page_token value returned from a previous list request. * @param {string} [request.filter] * Optional. A filter expression that filters conversations listed in the * response. Only `lifecycle_state` can be filtered on in this way. For * example, the following expression only returns `COMPLETED` conversations: * * `lifecycle_state = "COMPLETED"` * * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of {@link protos.google.cloud.dialogflow.v2.Conversation|Conversation}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. * We recommend using `listConversationsAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listConversations(request?: protos.google.cloud.dialogflow.v2.IListConversationsRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.IConversation[], protos.google.cloud.dialogflow.v2.IListConversationsRequest | null, protos.google.cloud.dialogflow.v2.IListConversationsResponse ]>; listConversations(request: protos.google.cloud.dialogflow.v2.IListConversationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.dialogflow.v2.IListConversationsRequest, protos.google.cloud.dialogflow.v2.IListConversationsResponse | null | undefined, protos.google.cloud.dialogflow.v2.IConversation>): void; listConversations(request: protos.google.cloud.dialogflow.v2.IListConversationsRequest, callback: PaginationCallback<protos.google.cloud.dialogflow.v2.IListConversationsRequest, protos.google.cloud.dialogflow.v2.IListConversationsResponse | null | undefined, protos.google.cloud.dialogflow.v2.IConversation>): void; /** * Equivalent to `listConversations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The project from which to list all conversation. * Format: `projects/<Project ID>/locations/<Location ID>`. * @param {number} [request.pageSize] * Optional. The maximum number of items to return in a single page. By * default 100 and at most 1000. * @param {string} [request.pageToken] * Optional. The next_page_token value returned from a previous list request. * @param {string} [request.filter] * Optional. A filter expression that filters conversations listed in the * response. Only `lifecycle_state` can be filtered on in this way. For * example, the following expression only returns `COMPLETED` conversations: * * `lifecycle_state = "COMPLETED"` * * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing {@link protos.google.cloud.dialogflow.v2.Conversation|Conversation} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listConversationsAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listConversationsStream(request?: protos.google.cloud.dialogflow.v2.IListConversationsRequest, options?: CallOptions): Transform; /** * Equivalent to `listConversations`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The project from which to list all conversation. * Format: `projects/<Project ID>/locations/<Location ID>`. * @param {number} [request.pageSize] * Optional. The maximum number of items to return in a single page. By * default 100 and at most 1000. * @param {string} [request.pageToken] * Optional. The next_page_token value returned from a previous list request. * @param {string} [request.filter] * Optional. A filter expression that filters conversations listed in the * response. Only `lifecycle_state` can be filtered on in this way. For * example, the following expression only returns `COMPLETED` conversations: * * `lifecycle_state = "COMPLETED"` * * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing * {@link protos.google.cloud.dialogflow.v2.Conversation|Conversation}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.list_conversations.js</caption> * region_tag:dialogflow_v2_generated_Conversations_ListConversations_async */ listConversationsAsync(request?: protos.google.cloud.dialogflow.v2.IListConversationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.dialogflow.v2.IConversation>; /** * Lists messages that belong to a given conversation. * `messages` are ordered by `create_time` in descending order. To fetch * updates without duplication, send request with filter * `create_time_epoch_microseconds > * [first item's create_time of previous request]` and empty page_token. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the conversation to list messages for. * Format: `projects/<Project ID>/locations/<Location * ID>/conversations/<Conversation ID>` * @param {string} [request.filter] * Optional. Filter on message fields. Currently predicates on `create_time` * and `create_time_epoch_microseconds` are supported. `create_time` only * support milliseconds accuracy. E.g., * `create_time_epoch_microseconds > 1551790877964485` or * `create_time > 2017-01-15T01:30:15.01Z`. * * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @param {number} [request.pageSize] * Optional. The maximum number of items to return in a single page. By * default 100 and at most 1000. * @param {string} [request.pageToken] * Optional. The next_page_token value returned from a previous list request. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is Array of {@link protos.google.cloud.dialogflow.v2.Message|Message}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. * We recommend using `listMessagesAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listMessages(request?: protos.google.cloud.dialogflow.v2.IListMessagesRequest, options?: CallOptions): Promise<[ protos.google.cloud.dialogflow.v2.IMessage[], protos.google.cloud.dialogflow.v2.IListMessagesRequest | null, protos.google.cloud.dialogflow.v2.IListMessagesResponse ]>; listMessages(request: protos.google.cloud.dialogflow.v2.IListMessagesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.dialogflow.v2.IListMessagesRequest, protos.google.cloud.dialogflow.v2.IListMessagesResponse | null | undefined, protos.google.cloud.dialogflow.v2.IMessage>): void; listMessages(request: protos.google.cloud.dialogflow.v2.IListMessagesRequest, callback: PaginationCallback<protos.google.cloud.dialogflow.v2.IListMessagesRequest, protos.google.cloud.dialogflow.v2.IListMessagesResponse | null | undefined, protos.google.cloud.dialogflow.v2.IMessage>): void; /** * Equivalent to `listMessages`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the conversation to list messages for. * Format: `projects/<Project ID>/locations/<Location * ID>/conversations/<Conversation ID>` * @param {string} [request.filter] * Optional. Filter on message fields. Currently predicates on `create_time` * and `create_time_epoch_microseconds` are supported. `create_time` only * support milliseconds accuracy. E.g., * `create_time_epoch_microseconds > 1551790877964485` or * `create_time > 2017-01-15T01:30:15.01Z`. * * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @param {number} [request.pageSize] * Optional. The maximum number of items to return in a single page. By * default 100 and at most 1000. * @param {string} [request.pageToken] * Optional. The next_page_token value returned from a previous list request. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} * An object stream which emits an object representing {@link protos.google.cloud.dialogflow.v2.Message|Message} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. * We recommend using `listMessagesAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ listMessagesStream(request?: protos.google.cloud.dialogflow.v2.IListMessagesRequest, options?: CallOptions): Transform; /** * Equivalent to `listMessages`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The name of the conversation to list messages for. * Format: `projects/<Project ID>/locations/<Location * ID>/conversations/<Conversation ID>` * @param {string} [request.filter] * Optional. Filter on message fields. Currently predicates on `create_time` * and `create_time_epoch_microseconds` are supported. `create_time` only * support milliseconds accuracy. E.g., * `create_time_epoch_microseconds > 1551790877964485` or * `create_time > 2017-01-15T01:30:15.01Z`. * * For more information about filtering, see * [API Filtering](https://aip.dev/160). * @param {number} [request.pageSize] * Optional. The maximum number of items to return in a single page. By * default 100 and at most 1000. * @param {string} [request.pageToken] * Optional. The next_page_token value returned from a previous list request. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing * {@link protos.google.cloud.dialogflow.v2.Message|Message}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. * @example <caption>include:samples/generated/v2/conversations.list_messages.js</caption> * region_tag:dialogflow_v2_generated_Conversations_ListMessages_async */ listMessagesAsync(request?: protos.google.cloud.dialogflow.v2.IListMessagesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.dialogflow.v2.IMessage>; /** * Gets information about a location. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Resource name for the location. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. * @example * ``` * const [response] = await client.getLocation(request); * ``` */ getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>; /** * Lists information about the supported locations for this service. Returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.name * The resource that owns the locations collection, if applicable. * @param {string} request.filter * The standard list filter. * @param {number} request.pageSize * The standard list page size. * @param {string} request.pageToken * The standard list page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing * {@link google.cloud.location.Location | Location}. The API will be called