diff --git a/protos/google/cloud/dialogflow/cx/v3/agent.proto b/protos/google/cloud/dialogflow/cx/v3/agent.proto index b583a5a7..2bf1c8f7 100644 --- a/protos/google/cloud/dialogflow/cx/v3/agent.proto +++ b/protos/google/cloud/dialogflow/cx/v3/agent.proto @@ -58,6 +58,10 @@ service Agents { } // Creates an agent in the specified location. + // + // Note: You should always train flows prior to sending them queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc CreateAgent(CreateAgentRequest) returns (Agent) { option (google.api.http) = { post: "/v3/{parent=projects/*/locations/*}/agents" @@ -67,6 +71,10 @@ service Agents { } // Updates the specified agent. + // + // Note: You should always train flows prior to sending them queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc UpdateAgent(UpdateAgentRequest) returns (Agent) { option (google.api.http) = { patch: "/v3/{agent.name=projects/*/locations/*/agents/*}" @@ -99,6 +107,11 @@ service Agents { // // Replaces the current agent with a new one. Note that all existing resources // in agent (e.g. intents, entity types, flows) will be removed. + // + // + // Note: You should always train flows prior to sending them queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v3/{name=projects/*/locations/*/agents/*}:restore" @@ -159,12 +172,15 @@ message Agent { // Required. The human-readable name of the agent, unique within the location. string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - // Immutable. The default language of the agent as a language tag. + // Required. Immutable. The default language of the agent as a language tag. // See [Language // Support](https://cloud.google.com/dialogflow/cx/docs/reference/language) // for a list of the currently supported language codes. // This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent] method. - string default_language_code = 3 [(google.api.field_behavior) = IMMUTABLE]; + string default_language_code = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; // The list of all languages supported by the agent (except for the // `default_language_code`). diff --git a/protos/google/cloud/dialogflow/cx/v3/entity_type.proto b/protos/google/cloud/dialogflow/cx/v3/entity_type.proto index 715dcb87..3eb5b8ff 100644 --- a/protos/google/cloud/dialogflow/cx/v3/entity_type.proto +++ b/protos/google/cloud/dialogflow/cx/v3/entity_type.proto @@ -55,6 +55,10 @@ service EntityTypes { } // Creates an entity type in the specified agent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) { option (google.api.http) = { post: "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes" @@ -64,6 +68,10 @@ service EntityTypes { } // Updates the specified entity type. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) { option (google.api.http) = { patch: "/v3/{entity_type.name=projects/*/locations/*/agents/*/entityTypes/*}" @@ -73,6 +81,10 @@ service EntityTypes { } // Deletes the specified entity type. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v3/{name=projects/*/locations/*/agents/*/entityTypes/*}" diff --git a/protos/google/cloud/dialogflow/cx/v3/flow.proto b/protos/google/cloud/dialogflow/cx/v3/flow.proto index d831b3a7..da2ebc89 100644 --- a/protos/google/cloud/dialogflow/cx/v3/flow.proto +++ b/protos/google/cloud/dialogflow/cx/v3/flow.proto @@ -43,6 +43,10 @@ service Flows { "https://www.googleapis.com/auth/dialogflow"; // Creates a flow in the specified agent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc CreateFlow(CreateFlowRequest) returns (Flow) { option (google.api.http) = { post: "/v3/{parent=projects/*/locations/*/agents/*}/flows" @@ -76,6 +80,10 @@ service Flows { } // Updates the specified flow. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc UpdateFlow(UpdateFlowRequest) returns (Flow) { option (google.api.http) = { patch: "/v3/{flow.name=projects/*/locations/*/agents/*/flows/*}" @@ -86,6 +94,10 @@ service Flows { // Trains the specified flow. Note that only the flow in 'draft' environment // is trained. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc TrainFlow(TrainFlowRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v3/{name=projects/*/locations/*/agents/*/flows/*}:train" @@ -118,6 +130,10 @@ service Flows { } // Imports the specified flow to the specified agent from a binary file. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc ImportFlow(ImportFlowRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v3/{parent=projects/*/locations/*/agents/*}/flows:import" diff --git a/protos/google/cloud/dialogflow/cx/v3/fulfillment.proto b/protos/google/cloud/dialogflow/cx/v3/fulfillment.proto index 0f04f683..c8d48b3a 100644 --- a/protos/google/cloud/dialogflow/cx/v3/fulfillment.proto +++ b/protos/google/cloud/dialogflow/cx/v3/fulfillment.proto @@ -95,6 +95,17 @@ message Fulfillment { type: "dialogflow.googleapis.com/Webhook" }]; + // Whether Dialogflow should return currently queued fulfillment response + // messages in streaming APIs. If a webhook is specified, it happens before + // Dialogflow invokes webhook. + // Warning: + // 1) This flag only affects streaming API. Responses are still queued + // and returned once in non-streaming API. + // 2) The flag can be enabled in any fulfillment but only the first 3 partial + // responses will be returned. You may only want to apply it to fulfillments + // that have slow webhooks. + bool return_partial_responses = 8; + // The tag used by the webhook to identify which fulfillment is being called. // This field is required if `webhook` is specified. string tag = 3; diff --git a/protos/google/cloud/dialogflow/cx/v3/intent.proto b/protos/google/cloud/dialogflow/cx/v3/intent.proto index f4f4c618..47a91bb7 100644 --- a/protos/google/cloud/dialogflow/cx/v3/intent.proto +++ b/protos/google/cloud/dialogflow/cx/v3/intent.proto @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3"; @@ -55,6 +56,10 @@ service Intents { } // Creates an intent in the specified agent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc CreateIntent(CreateIntentRequest) returns (Intent) { option (google.api.http) = { post: "/v3/{parent=projects/*/locations/*/agents/*}/intents" @@ -64,6 +69,10 @@ service Intents { } // Updates the specified intent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc UpdateIntent(UpdateIntentRequest) returns (Intent) { option (google.api.http) = { patch: "/v3/{intent.name=projects/*/locations/*/agents/*/intents/*}" @@ -73,6 +82,10 @@ service Intents { } // Deletes the specified intent. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v3/{name=projects/*/locations/*/agents/*/intents/*}" @@ -205,11 +218,11 @@ message Intent { // 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 + // 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 + // * 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. map<string, string> labels = 7; diff --git a/protos/google/cloud/dialogflow/cx/v3/page.proto b/protos/google/cloud/dialogflow/cx/v3/page.proto index 6cd8259f..182b64ae 100644 --- a/protos/google/cloud/dialogflow/cx/v3/page.proto +++ b/protos/google/cloud/dialogflow/cx/v3/page.proto @@ -57,6 +57,10 @@ service Pages { } // Creates a page in the specified flow. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc CreatePage(CreatePageRequest) returns (Page) { option (google.api.http) = { post: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/pages" @@ -66,6 +70,10 @@ service Pages { } // Updates the specified page. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc UpdatePage(UpdatePageRequest) returns (Page) { option (google.api.http) = { patch: "/v3/{page.name=projects/*/locations/*/agents/*/flows/*/pages/*}" @@ -75,6 +83,10 @@ service Pages { } // Deletes the specified page. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc DeletePage(DeletePageRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v3/{name=projects/*/locations/*/agents/*/flows/*/pages/*}" diff --git a/protos/google/cloud/dialogflow/cx/v3/security_settings.proto b/protos/google/cloud/dialogflow/cx/v3/security_settings.proto index 2d01bd5e..5fce8149 100644 --- a/protos/google/cloud/dialogflow/cx/v3/security_settings.proto +++ b/protos/google/cloud/dialogflow/cx/v3/security_settings.proto @@ -226,8 +226,10 @@ message SecuritySettings { // If empty, we use the default DLP inspect config. // // The template name will have one of the following formats: - // `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR - // `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID` + // `projects/<Project ID>/inspectTemplates/<Template ID>` OR + // `projects/<Project ID>/locations/<Location ID>/inspectTemplates/<Template + // ID>` OR + // `organizations/<Organization ID>/inspectTemplates/<Template ID>` string inspect_template = 9; // Specifies how data is retained. Note that even if the data is diff --git a/protos/google/cloud/dialogflow/cx/v3/session.proto b/protos/google/cloud/dialogflow/cx/v3/session.proto index 19526176..1922ab1c 100644 --- a/protos/google/cloud/dialogflow/cx/v3/session.proto +++ b/protos/google/cloud/dialogflow/cx/v3/session.proto @@ -147,6 +147,20 @@ message DetectIntentRequest { // The message returned from the DetectIntent method. message DetectIntentResponse { + // Represents different DetectIntentResponse types. + enum ResponseType { + // Not specified. This should never happen. + RESPONSE_TYPE_UNSPECIFIED = 0; + + // Partial response. e.g. Aggregated responses in a Fulfillment that enables + // `return_partial_response` can be returned as partial response. + // WARNING: partial response is not eligible for barge-in. + PARTIAL = 1; + + // Final response. + FINAL = 2; + } + // Output only. The unique identifier of the response. It can be used to // locate a response in the training example set or for reporting issues. string response_id = 1; @@ -169,6 +183,14 @@ message DetectIntentResponse { // The config used by the speech synthesizer to generate the output audio. OutputAudioConfig output_audio_config = 5; + + // Response type. + ResponseType response_type = 6; + + // Indicates whether the partial response can be cancelled when a later + // response arrives. e.g. if the agent specified some music as partial + // response, it can be cancelled. + bool allow_cancellation = 7; } // The top-level message sent by the client to the @@ -229,6 +251,12 @@ message StreamingDetectIntentRequest { // Instructs the speech synthesizer how to generate the output audio. OutputAudioConfig output_audio_config = 4; + + // Enable partial detect intent response. If this flag is not enabled, + // response stream still contains only one final `DetectIntentResponse` even + // if some `Fulfillment`s in the agent have been configured to return partial + // responses. + bool enable_partial_response = 5; } // The top-level message returned from the `StreamingDetectIntent` method. @@ -408,8 +436,9 @@ message QueryParameters { google.protobuf.Struct parameters = 5; // The unique identifier of the [page][google.cloud.dialogflow.cx.v3.Page] to override the [current - // page][QueryResult.current_page] in the session. Format: `projects/<Project - // ID>/locations/<Location ID>/agents/<Agent ID>/pages/<page ID>`. + // page][QueryResult.current_page] in the session. + // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent + // ID>/flows/<Flow ID>/pages/<Page ID>`. // // If `current_page` is specified, the previous state of the session will be // ignored by Dialogflow, including the [previous diff --git a/protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto b/protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto index 05dc1534..d5d49baa 100644 --- a/protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto +++ b/protos/google/cloud/dialogflow/cx/v3/transition_route_group.proto @@ -56,6 +56,10 @@ service TransitionRouteGroups { } // Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the specified flow. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc CreateTransitionRouteGroup(CreateTransitionRouteGroupRequest) returns (TransitionRouteGroup) { option (google.api.http) = { post: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups" @@ -65,6 +69,10 @@ service TransitionRouteGroups { } // Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc UpdateTransitionRouteGroup(UpdateTransitionRouteGroupRequest) returns (TransitionRouteGroup) { option (google.api.http) = { patch: "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" @@ -74,6 +82,10 @@ service TransitionRouteGroups { } // Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. + // + // Note: You should always train a flow prior to sending it queries. See the + // [training + // documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). rpc DeleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}" diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 18309175..a8de4232 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -4965,6 +4965,9 @@ export namespace google { /** Fulfillment webhook */ webhook?: (string|null); + /** Fulfillment returnPartialResponses */ + returnPartialResponses?: (boolean|null); + /** Fulfillment tag */ tag?: (string|null); @@ -4990,6 +4993,9 @@ export namespace google { /** Fulfillment webhook. */ public webhook: string; + /** Fulfillment returnPartialResponses. */ + public returnPartialResponses: boolean; + /** Fulfillment tag. */ public tag: string; @@ -16581,6 +16587,12 @@ export namespace google { /** DetectIntentResponse outputAudioConfig */ outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + + /** DetectIntentResponse responseType */ + responseType?: (google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType|keyof typeof google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType|null); + + /** DetectIntentResponse allowCancellation */ + allowCancellation?: (boolean|null); } /** Represents a DetectIntentResponse. */ @@ -16604,6 +16616,12 @@ export namespace google { /** DetectIntentResponse outputAudioConfig. */ public outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + /** DetectIntentResponse responseType. */ + public responseType: (google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType|keyof typeof google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType); + + /** DetectIntentResponse allowCancellation. */ + public allowCancellation: boolean; + /** * Creates a new DetectIntentResponse instance using the specified properties. * @param [properties] Properties to set @@ -16675,6 +16693,16 @@ export namespace google { public toJSON(): { [k: string]: any }; } + namespace DetectIntentResponse { + + /** ResponseType enum. */ + enum ResponseType { + RESPONSE_TYPE_UNSPECIFIED = 0, + PARTIAL = 1, + FINAL = 2 + } + } + /** Properties of a StreamingDetectIntentRequest. */ interface IStreamingDetectIntentRequest { @@ -16689,6 +16717,9 @@ export namespace google { /** StreamingDetectIntentRequest outputAudioConfig */ outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + + /** StreamingDetectIntentRequest enablePartialResponse */ + enablePartialResponse?: (boolean|null); } /** Represents a StreamingDetectIntentRequest. */ @@ -16712,6 +16743,9 @@ export namespace google { /** StreamingDetectIntentRequest outputAudioConfig. */ public outputAudioConfig?: (google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null); + /** StreamingDetectIntentRequest enablePartialResponse. */ + public enablePartialResponse: boolean; + /** * Creates a new StreamingDetectIntentRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/protos/protos.js b/protos/protos.js index 67ba6c76..f373b782 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -11414,6 +11414,7 @@ * @interface IFulfillment * @property {Array.<google.cloud.dialogflow.cx.v3.IResponseMessage>|null} [messages] Fulfillment messages * @property {string|null} [webhook] Fulfillment webhook + * @property {boolean|null} [returnPartialResponses] Fulfillment returnPartialResponses * @property {string|null} [tag] Fulfillment tag * @property {Array.<google.cloud.dialogflow.cx.v3.Fulfillment.ISetParameterAction>|null} [setParameterActions] Fulfillment setParameterActions * @property {Array.<google.cloud.dialogflow.cx.v3.Fulfillment.IConditionalCases>|null} [conditionalCases] Fulfillment conditionalCases @@ -11453,6 +11454,14 @@ */ Fulfillment.prototype.webhook = ""; + /** + * Fulfillment returnPartialResponses. + * @member {boolean} returnPartialResponses + * @memberof google.cloud.dialogflow.cx.v3.Fulfillment + * @instance + */ + Fulfillment.prototype.returnPartialResponses = false; + /** * Fulfillment tag. * @member {string} tag @@ -11514,6 +11523,8 @@ if (message.conditionalCases != null && message.conditionalCases.length) for (var i = 0; i < message.conditionalCases.length; ++i) $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.encode(message.conditionalCases[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.returnPartialResponses != null && Object.hasOwnProperty.call(message, "returnPartialResponses")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.returnPartialResponses); return writer; }; @@ -11556,6 +11567,9 @@ case 2: message.webhook = reader.string(); break; + case 8: + message.returnPartialResponses = reader.bool(); + break; case 3: message.tag = reader.string(); break; @@ -11616,6 +11630,9 @@ if (message.webhook != null && message.hasOwnProperty("webhook")) if (!$util.isString(message.webhook)) return "webhook: string expected"; + if (message.returnPartialResponses != null && message.hasOwnProperty("returnPartialResponses")) + if (typeof message.returnPartialResponses !== "boolean") + return "returnPartialResponses: boolean expected"; if (message.tag != null && message.hasOwnProperty("tag")) if (!$util.isString(message.tag)) return "tag: string expected"; @@ -11664,6 +11681,8 @@ } if (object.webhook != null) message.webhook = String(object.webhook); + if (object.returnPartialResponses != null) + message.returnPartialResponses = Boolean(object.returnPartialResponses); if (object.tag != null) message.tag = String(object.tag); if (object.setParameterActions) { @@ -11710,6 +11729,7 @@ if (options.defaults) { object.webhook = ""; object.tag = ""; + object.returnPartialResponses = false; } if (message.messages && message.messages.length) { object.messages = []; @@ -11730,6 +11750,8 @@ for (var j = 0; j < message.conditionalCases.length; ++j) object.conditionalCases[j] = $root.google.cloud.dialogflow.cx.v3.Fulfillment.ConditionalCases.toObject(message.conditionalCases[j], options); } + if (message.returnPartialResponses != null && message.hasOwnProperty("returnPartialResponses")) + object.returnPartialResponses = message.returnPartialResponses; return object; }; @@ -38626,6 +38648,8 @@ * @property {google.cloud.dialogflow.cx.v3.IQueryResult|null} [queryResult] DetectIntentResponse queryResult * @property {Uint8Array|null} [outputAudio] DetectIntentResponse outputAudio * @property {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentResponse outputAudioConfig + * @property {google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType|null} [responseType] DetectIntentResponse responseType + * @property {boolean|null} [allowCancellation] DetectIntentResponse allowCancellation */ /** @@ -38675,6 +38699,22 @@ */ DetectIntentResponse.prototype.outputAudioConfig = null; + /** + * DetectIntentResponse responseType. + * @member {google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType} responseType + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.responseType = 0; + + /** + * DetectIntentResponse allowCancellation. + * @member {boolean} allowCancellation + * @memberof google.cloud.dialogflow.cx.v3.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.allowCancellation = false; + /** * Creates a new DetectIntentResponse instance using the specified properties. * @function create @@ -38707,6 +38747,10 @@ writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.outputAudio); if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.responseType); + if (message.allowCancellation != null && Object.hasOwnProperty.call(message, "allowCancellation")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.allowCancellation); return writer; }; @@ -38753,6 +38797,12 @@ case 5: message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.decode(reader, reader.uint32()); break; + case 6: + message.responseType = reader.int32(); + break; + case 7: + message.allowCancellation = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -38804,6 +38854,18 @@ if (error) return "outputAudioConfig." + error; } + if (message.responseType != null && message.hasOwnProperty("responseType")) + switch (message.responseType) { + default: + return "responseType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.allowCancellation != null && message.hasOwnProperty("allowCancellation")) + if (typeof message.allowCancellation !== "boolean") + return "allowCancellation: boolean expected"; return null; }; @@ -38836,6 +38898,22 @@ throw TypeError(".google.cloud.dialogflow.cx.v3.DetectIntentResponse.outputAudioConfig: object expected"); message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.fromObject(object.outputAudioConfig); } + switch (object.responseType) { + case "RESPONSE_TYPE_UNSPECIFIED": + case 0: + message.responseType = 0; + break; + case "PARTIAL": + case 1: + message.responseType = 1; + break; + case "FINAL": + case 2: + message.responseType = 2; + break; + } + if (object.allowCancellation != null) + message.allowCancellation = Boolean(object.allowCancellation); return message; }; @@ -38863,6 +38941,8 @@ object.outputAudio = $util.newBuffer(object.outputAudio); } object.outputAudioConfig = null; + object.responseType = options.enums === String ? "RESPONSE_TYPE_UNSPECIFIED" : 0; + object.allowCancellation = false; } if (message.responseId != null && message.hasOwnProperty("responseId")) object.responseId = message.responseId; @@ -38872,6 +38952,10 @@ object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = options.enums === String ? $root.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType[message.responseType] : message.responseType; + if (message.allowCancellation != null && message.hasOwnProperty("allowCancellation")) + object.allowCancellation = message.allowCancellation; return object; }; @@ -38886,6 +38970,22 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * ResponseType enum. + * @name google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType + * @enum {number} + * @property {number} RESPONSE_TYPE_UNSPECIFIED=0 RESPONSE_TYPE_UNSPECIFIED value + * @property {number} PARTIAL=1 PARTIAL value + * @property {number} FINAL=2 FINAL value + */ + DetectIntentResponse.ResponseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESPONSE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PARTIAL"] = 1; + values[valuesById[2] = "FINAL"] = 2; + return values; + })(); + return DetectIntentResponse; })(); @@ -38899,6 +38999,7 @@ * @property {google.cloud.dialogflow.cx.v3.IQueryParameters|null} [queryParams] StreamingDetectIntentRequest queryParams * @property {google.cloud.dialogflow.cx.v3.IQueryInput|null} [queryInput] StreamingDetectIntentRequest queryInput * @property {google.cloud.dialogflow.cx.v3.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentRequest outputAudioConfig + * @property {boolean|null} [enablePartialResponse] StreamingDetectIntentRequest enablePartialResponse */ /** @@ -38948,6 +39049,14 @@ */ StreamingDetectIntentRequest.prototype.outputAudioConfig = null; + /** + * StreamingDetectIntentRequest enablePartialResponse. + * @member {boolean} enablePartialResponse + * @memberof google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.enablePartialResponse = false; + /** * Creates a new StreamingDetectIntentRequest instance using the specified properties. * @function create @@ -38980,6 +39089,8 @@ $root.google.cloud.dialogflow.cx.v3.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enablePartialResponse != null && Object.hasOwnProperty.call(message, "enablePartialResponse")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enablePartialResponse); return writer; }; @@ -39026,6 +39137,9 @@ case 4: message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.decode(reader, reader.uint32()); break; + case 5: + message.enablePartialResponse = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -39079,6 +39193,9 @@ if (error) return "outputAudioConfig." + error; } + if (message.enablePartialResponse != null && message.hasOwnProperty("enablePartialResponse")) + if (typeof message.enablePartialResponse !== "boolean") + return "enablePartialResponse: boolean expected"; return null; }; @@ -39111,6 +39228,8 @@ throw TypeError(".google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest.outputAudioConfig: object expected"); message.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.fromObject(object.outputAudioConfig); } + if (object.enablePartialResponse != null) + message.enablePartialResponse = Boolean(object.enablePartialResponse); return message; }; @@ -39132,6 +39251,7 @@ object.queryParams = null; object.queryInput = null; object.outputAudioConfig = null; + object.enablePartialResponse = false; } if (message.session != null && message.hasOwnProperty("session")) object.session = message.session; @@ -39141,6 +39261,8 @@ object.queryInput = $root.google.cloud.dialogflow.cx.v3.QueryInput.toObject(message.queryInput, options); if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) object.outputAudioConfig = $root.google.cloud.dialogflow.cx.v3.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.enablePartialResponse != null && message.hasOwnProperty("enablePartialResponse")) + object.enablePartialResponse = message.enablePartialResponse; return object; }; diff --git a/protos/protos.json b/protos/protos.json index 1164dd70..6caf3ce8 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -1515,6 +1515,10 @@ "(google.api.resource_reference).type": "dialogflow.googleapis.com/Webhook" } }, + "returnPartialResponses": { + "type": "bool", + "id": 8 + }, "tag": { "type": "string", "id": 3 @@ -4518,6 +4522,23 @@ "outputAudioConfig": { "type": "OutputAudioConfig", "id": 5 + }, + "responseType": { + "type": "ResponseType", + "id": 6 + }, + "allowCancellation": { + "type": "bool", + "id": 7 + } + }, + "nested": { + "ResponseType": { + "values": { + "RESPONSE_TYPE_UNSPECIFIED": 0, + "PARTIAL": 1, + "FINAL": 2 + } } } }, @@ -4544,6 +4565,10 @@ "outputAudioConfig": { "type": "OutputAudioConfig", "id": 4 + }, + "enablePartialResponse": { + "type": "bool", + "id": 5 } } }, diff --git a/src/v3/agents_client.ts b/src/v3/agents_client.ts index e7068c33..7fcff1e2 100644 --- a/src/v3/agents_client.ts +++ b/src/v3/agents_client.ts @@ -531,6 +531,10 @@ export class AgentsClient { /** * Creates an agent in the specified location. * + * Note: You should always train flows prior to sending them queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -625,6 +629,10 @@ export class AgentsClient { /** * Updates the specified agent. * + * Note: You should always train flows prior to sending them queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {google.cloud.dialogflow.cx.v3.Agent} request.agent @@ -1173,6 +1181,11 @@ export class AgentsClient { * Replaces the current agent with a new one. Note that all existing resources * in agent (e.g. intents, entity types, flows) will be removed. * + * + * Note: You should always train flows prior to sending them queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.name diff --git a/src/v3/entity_types_client.ts b/src/v3/entity_types_client.ts index cafd8eee..f5ed2070 100644 --- a/src/v3/entity_types_client.ts +++ b/src/v3/entity_types_client.ts @@ -504,6 +504,10 @@ export class EntityTypesClient { /** * Creates an entity type in the specified agent. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -610,6 +614,10 @@ export class EntityTypesClient { /** * Updates the specified entity type. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {google.cloud.dialogflow.cx.v3.EntityType} request.entityType @@ -715,6 +723,10 @@ export class EntityTypesClient { /** * Deletes the specified entity type. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.name diff --git a/src/v3/flows_client.ts b/src/v3/flows_client.ts index d1438e85..ff451abe 100644 --- a/src/v3/flows_client.ts +++ b/src/v3/flows_client.ts @@ -457,6 +457,10 @@ export class FlowsClient { /** * Creates a flow in the specified agent. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -769,6 +773,10 @@ export class FlowsClient { /** * Updates the specified flow. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {google.cloud.dialogflow.cx.v3.Flow} request.flow @@ -1086,6 +1094,10 @@ export class FlowsClient { * Trains the specified flow. Note that only the flow in 'draft' environment * is trained. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -1226,6 +1238,10 @@ export class FlowsClient { /** * Imports the specified flow to the specified agent from a binary file. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent diff --git a/src/v3/intents_client.ts b/src/v3/intents_client.ts index 0dbd049d..d16d5d7b 100644 --- a/src/v3/intents_client.ts +++ b/src/v3/intents_client.ts @@ -496,6 +496,10 @@ export class IntentsClient { /** * Creates an intent in the specified agent. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -600,6 +604,10 @@ export class IntentsClient { /** * Updates the specified intent. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {google.cloud.dialogflow.cx.v3.Intent} request.intent @@ -704,6 +712,10 @@ export class IntentsClient { /** * Deletes the specified intent. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.name diff --git a/src/v3/pages_client.ts b/src/v3/pages_client.ts index 612ad163..b73534b8 100644 --- a/src/v3/pages_client.ts +++ b/src/v3/pages_client.ts @@ -507,6 +507,10 @@ export class PagesClient { /** * Creates a page in the specified flow. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -623,6 +627,10 @@ export class PagesClient { /** * Updates the specified page. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {google.cloud.dialogflow.cx.v3.Page} request.page @@ -738,6 +746,10 @@ export class PagesClient { /** * Deletes the specified page. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.name diff --git a/src/v3/transition_route_groups_client.ts b/src/v3/transition_route_groups_client.ts index 98208e42..c2acd49c 100644 --- a/src/v3/transition_route_groups_client.ts +++ b/src/v3/transition_route_groups_client.ts @@ -519,6 +519,10 @@ export class TransitionRouteGroupsClient { /** * Creates an {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup} in the specified flow. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -636,6 +640,10 @@ export class TransitionRouteGroupsClient { /** * Updates the specified {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {google.cloud.dialogflow.cx.v3.TransitionRouteGroup} request.transitionRouteGroup @@ -751,6 +759,10 @@ export class TransitionRouteGroupsClient { /** * Deletes the specified {@link google.cloud.dialogflow.cx.v3.TransitionRouteGroup|TransitionRouteGroup}. * + * Note: You should always train a flow prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training). + * * @param {Object} request * The request object that will be sent. * @param {string} request.name