From 7c8a115c88865b3aadfa649b3b2a89207d5502c2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:52:03 -0800 Subject: [PATCH] feat: [dialogflow] add new fields for delivering intermediate transcriptions through PubSub (#5881) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add new fields for delivering intermediate transcriptions through PubSub PiperOrigin-RevId: 705962694 Source-Link: https://github.com/googleapis/googleapis/commit/d140b5109f2abfe1ad4205c4a791cf16f09036c2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/8fc7ff91ca69b762ae3c3784b684dc45d8d4c8eb Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3cvLk93bEJvdC55YW1sIiwiaCI6IjhmYzdmZjkxY2E2OWI3NjJhZTNjMzc4NGI2ODRkYzQ1ZDhkNGM4ZWIifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add new fields for delivering intermediate transcriptions through PubSub PiperOrigin-RevId: 705999588 Source-Link: https://github.com/googleapis/googleapis/commit/35c27e3dff6a232c9c83014c677cf353c3a8aaf5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/fb8444ee2d1364e2e6a84e112206e886e003b8e6 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3cvLk93bEJvdC55YW1sIiwiaCI6ImZiODQ0NGVlMmQxMzY0ZTJlNmE4NGUxMTIyMDZlODg2ZTAwM2I4ZTYifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../dialogflow/v2/conversation_event.proto | 10 ++ .../dialogflow/v2/conversation_profile.proto | 12 ++ .../v2beta1/conversation_event.proto | 10 ++ .../v2beta1/conversation_profile.proto | 12 ++ .../protos/protos.d.ts | 30 +++- .../google-cloud-dialogflow/protos/protos.js | 148 +++++++++++++++++- .../protos/protos.json | 30 +++- 7 files changed, 244 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_event.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_event.proto index d94ebe08661..14ad363e4d9 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_event.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_event.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.dialogflow.v2; import "google/cloud/dialogflow/v2/participant.proto"; +import "google/cloud/dialogflow/v2/session.proto"; import "google/rpc/status.proto"; option csharp_namespace = "Google.Cloud.Dialogflow.V2"; @@ -51,6 +52,12 @@ message ConversationEvent { // [ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2.ConversationProfile.new_message_event_notification_config] NEW_MESSAGE = 5; + // An existing conversation has received a new speech recognition result. + // This is mainly for delivering intermediate transcripts. The notification + // is configured in + // [ConversationProfile.new_recognition_event_notification_config][]. + NEW_RECOGNITION_RESULT = 7; + // Unrecoverable error during a telephone call. // // In general non-recoverable errors only occur if something was @@ -80,5 +87,8 @@ message ConversationEvent { oneof payload { // Payload of NEW_MESSAGE event. Message new_message_payload = 4; + + // Payload of NEW_RECOGNITION_RESULT event. + StreamingRecognitionResult new_recognition_result_payload = 5; } } diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto index ce4950fc3b4..cc248552b62 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto @@ -239,6 +239,18 @@ message ConversationProfile { // format of [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] NotificationConfig new_message_event_notification_config = 8; + // Optional. Configuration for publishing transcription intermediate results. + // Event will be sent in format of + // [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent]. If + // configured, the following information will be populated as + // [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] Pub/Sub + // message attributes: + // - "participant_id" + // - "participant_role" + // - "message_id" + NotificationConfig new_recognition_result_notification_config = 21 + [(google.api.field_behavior) = OPTIONAL]; + // Settings for speech transcription. SpeechToTextConfig stt_config = 9; diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_event.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_event.proto index 9dbd4d6d11a..cefba688aff 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_event.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_event.proto @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.dialogflow.v2beta1; import "google/cloud/dialogflow/v2beta1/participant.proto"; +import "google/cloud/dialogflow/v2beta1/session.proto"; import "google/rpc/status.proto"; option csharp_namespace = "Google.Cloud.Dialogflow.V2Beta1"; @@ -51,6 +52,12 @@ message ConversationEvent { // [ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2beta1.ConversationProfile.new_message_event_notification_config] NEW_MESSAGE = 5; + // An existing conversation has received a new speech recognition result. + // This is mainly for delivering intermediate transcripts. The notification + // is configured in + // [ConversationProfile.new_recognition_event_notification_config][]. + NEW_RECOGNITION_RESULT = 7; + // Unrecoverable error during a telephone call. // // In general non-recoverable errors only occur if something was @@ -80,5 +87,8 @@ message ConversationEvent { oneof payload { // Payload of NEW_MESSAGE event. Message new_message_payload = 4; + + // Payload of NEW_RECOGNITION_RESULT event. + StreamingRecognitionResult new_recognition_result_payload = 5; } } diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto index aa349d75f09..fc9d25e75ae 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto @@ -240,6 +240,18 @@ message ConversationProfile { // [ConversationEvent][google.cloud.dialogflow.v2beta1.ConversationEvent] NotificationConfig new_message_event_notification_config = 8; + // Optional. Configuration for publishing transcription intermediate results. + // Event will be sent in format of + // [ConversationEvent][google.cloud.dialogflow.v2beta1.ConversationEvent]. If + // configured, the following information will be populated as + // [ConversationEvent][google.cloud.dialogflow.v2beta1.ConversationEvent] + // Pub/Sub message attributes: + // - "participant_id" + // - "participant_role" + // - "message_id" + NotificationConfig new_recognition_result_notification_config = 21 + [(google.api.field_behavior) = OPTIONAL]; + // Settings for speech transcription. SpeechToTextConfig stt_config = 9; diff --git a/packages/google-cloud-dialogflow/protos/protos.d.ts b/packages/google-cloud-dialogflow/protos/protos.d.ts index 3218468b8e1..95f7ce86684 100644 --- a/packages/google-cloud-dialogflow/protos/protos.d.ts +++ b/packages/google-cloud-dialogflow/protos/protos.d.ts @@ -23065,6 +23065,9 @@ export namespace google { /** ConversationProfile newMessageEventNotificationConfig */ newMessageEventNotificationConfig?: (google.cloud.dialogflow.v2.INotificationConfig|null); + /** ConversationProfile newRecognitionResultNotificationConfig */ + newRecognitionResultNotificationConfig?: (google.cloud.dialogflow.v2.INotificationConfig|null); + /** ConversationProfile sttConfig */ sttConfig?: (google.cloud.dialogflow.v2.ISpeechToTextConfig|null); @@ -23120,6 +23123,9 @@ export namespace google { /** ConversationProfile newMessageEventNotificationConfig. */ public newMessageEventNotificationConfig?: (google.cloud.dialogflow.v2.INotificationConfig|null); + /** ConversationProfile newRecognitionResultNotificationConfig. */ + public newRecognitionResultNotificationConfig?: (google.cloud.dialogflow.v2.INotificationConfig|null); + /** ConversationProfile sttConfig. */ public sttConfig?: (google.cloud.dialogflow.v2.ISpeechToTextConfig|null); @@ -30263,6 +30269,9 @@ export namespace google { /** ConversationEvent newMessagePayload */ newMessagePayload?: (google.cloud.dialogflow.v2.IMessage|null); + + /** ConversationEvent newRecognitionResultPayload */ + newRecognitionResultPayload?: (google.cloud.dialogflow.v2.IStreamingRecognitionResult|null); } /** Represents a ConversationEvent. */ @@ -30286,8 +30295,11 @@ export namespace google { /** ConversationEvent newMessagePayload. */ public newMessagePayload?: (google.cloud.dialogflow.v2.IMessage|null); + /** ConversationEvent newRecognitionResultPayload. */ + public newRecognitionResultPayload?: (google.cloud.dialogflow.v2.IStreamingRecognitionResult|null); + /** ConversationEvent payload. */ - public payload?: "newMessagePayload"; + public payload?: ("newMessagePayload"|"newRecognitionResultPayload"); /** * Creates a new ConversationEvent instance using the specified properties. @@ -30376,6 +30388,7 @@ export namespace google { CONVERSATION_FINISHED = 2, HUMAN_INTERVENTION_NEEDED = 3, NEW_MESSAGE = 5, + NEW_RECOGNITION_RESULT = 7, UNRECOVERABLE_ERROR = 4 } } @@ -67668,6 +67681,9 @@ export namespace google { /** ConversationProfile newMessageEventNotificationConfig */ newMessageEventNotificationConfig?: (google.cloud.dialogflow.v2beta1.INotificationConfig|null); + /** ConversationProfile newRecognitionResultNotificationConfig */ + newRecognitionResultNotificationConfig?: (google.cloud.dialogflow.v2beta1.INotificationConfig|null); + /** ConversationProfile sttConfig */ sttConfig?: (google.cloud.dialogflow.v2beta1.ISpeechToTextConfig|null); @@ -67723,6 +67739,9 @@ export namespace google { /** ConversationProfile newMessageEventNotificationConfig. */ public newMessageEventNotificationConfig?: (google.cloud.dialogflow.v2beta1.INotificationConfig|null); + /** ConversationProfile newRecognitionResultNotificationConfig. */ + public newRecognitionResultNotificationConfig?: (google.cloud.dialogflow.v2beta1.INotificationConfig|null); + /** ConversationProfile sttConfig. */ public sttConfig?: (google.cloud.dialogflow.v2beta1.ISpeechToTextConfig|null); @@ -73073,6 +73092,9 @@ export namespace google { /** ConversationEvent newMessagePayload */ newMessagePayload?: (google.cloud.dialogflow.v2beta1.IMessage|null); + + /** ConversationEvent newRecognitionResultPayload */ + newRecognitionResultPayload?: (google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null); } /** Represents a ConversationEvent. */ @@ -73096,8 +73118,11 @@ export namespace google { /** ConversationEvent newMessagePayload. */ public newMessagePayload?: (google.cloud.dialogflow.v2beta1.IMessage|null); + /** ConversationEvent newRecognitionResultPayload. */ + public newRecognitionResultPayload?: (google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null); + /** ConversationEvent payload. */ - public payload?: "newMessagePayload"; + public payload?: ("newMessagePayload"|"newRecognitionResultPayload"); /** * Creates a new ConversationEvent instance using the specified properties. @@ -73186,6 +73211,7 @@ export namespace google { CONVERSATION_FINISHED = 2, HUMAN_INTERVENTION_NEEDED = 3, NEW_MESSAGE = 5, + NEW_RECOGNITION_RESULT = 7, UNRECOVERABLE_ERROR = 4 } } diff --git a/packages/google-cloud-dialogflow/protos/protos.js b/packages/google-cloud-dialogflow/protos/protos.js index 14d098c218f..17ff9b93a23 100644 --- a/packages/google-cloud-dialogflow/protos/protos.js +++ b/packages/google-cloud-dialogflow/protos/protos.js @@ -56860,6 +56860,7 @@ * @property {google.cloud.dialogflow.v2.INotificationConfig|null} [notificationConfig] ConversationProfile notificationConfig * @property {google.cloud.dialogflow.v2.ILoggingConfig|null} [loggingConfig] ConversationProfile loggingConfig * @property {google.cloud.dialogflow.v2.INotificationConfig|null} [newMessageEventNotificationConfig] ConversationProfile newMessageEventNotificationConfig + * @property {google.cloud.dialogflow.v2.INotificationConfig|null} [newRecognitionResultNotificationConfig] ConversationProfile newRecognitionResultNotificationConfig * @property {google.cloud.dialogflow.v2.ISpeechToTextConfig|null} [sttConfig] ConversationProfile sttConfig * @property {string|null} [languageCode] ConversationProfile languageCode * @property {string|null} [timeZone] ConversationProfile timeZone @@ -56962,6 +56963,14 @@ */ ConversationProfile.prototype.newMessageEventNotificationConfig = null; + /** + * ConversationProfile newRecognitionResultNotificationConfig. + * @member {google.cloud.dialogflow.v2.INotificationConfig|null|undefined} newRecognitionResultNotificationConfig + * @memberof google.cloud.dialogflow.v2.ConversationProfile + * @instance + */ + ConversationProfile.prototype.newRecognitionResultNotificationConfig = null; + /** * ConversationProfile sttConfig. * @member {google.cloud.dialogflow.v2.ISpeechToTextConfig|null|undefined} sttConfig @@ -57056,6 +57065,8 @@ writer.uint32(/* id 14, wireType 2 =*/114).string(message.timeZone); if (message.ttsConfig != null && Object.hasOwnProperty.call(message, "ttsConfig")) $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.encode(message.ttsConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.newRecognitionResultNotificationConfig != null && Object.hasOwnProperty.call(message, "newRecognitionResultNotificationConfig")) + $root.google.cloud.dialogflow.v2.NotificationConfig.encode(message.newRecognitionResultNotificationConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); return writer; }; @@ -57130,6 +57141,10 @@ message.newMessageEventNotificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.decode(reader, reader.uint32()); break; } + case 21: { + message.newRecognitionResultNotificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.decode(reader, reader.uint32()); + break; + } case 9: { message.sttConfig = $root.google.cloud.dialogflow.v2.SpeechToTextConfig.decode(reader, reader.uint32()); break; @@ -57231,6 +57246,11 @@ if (error) return "newMessageEventNotificationConfig." + error; } + if (message.newRecognitionResultNotificationConfig != null && message.hasOwnProperty("newRecognitionResultNotificationConfig")) { + var error = $root.google.cloud.dialogflow.v2.NotificationConfig.verify(message.newRecognitionResultNotificationConfig); + if (error) + return "newRecognitionResultNotificationConfig." + error; + } if (message.sttConfig != null && message.hasOwnProperty("sttConfig")) { var error = $root.google.cloud.dialogflow.v2.SpeechToTextConfig.verify(message.sttConfig); if (error) @@ -57309,6 +57329,11 @@ throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.newMessageEventNotificationConfig: object expected"); message.newMessageEventNotificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.fromObject(object.newMessageEventNotificationConfig); } + if (object.newRecognitionResultNotificationConfig != null) { + if (typeof object.newRecognitionResultNotificationConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.newRecognitionResultNotificationConfig: object expected"); + message.newRecognitionResultNotificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.fromObject(object.newRecognitionResultNotificationConfig); + } if (object.sttConfig != null) { if (typeof object.sttConfig !== "object") throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.sttConfig: object expected"); @@ -57357,6 +57382,7 @@ object.securitySettings = ""; object.timeZone = ""; object.ttsConfig = null; + object.newRecognitionResultNotificationConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -57388,6 +57414,8 @@ object.timeZone = message.timeZone; if (message.ttsConfig != null && message.hasOwnProperty("ttsConfig")) object.ttsConfig = $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.toObject(message.ttsConfig, options); + if (message.newRecognitionResultNotificationConfig != null && message.hasOwnProperty("newRecognitionResultNotificationConfig")) + object.newRecognitionResultNotificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.toObject(message.newRecognitionResultNotificationConfig, options); return object; }; @@ -74111,6 +74139,7 @@ * @property {google.cloud.dialogflow.v2.ConversationEvent.Type|null} [type] ConversationEvent type * @property {google.rpc.IStatus|null} [errorStatus] ConversationEvent errorStatus * @property {google.cloud.dialogflow.v2.IMessage|null} [newMessagePayload] ConversationEvent newMessagePayload + * @property {google.cloud.dialogflow.v2.IStreamingRecognitionResult|null} [newRecognitionResultPayload] ConversationEvent newRecognitionResultPayload */ /** @@ -74160,17 +74189,25 @@ */ ConversationEvent.prototype.newMessagePayload = null; + /** + * ConversationEvent newRecognitionResultPayload. + * @member {google.cloud.dialogflow.v2.IStreamingRecognitionResult|null|undefined} newRecognitionResultPayload + * @memberof google.cloud.dialogflow.v2.ConversationEvent + * @instance + */ + ConversationEvent.prototype.newRecognitionResultPayload = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * ConversationEvent payload. - * @member {"newMessagePayload"|undefined} payload + * @member {"newMessagePayload"|"newRecognitionResultPayload"|undefined} payload * @memberof google.cloud.dialogflow.v2.ConversationEvent * @instance */ Object.defineProperty(ConversationEvent.prototype, "payload", { - get: $util.oneOfGetter($oneOfFields = ["newMessagePayload"]), + get: $util.oneOfGetter($oneOfFields = ["newMessagePayload", "newRecognitionResultPayload"]), set: $util.oneOfSetter($oneOfFields) }); @@ -74206,6 +74243,8 @@ $root.google.rpc.Status.encode(message.errorStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.newMessagePayload != null && Object.hasOwnProperty.call(message, "newMessagePayload")) $root.google.cloud.dialogflow.v2.Message.encode(message.newMessagePayload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.newRecognitionResultPayload != null && Object.hasOwnProperty.call(message, "newRecognitionResultPayload")) + $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.encode(message.newRecognitionResultPayload, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -74256,6 +74295,10 @@ message.newMessagePayload = $root.google.cloud.dialogflow.v2.Message.decode(reader, reader.uint32()); break; } + case 5: { + message.newRecognitionResultPayload = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -74304,6 +74347,7 @@ case 2: case 3: case 5: + case 7: case 4: break; } @@ -74320,6 +74364,16 @@ return "newMessagePayload." + error; } } + if (message.newRecognitionResultPayload != null && message.hasOwnProperty("newRecognitionResultPayload")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.verify(message.newRecognitionResultPayload); + if (error) + return "newRecognitionResultPayload." + error; + } + } return null; }; @@ -74364,6 +74418,10 @@ case 5: message.type = 5; break; + case "NEW_RECOGNITION_RESULT": + case 7: + message.type = 7; + break; case "UNRECOVERABLE_ERROR": case 4: message.type = 4; @@ -74379,6 +74437,11 @@ throw TypeError(".google.cloud.dialogflow.v2.ConversationEvent.newMessagePayload: object expected"); message.newMessagePayload = $root.google.cloud.dialogflow.v2.Message.fromObject(object.newMessagePayload); } + if (object.newRecognitionResultPayload != null) { + if (typeof object.newRecognitionResultPayload !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationEvent.newRecognitionResultPayload: object expected"); + message.newRecognitionResultPayload = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.fromObject(object.newRecognitionResultPayload); + } return message; }; @@ -74411,6 +74474,11 @@ if (options.oneofs) object.payload = "newMessagePayload"; } + if (message.newRecognitionResultPayload != null && message.hasOwnProperty("newRecognitionResultPayload")) { + object.newRecognitionResultPayload = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.toObject(message.newRecognitionResultPayload, options); + if (options.oneofs) + object.payload = "newRecognitionResultPayload"; + } return object; }; @@ -74449,6 +74517,7 @@ * @property {number} CONVERSATION_FINISHED=2 CONVERSATION_FINISHED value * @property {number} HUMAN_INTERVENTION_NEEDED=3 HUMAN_INTERVENTION_NEEDED value * @property {number} NEW_MESSAGE=5 NEW_MESSAGE value + * @property {number} NEW_RECOGNITION_RESULT=7 NEW_RECOGNITION_RESULT value * @property {number} UNRECOVERABLE_ERROR=4 UNRECOVERABLE_ERROR value */ ConversationEvent.Type = (function() { @@ -74458,6 +74527,7 @@ values[valuesById[2] = "CONVERSATION_FINISHED"] = 2; values[valuesById[3] = "HUMAN_INTERVENTION_NEEDED"] = 3; values[valuesById[5] = "NEW_MESSAGE"] = 5; + values[valuesById[7] = "NEW_RECOGNITION_RESULT"] = 7; values[valuesById[4] = "UNRECOVERABLE_ERROR"] = 4; return values; })(); @@ -165310,6 +165380,7 @@ * @property {google.cloud.dialogflow.v2beta1.INotificationConfig|null} [notificationConfig] ConversationProfile notificationConfig * @property {google.cloud.dialogflow.v2beta1.ILoggingConfig|null} [loggingConfig] ConversationProfile loggingConfig * @property {google.cloud.dialogflow.v2beta1.INotificationConfig|null} [newMessageEventNotificationConfig] ConversationProfile newMessageEventNotificationConfig + * @property {google.cloud.dialogflow.v2beta1.INotificationConfig|null} [newRecognitionResultNotificationConfig] ConversationProfile newRecognitionResultNotificationConfig * @property {google.cloud.dialogflow.v2beta1.ISpeechToTextConfig|null} [sttConfig] ConversationProfile sttConfig * @property {string|null} [languageCode] ConversationProfile languageCode * @property {string|null} [timeZone] ConversationProfile timeZone @@ -165412,6 +165483,14 @@ */ ConversationProfile.prototype.newMessageEventNotificationConfig = null; + /** + * ConversationProfile newRecognitionResultNotificationConfig. + * @member {google.cloud.dialogflow.v2beta1.INotificationConfig|null|undefined} newRecognitionResultNotificationConfig + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.newRecognitionResultNotificationConfig = null; + /** * ConversationProfile sttConfig. * @member {google.cloud.dialogflow.v2beta1.ISpeechToTextConfig|null|undefined} sttConfig @@ -165506,6 +165585,8 @@ writer.uint32(/* id 14, wireType 2 =*/114).string(message.timeZone); if (message.ttsConfig != null && Object.hasOwnProperty.call(message, "ttsConfig")) $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.encode(message.ttsConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.newRecognitionResultNotificationConfig != null && Object.hasOwnProperty.call(message, "newRecognitionResultNotificationConfig")) + $root.google.cloud.dialogflow.v2beta1.NotificationConfig.encode(message.newRecognitionResultNotificationConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); return writer; }; @@ -165580,6 +165661,10 @@ message.newMessageEventNotificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.decode(reader, reader.uint32()); break; } + case 21: { + message.newRecognitionResultNotificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.decode(reader, reader.uint32()); + break; + } case 9: { message.sttConfig = $root.google.cloud.dialogflow.v2beta1.SpeechToTextConfig.decode(reader, reader.uint32()); break; @@ -165681,6 +165766,11 @@ if (error) return "newMessageEventNotificationConfig." + error; } + if (message.newRecognitionResultNotificationConfig != null && message.hasOwnProperty("newRecognitionResultNotificationConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.verify(message.newRecognitionResultNotificationConfig); + if (error) + return "newRecognitionResultNotificationConfig." + error; + } if (message.sttConfig != null && message.hasOwnProperty("sttConfig")) { var error = $root.google.cloud.dialogflow.v2beta1.SpeechToTextConfig.verify(message.sttConfig); if (error) @@ -165759,6 +165849,11 @@ throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.newMessageEventNotificationConfig: object expected"); message.newMessageEventNotificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.fromObject(object.newMessageEventNotificationConfig); } + if (object.newRecognitionResultNotificationConfig != null) { + if (typeof object.newRecognitionResultNotificationConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.newRecognitionResultNotificationConfig: object expected"); + message.newRecognitionResultNotificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.fromObject(object.newRecognitionResultNotificationConfig); + } if (object.sttConfig != null) { if (typeof object.sttConfig !== "object") throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.sttConfig: object expected"); @@ -165807,6 +165902,7 @@ object.securitySettings = ""; object.timeZone = ""; object.ttsConfig = null; + object.newRecognitionResultNotificationConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -165838,6 +165934,8 @@ object.timeZone = message.timeZone; if (message.ttsConfig != null && message.hasOwnProperty("ttsConfig")) object.ttsConfig = $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.toObject(message.ttsConfig, options); + if (message.newRecognitionResultNotificationConfig != null && message.hasOwnProperty("newRecognitionResultNotificationConfig")) + object.newRecognitionResultNotificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.toObject(message.newRecognitionResultNotificationConfig, options); return object; }; @@ -178574,6 +178672,7 @@ * @property {google.cloud.dialogflow.v2beta1.ConversationEvent.Type|null} [type] ConversationEvent type * @property {google.rpc.IStatus|null} [errorStatus] ConversationEvent errorStatus * @property {google.cloud.dialogflow.v2beta1.IMessage|null} [newMessagePayload] ConversationEvent newMessagePayload + * @property {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null} [newRecognitionResultPayload] ConversationEvent newRecognitionResultPayload */ /** @@ -178623,17 +178722,25 @@ */ ConversationEvent.prototype.newMessagePayload = null; + /** + * ConversationEvent newRecognitionResultPayload. + * @member {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null|undefined} newRecognitionResultPayload + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent + * @instance + */ + ConversationEvent.prototype.newRecognitionResultPayload = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * ConversationEvent payload. - * @member {"newMessagePayload"|undefined} payload + * @member {"newMessagePayload"|"newRecognitionResultPayload"|undefined} payload * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent * @instance */ Object.defineProperty(ConversationEvent.prototype, "payload", { - get: $util.oneOfGetter($oneOfFields = ["newMessagePayload"]), + get: $util.oneOfGetter($oneOfFields = ["newMessagePayload", "newRecognitionResultPayload"]), set: $util.oneOfSetter($oneOfFields) }); @@ -178669,6 +178776,8 @@ $root.google.rpc.Status.encode(message.errorStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.newMessagePayload != null && Object.hasOwnProperty.call(message, "newMessagePayload")) $root.google.cloud.dialogflow.v2beta1.Message.encode(message.newMessagePayload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.newRecognitionResultPayload != null && Object.hasOwnProperty.call(message, "newRecognitionResultPayload")) + $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.encode(message.newRecognitionResultPayload, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -178719,6 +178828,10 @@ message.newMessagePayload = $root.google.cloud.dialogflow.v2beta1.Message.decode(reader, reader.uint32()); break; } + case 5: { + message.newRecognitionResultPayload = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -178767,6 +178880,7 @@ case 2: case 3: case 5: + case 7: case 4: break; } @@ -178783,6 +178897,16 @@ return "newMessagePayload." + error; } } + if (message.newRecognitionResultPayload != null && message.hasOwnProperty("newRecognitionResultPayload")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify(message.newRecognitionResultPayload); + if (error) + return "newRecognitionResultPayload." + error; + } + } return null; }; @@ -178827,6 +178951,10 @@ case 5: message.type = 5; break; + case "NEW_RECOGNITION_RESULT": + case 7: + message.type = 7; + break; case "UNRECOVERABLE_ERROR": case 4: message.type = 4; @@ -178842,6 +178970,11 @@ throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationEvent.newMessagePayload: object expected"); message.newMessagePayload = $root.google.cloud.dialogflow.v2beta1.Message.fromObject(object.newMessagePayload); } + if (object.newRecognitionResultPayload != null) { + if (typeof object.newRecognitionResultPayload !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationEvent.newRecognitionResultPayload: object expected"); + message.newRecognitionResultPayload = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.fromObject(object.newRecognitionResultPayload); + } return message; }; @@ -178874,6 +179007,11 @@ if (options.oneofs) object.payload = "newMessagePayload"; } + if (message.newRecognitionResultPayload != null && message.hasOwnProperty("newRecognitionResultPayload")) { + object.newRecognitionResultPayload = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.toObject(message.newRecognitionResultPayload, options); + if (options.oneofs) + object.payload = "newRecognitionResultPayload"; + } return object; }; @@ -178912,6 +179050,7 @@ * @property {number} CONVERSATION_FINISHED=2 CONVERSATION_FINISHED value * @property {number} HUMAN_INTERVENTION_NEEDED=3 HUMAN_INTERVENTION_NEEDED value * @property {number} NEW_MESSAGE=5 NEW_MESSAGE value + * @property {number} NEW_RECOGNITION_RESULT=7 NEW_RECOGNITION_RESULT value * @property {number} UNRECOVERABLE_ERROR=4 UNRECOVERABLE_ERROR value */ ConversationEvent.Type = (function() { @@ -178921,6 +179060,7 @@ values[valuesById[2] = "CONVERSATION_FINISHED"] = 2; values[valuesById[3] = "HUMAN_INTERVENTION_NEEDED"] = 3; values[valuesById[5] = "NEW_MESSAGE"] = 5; + values[valuesById[7] = "NEW_RECOGNITION_RESULT"] = 7; values[valuesById[4] = "UNRECOVERABLE_ERROR"] = 4; return values; })(); diff --git a/packages/google-cloud-dialogflow/protos/protos.json b/packages/google-cloud-dialogflow/protos/protos.json index 173d18637fd..0ce118f7d8e 100644 --- a/packages/google-cloud-dialogflow/protos/protos.json +++ b/packages/google-cloud-dialogflow/protos/protos.json @@ -7088,6 +7088,13 @@ "type": "NotificationConfig", "id": 8 }, + "newRecognitionResultNotificationConfig": { + "type": "NotificationConfig", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "sttConfig": { "type": "SpeechToTextConfig", "id": 9 @@ -8739,7 +8746,8 @@ "oneofs": { "payload": { "oneof": [ - "newMessagePayload" + "newMessagePayload", + "newRecognitionResultPayload" ] } }, @@ -8759,6 +8767,10 @@ "newMessagePayload": { "type": "Message", "id": 4 + }, + "newRecognitionResultPayload": { + "type": "StreamingRecognitionResult", + "id": 5 } }, "nested": { @@ -8769,6 +8781,7 @@ "CONVERSATION_FINISHED": 2, "HUMAN_INTERVENTION_NEEDED": 3, "NEW_MESSAGE": 5, + "NEW_RECOGNITION_RESULT": 7, "UNRECOVERABLE_ERROR": 4 } } @@ -19375,6 +19388,13 @@ "type": "NotificationConfig", "id": 8 }, + "newRecognitionResultNotificationConfig": { + "type": "NotificationConfig", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "sttConfig": { "type": "SpeechToTextConfig", "id": 9 @@ -20587,7 +20607,8 @@ "oneofs": { "payload": { "oneof": [ - "newMessagePayload" + "newMessagePayload", + "newRecognitionResultPayload" ] } }, @@ -20607,6 +20628,10 @@ "newMessagePayload": { "type": "Message", "id": 4 + }, + "newRecognitionResultPayload": { + "type": "StreamingRecognitionResult", + "id": 5 } }, "nested": { @@ -20617,6 +20642,7 @@ "CONVERSATION_FINISHED": 2, "HUMAN_INTERVENTION_NEEDED": 3, "NEW_MESSAGE": 5, + "NEW_RECOGNITION_RESULT": 7, "UNRECOVERABLE_ERROR": 4 } }