From 576234f179d2e8dde1e629888afafb59abec7e6c Mon Sep 17 00:00:00 2001 From: Google APIs Date: Wed, 27 May 2020 09:53:46 -0700 Subject: [PATCH] feat: add one additional binding for SearchAgents API; clean up deps; update Go library. docs: update doc links for intent. PiperOrigin-RevId: 313408465 --- google/cloud/dialogflow/v2beta1/BUILD.bazel | 65 ++++--- google/cloud/dialogflow/v2beta1/agent.proto | 3 + .../dialogflow/v2beta1/audio_config.proto | 166 +++++++++--------- google/cloud/dialogflow/v2beta1/intent.proto | 4 +- 4 files changed, 120 insertions(+), 118 deletions(-) diff --git a/google/cloud/dialogflow/v2beta1/BUILD.bazel b/google/cloud/dialogflow/v2beta1/BUILD.bazel index 424bf53b2..5846e8d62 100644 --- a/google/cloud/dialogflow/v2beta1/BUILD.bazel +++ b/google/cloud/dialogflow/v2beta1/BUILD.bazel @@ -138,39 +138,38 @@ go_proto_library( ], ) -# go_gapic_library( -# name = "dialogflow_go_gapic", -# srcs = [":dialogflow_proto_with_info"], -# grpc_service_config = "dialogflow_grpc_service_config.json", -# importpath = "cloud.google.com/go/cloud/dialogflow/apiv2beta1;dialogflow", -# service_yaml = "dialogflow_v2beta1.yaml", -# deps = [ -# ":dialogflow_go_proto", -# "//google/longrunning:longrunning_go_gapic", -# "//google/longrunning:longrunning_go_proto", -# "@com_google_cloud_go//longrunning:go_default_library", -# "@com_google_cloud_go//longrunning/autogen:go_default_library", -# "@io_bazel_rules_go//proto/wkt:duration_go_proto", -# "@io_bazel_rules_go//proto/wkt:struct_go_proto", -# ], -# ) -# -# go_test( -# name = "dialogflow_go_gapic_test", -# srcs = [":dialogflow_go_gapic_srcjar_test"], -# embed = [":dialogflow_go_gapic"], -# importpath = "cloud.google.com/go/cloud/dialogflow/apiv2beta1", -# ) -# -# # Open Source Packages -# go_gapic_assembly_pkg( -# name = "gapi-cloud-dialogflow-v2beta1-go", -# deps = [ -# ":dialogflow_go_gapic", -# ":dialogflow_go_gapic_srcjar-test.srcjar", -# ":dialogflow_go_proto", -# ], -# ) +go_gapic_library( + name = "dialogflow_go_gapic", + srcs = [":dialogflow_proto_with_info"], + grpc_service_config = "dialogflow_grpc_service_config.json", + importpath = "cloud.google.com/go/dialogflow/apiv2beta1;dialogflow", + service_yaml = "dialogflow_v2beta1.yaml", + deps = [ + ":dialogflow_go_proto", + "//google/longrunning:longrunning_go_proto", + "@com_google_cloud_go//longrunning/autogen:go_default_library", + "@com_google_cloud_go//longrunning:go_default_library", + "@io_bazel_rules_go//proto/wkt:duration_go_proto", + "@io_bazel_rules_go//proto/wkt:struct_go_proto", + ], +) + +go_test( + name = "dialogflow_go_gapic_test", + srcs = [":dialogflow_go_gapic_srcjar_test"], + embed = [":dialogflow_go_gapic"], + importpath = "cloud.google.com/go/dialogflow/apiv2beta1", +) + +# Open Source Packages +go_gapic_assembly_pkg( + name = "gapi-cloud-dialogflow-v2beta1-go", + deps = [ + ":dialogflow_go_gapic", + ":dialogflow_go_gapic_srcjar-test.srcjar", + ":dialogflow_go_proto", + ], +) ############################################################################## # Python diff --git a/google/cloud/dialogflow/v2beta1/agent.proto b/google/cloud/dialogflow/v2beta1/agent.proto index c4c09631f..01c79927f 100644 --- a/google/cloud/dialogflow/v2beta1/agent.proto +++ b/google/cloud/dialogflow/v2beta1/agent.proto @@ -112,6 +112,9 @@ service Agents { rpc SearchAgents(SearchAgentsRequest) returns (SearchAgentsResponse) { option (google.api.http) = { get: "/v2beta1/{parent=projects/*}/agent:search" + additional_bindings { + get: "/v2beta1/{parent=projects/*/locations/*}/agent:search" + } }; option (google.api.method_signature) = "parent"; } diff --git a/google/cloud/dialogflow/v2beta1/audio_config.proto b/google/cloud/dialogflow/v2beta1/audio_config.proto index 669e5ded0..2b9807c15 100644 --- a/google/cloud/dialogflow/v2beta1/audio_config.proto +++ b/google/cloud/dialogflow/v2beta1/audio_config.proto @@ -30,6 +30,35 @@ option java_outer_classname = "AudioConfigProto"; option java_package = "com.google.cloud.dialogflow.v2beta1"; option objc_class_prefix = "DF"; +// Hints for the speech recognizer to help with recognition in a specific +// conversation state. +message SpeechContext { + // Optional. A list of strings containing words and phrases that the speech + // recognizer should recognize with higher likelihood. + // + // This list can be used to: + // * improve accuracy for words and phrases you expect the user to say, + // e.g. typical commands for your Dialogflow agent + // * add additional words to the speech recognizer vocabulary + // * ... + // + // See the [Cloud Speech + // documentation](https://cloud.google.com/speech-to-text/quotas) for usage + // limits. + repeated string phrases = 1; + + // Optional. Boost for this context compared to other contexts: + // + // * If the boost is positive, Dialogflow will increase the probability that + // the phrases in this context are recognized over similar sounding phrases. + // * If the boost is unspecified or non-positive, Dialogflow will not apply + // any boost. + // + // Dialogflow recommends that you use boosts in the range (0, 20] and that you + // find a value that fits your use case with binary search. + float boost = 2; +} + // Audio encoding of the audio content sent in the conversational query request. // Refer to the // [Cloud Speech API @@ -79,33 +108,29 @@ enum AudioEncoding { AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; } -// Hints for the speech recognizer to help with recognition in a specific -// conversation state. -message SpeechContext { - // Optional. A list of strings containing words and phrases that the speech - // recognizer should recognize with higher likelihood. - // - // This list can be used to: - // * improve accuracy for words and phrases you expect the user to say, - // e.g. typical commands for your Dialogflow agent - // * add additional words to the speech recognizer vocabulary - // * ... - // - // See the [Cloud Speech - // documentation](https://cloud.google.com/speech-to-text/quotas) for usage - // limits. - repeated string phrases = 1; +// Information for a word recognized by the speech recognizer. +message SpeechWordInfo { + // The word this info is for. + string word = 3; - // Optional. Boost for this context compared to other contexts: - // - // * If the boost is positive, Dialogflow will increase the probability that - // the phrases in this context are recognized over similar sounding phrases. - // * If the boost is unspecified or non-positive, Dialogflow will not apply - // any boost. + // Time offset relative to the beginning of the audio that corresponds to the + // start of the spoken word. This is an experimental feature and the accuracy + // of the time offset can vary. + google.protobuf.Duration start_offset = 1; + + // Time offset relative to the beginning of the audio that corresponds to the + // end of the spoken word. This is an experimental feature and the accuracy of + // the time offset can vary. + google.protobuf.Duration end_offset = 2; + + // The Speech confidence between 0.0 and 1.0 for this word. A higher number + // indicates an estimated greater likelihood that the recognized word is + // correct. The default of 0.0 is a sentinel value indicating that confidence + // was not set. // - // Dialogflow recommends that you use boosts in the range (0, 20] and that you - // find a value that fits your use case with binary search. - float boost = 2; + // This field is not guaranteed to be fully stable over time for the same + // audio input. Users should also not rely on it to always be provided. + float confidence = 4; } // Variant of the specified [Speech model][google.cloud.dialogflow.v2beta1.InputAudioConfig.model] to use. @@ -151,31 +176,6 @@ enum SpeechModelVariant { USE_ENHANCED = 3; } -// Information for a word recognized by the speech recognizer. -message SpeechWordInfo { - // The word this info is for. - string word = 3; - - // Time offset relative to the beginning of the audio that corresponds to the - // start of the spoken word. This is an experimental feature and the accuracy - // of the time offset can vary. - google.protobuf.Duration start_offset = 1; - - // Time offset relative to the beginning of the audio that corresponds to the - // end of the spoken word. This is an experimental feature and the accuracy of - // the time offset can vary. - google.protobuf.Duration end_offset = 2; - - // The Speech confidence between 0.0 and 1.0 for this word. A higher number - // indicates an estimated greater likelihood that the recognized word is - // correct. The default of 0.0 is a sentinel value indicating that confidence - // was not set. - // - // This field is not guaranteed to be fully stable over time for the same - // audio input. Users should also not rely on it to always be provided. - float confidence = 4; -} - // Instructs the speech recognizer on how to process the audio content. message InputAudioConfig { // Required. Audio encoding of the audio content to process. @@ -249,6 +249,21 @@ message InputAudioConfig { bool single_utterance = 8; } +// Description of which voice to use for speech synthesis. +message VoiceSelectionParams { + // Optional. The name of the voice. If not set, the service will choose a + // voice based on the other parameters such as language_code and + // [ssml_gender][google.cloud.dialogflow.v2beta1.VoiceSelectionParams.ssml_gender]. + string name = 1; + + // Optional. The preferred gender of the voice. If not set, the service will + // choose a voice based on the other parameters such as language_code and + // [name][google.cloud.dialogflow.v2beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a + // voice of the appropriate gender is not available, the synthesizer should + // substitute a voice with a different gender rather than failing the request. + SsmlVoiceGender ssml_gender = 2; +} + // Gender of the voice as described in // [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). enum SsmlVoiceGender { @@ -266,21 +281,6 @@ enum SsmlVoiceGender { SSML_VOICE_GENDER_NEUTRAL = 3; } -// Description of which voice to use for speech synthesis. -message VoiceSelectionParams { - // Optional. The name of the voice. If not set, the service will choose a - // voice based on the other parameters such as language_code and - // [ssml_gender][google.cloud.dialogflow.v2beta1.VoiceSelectionParams.ssml_gender]. - string name = 1; - - // Optional. The preferred gender of the voice. If not set, the service will - // choose a voice based on the other parameters such as language_code and - // [name][google.cloud.dialogflow.v2beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a - // voice of the appropriate gender is not available, the synthesizer should - // substitute a voice with a different gender rather than failing the request. - SsmlVoiceGender ssml_gender = 2; -} - // Configuration of how speech should be synthesized. message SynthesizeSpeechConfig { // Optional. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal @@ -313,6 +313,24 @@ message SynthesizeSpeechConfig { VoiceSelectionParams voice = 4; } +// Instructs the speech synthesizer how to generate the output audio content. +// If this audio config is supplied in a request, it overrides all existing +// text-to-speech settings applied to the agent. +message OutputAudioConfig { + // Required. Audio encoding of the synthesized audio content. + OutputAudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // The synthesis sample rate (in hertz) for this audio. If not + // provided, then the synthesizer will use the default sample rate based on + // the audio encoding. If this is different from the voice's natural sample + // rate, then the synthesizer will honor this request by converting to the + // desired sample rate (which might result in worse audio quality). + int32 sample_rate_hertz = 2; + + // Configuration of how speech should be synthesized. + SynthesizeSpeechConfig synthesize_speech_config = 3; +} + // Audio encoding of the output audio format in Text-To-Speech. enum OutputAudioEncoding { // Not specified. @@ -331,21 +349,3 @@ enum OutputAudioEncoding { // than MP3 while using approximately the same bitrate. OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; } - -// Instructs the speech synthesizer how to generate the output audio content. -// If this audio config is supplied in a request, it overrides all existing -// text-to-speech settings applied to the agent. -message OutputAudioConfig { - // Required. Audio encoding of the synthesized audio content. - OutputAudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; - - // The synthesis sample rate (in hertz) for this audio. If not - // provided, then the synthesizer will use the default sample rate based on - // the audio encoding. If this is different from the voice's natural sample - // rate, then the synthesizer will honor this request by converting to the - // desired sample rate (which might result in worse audio quality). - int32 sample_rate_hertz = 2; - - // Configuration of how speech should be synthesized. - SynthesizeSpeechConfig synthesize_speech_config = 3; -} diff --git a/google/cloud/dialogflow/v2beta1/intent.proto b/google/cloud/dialogflow/v2beta1/intent.proto index 5aa4a8f76..f676a6f15 100644 --- a/google/cloud/dialogflow/v2beta1/intent.proto +++ b/google/cloud/dialogflow/v2beta1/intent.proto @@ -554,7 +554,7 @@ message Intent { // with media and suggestions. // // For more details about RBM rich cards, please see: - // https://developers.google.com/rcs-business-messaging/rbm/guides/build/send-messages#rich-cards. + // https://developers.google.com/business-communications/rcs-business-messaging/guides/build/messages/send#rich-cards // If you want to show a single card with more control over the layout, // please use [RbmStandaloneCard][google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard] instead. message RbmCarouselCard { @@ -584,7 +584,7 @@ message Intent { // with media and suggestions. // // For more details about RBM rich cards, please see: - // https://developers.google.com/rcs-business-messaging/rbm/guides/build/send-messages#rich-cards. + // https://developers.google.com/business-communications/rcs-business-messaging/guides/build/messages/send#rich-cards // You can group multiple rich cards into one using [RbmCarouselCard][google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard] but // carousel cards will give you less control over the card layout. message RbmStandaloneCard {