google-cloud-dialogflow-v2 0.17.1 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 307549a7266d10daee7a1515ffa632a3b93586c5306134409ac8f00b24bba3a0
4
- data.tar.gz: 52e226f6bce11b0dbdadac7ff645fb37b77946c20985c0ef110df3570469e313
3
+ metadata.gz: e7f25c43be53052350aa37c97a7445c9f13fa2533134543e0450778df90f0048
4
+ data.tar.gz: 29d44d70e45385530d779708d0a51640f1c579ed5484da78ad3cf52bfa2226dc
5
5
  SHA512:
6
- metadata.gz: 8cf06b7636e2fe76503dc331309aabb79218491f82fdea5a031c47e40e0168bedfe52e7c7191fb50cd9801f29fda20b434f335cb050f7a834f158e8676cdec77
7
- data.tar.gz: fa6ce35c4288295a40000289dc806b05e70307a6dbf8b140f24b1fc2d6380e50003f464b6e7b7abdaf241a00a40117de5195bd39a369aa63e3ad616feef81f44
6
+ metadata.gz: a8a6c9df749d5e460ebad33fb4fcb0bb01aa2c627b729b263ea5f261299135801a0ed4768662fefabc6b86369b1c2bbf8166d8576a18feacd2213247f7637285
7
+ data.tar.gz: 9a917d2016c594e7782e1a2a7e1f23f11a0f9c5fd686f49dfec34f3433cd214c22fe0f11a5f9ed0cd22ebdd1962b3b7a49d56e42204ef3904f23b9ffb7e02b1b
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
@@ -47,8 +47,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
47
47
  optional :sample_rate_hertz, :int32, 2
48
48
  optional :synthesize_speech_config, :message, 3, "google.cloud.dialogflow.v2.SynthesizeSpeechConfig"
49
49
  end
50
+ add_message "google.cloud.dialogflow.v2.TelephonyDtmfEvents" do
51
+ repeated :dtmf_events, :enum, 1, "google.cloud.dialogflow.v2.TelephonyDtmf"
52
+ end
50
53
  add_message "google.cloud.dialogflow.v2.SpeechToTextConfig" do
51
54
  optional :speech_model_variant, :enum, 1, "google.cloud.dialogflow.v2.SpeechModelVariant"
55
+ optional :model, :string, 2
52
56
  end
53
57
  add_enum "google.cloud.dialogflow.v2.AudioEncoding" do
54
58
  value :AUDIO_ENCODING_UNSPECIFIED, 0
@@ -80,6 +84,25 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
80
84
  value :OUTPUT_AUDIO_ENCODING_OGG_OPUS, 3
81
85
  value :OUTPUT_AUDIO_ENCODING_MULAW, 5
82
86
  end
87
+ add_enum "google.cloud.dialogflow.v2.TelephonyDtmf" do
88
+ value :TELEPHONY_DTMF_UNSPECIFIED, 0
89
+ value :DTMF_ONE, 1
90
+ value :DTMF_TWO, 2
91
+ value :DTMF_THREE, 3
92
+ value :DTMF_FOUR, 4
93
+ value :DTMF_FIVE, 5
94
+ value :DTMF_SIX, 6
95
+ value :DTMF_SEVEN, 7
96
+ value :DTMF_EIGHT, 8
97
+ value :DTMF_NINE, 9
98
+ value :DTMF_ZERO, 10
99
+ value :DTMF_A, 11
100
+ value :DTMF_B, 12
101
+ value :DTMF_C, 13
102
+ value :DTMF_D, 14
103
+ value :DTMF_STAR, 15
104
+ value :DTMF_POUND, 16
105
+ end
83
106
  end
84
107
  end
85
108
 
@@ -93,11 +116,13 @@ module Google
93
116
  VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.VoiceSelectionParams").msgclass
94
117
  SynthesizeSpeechConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SynthesizeSpeechConfig").msgclass
95
118
  OutputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioConfig").msgclass
119
+ TelephonyDtmfEvents = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TelephonyDtmfEvents").msgclass
96
120
  SpeechToTextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechToTextConfig").msgclass
97
121
  AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AudioEncoding").enummodule
98
122
  SpeechModelVariant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechModelVariant").enummodule
99
123
  SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SsmlVoiceGender").enummodule
100
124
  OutputAudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioEncoding").enummodule
125
+ TelephonyDtmf = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TelephonyDtmf").enummodule
101
126
  end
102
127
  end
103
128
  end
@@ -64,6 +64,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
64
64
  optional :import_count, :int32, 3
65
65
  end
66
66
  add_message "google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata" do
67
+ optional :conversation_dataset, :string, 1
67
68
  end
68
69
  add_message "google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata" do
69
70
  end
@@ -20,6 +20,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
20
20
  optional :name, :string, 1
21
21
  optional :role, :enum, 2, "google.cloud.dialogflow.v2.Participant.Role"
22
22
  optional :sip_recording_media_label, :string, 6
23
+ optional :obfuscated_external_user_id, :string, 7
23
24
  map :documents_metadata_filters, :string, :string, 8
24
25
  end
25
26
  add_enum "google.cloud.dialogflow.v2.Participant.Role" do
@@ -83,6 +84,33 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
83
84
  repeated :end_user_suggestion_results, :message, 7, "google.cloud.dialogflow.v2.SuggestionResult"
84
85
  optional :dtmf_parameters, :message, 9, "google.cloud.dialogflow.v2.DtmfParameters"
85
86
  end
87
+ add_message "google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest" do
88
+ optional :participant, :string, 1
89
+ optional :reply_audio_config, :message, 4, "google.cloud.dialogflow.v2.OutputAudioConfig"
90
+ optional :query_params, :message, 7, "google.cloud.dialogflow.v2.QueryParameters"
91
+ optional :assist_query_params, :message, 8, "google.cloud.dialogflow.v2.AssistQueryParameters"
92
+ optional :cx_parameters, :message, 13, "google.protobuf.Struct"
93
+ optional :enable_partial_automated_agent_reply, :bool, 12
94
+ oneof :config do
95
+ optional :audio_config, :message, 2, "google.cloud.dialogflow.v2.InputAudioConfig"
96
+ optional :text_config, :message, 3, "google.cloud.dialogflow.v2.InputTextConfig"
97
+ end
98
+ oneof :input do
99
+ optional :input_audio, :bytes, 5
100
+ optional :input_text, :string, 6
101
+ optional :input_dtmf, :message, 9, "google.cloud.dialogflow.v2.TelephonyDtmfEvents"
102
+ end
103
+ end
104
+ add_message "google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse" do
105
+ optional :recognition_result, :message, 1, "google.cloud.dialogflow.v2.StreamingRecognitionResult"
106
+ optional :reply_text, :string, 2
107
+ optional :reply_audio, :message, 3, "google.cloud.dialogflow.v2.OutputAudio"
108
+ optional :automated_agent_reply, :message, 4, "google.cloud.dialogflow.v2.AutomatedAgentReply"
109
+ optional :message, :message, 6, "google.cloud.dialogflow.v2.Message"
110
+ repeated :human_agent_suggestion_results, :message, 7, "google.cloud.dialogflow.v2.SuggestionResult"
111
+ repeated :end_user_suggestion_results, :message, 8, "google.cloud.dialogflow.v2.SuggestionResult"
112
+ optional :dtmf_parameters, :message, 10, "google.cloud.dialogflow.v2.DtmfParameters"
113
+ end
86
114
  add_message "google.cloud.dialogflow.v2.SuggestArticlesRequest" do
87
115
  optional :parent, :string, 1
88
116
  optional :latest_message, :string, 2
@@ -159,6 +187,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
159
187
  optional :suggest_smart_replies_response, :message, 4, "google.cloud.dialogflow.v2.SuggestSmartRepliesResponse"
160
188
  end
161
189
  end
190
+ add_message "google.cloud.dialogflow.v2.InputTextConfig" do
191
+ optional :language_code, :string, 1
192
+ end
162
193
  add_message "google.cloud.dialogflow.v2.AnnotatedMessagePart" do
163
194
  optional :text, :string, 1
164
195
  optional :entity_type, :string, 2
@@ -189,6 +220,8 @@ module Google
189
220
  AnalyzeContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnalyzeContentRequest").msgclass
190
221
  DtmfParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DtmfParameters").msgclass
191
222
  AnalyzeContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnalyzeContentResponse").msgclass
223
+ StreamingAnalyzeContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest").msgclass
224
+ StreamingAnalyzeContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse").msgclass
192
225
  SuggestArticlesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestArticlesRequest").msgclass
193
226
  SuggestArticlesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestArticlesResponse").msgclass
194
227
  SuggestFaqAnswersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestFaqAnswersRequest").msgclass
@@ -202,6 +235,7 @@ module Google
202
235
  FaqAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FaqAnswer").msgclass
203
236
  SmartReplyAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SmartReplyAnswer").msgclass
204
237
  SuggestionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionResult").msgclass
238
+ InputTextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputTextConfig").msgclass
205
239
  AnnotatedMessagePart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnnotatedMessagePart").msgclass
206
240
  MessageAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.MessageAnnotation").msgclass
207
241
  AssistQueryParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AssistQueryParameters").msgclass
@@ -48,6 +48,22 @@ module Google
48
48
  # sent to virtual agents. See [Versions and
49
49
  # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
50
50
  rpc :AnalyzeContent, ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse
51
+ # Adds a text (chat, for example), or audio (phone recording, for example)
52
+ # message from a participant into the conversation.
53
+ # Note: This method is only available through the gRPC API (not REST).
54
+ #
55
+ # The top-level message sent to the client by the server is
56
+ # `StreamingAnalyzeContentResponse`. Multiple response messages can be
57
+ # returned in order. The first one or more messages contain the
58
+ # `recognition_result` field. Each result represents a more complete
59
+ # transcript of what the user said. The next message contains the
60
+ # `reply_text` field and potentially the `reply_audio` field. The message can
61
+ # also contain the `automated_agent_reply` field.
62
+ #
63
+ # Note: Always use agent versions for production traffic
64
+ # sent to virtual agents. See [Versions and
65
+ # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
66
+ rpc :StreamingAnalyzeContent, stream(::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest), stream(::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse)
51
67
  # Gets suggested articles for a participant based on specific historical
52
68
  # messages.
53
69
  rpc :SuggestArticles, ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse
@@ -75,6 +75,8 @@ module Google
75
75
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
76
76
  }
77
77
 
78
+ default_config.rpcs.streaming_analyze_content.timeout = 220.0
79
+
78
80
  default_config
79
81
  end
80
82
  yield @configure if block_given?
@@ -647,6 +649,98 @@ module Google
647
649
  raise ::Google::Cloud::Error.from_error(e)
648
650
  end
649
651
 
652
+ ##
653
+ # Adds a text (chat, for example), or audio (phone recording, for example)
654
+ # message from a participant into the conversation.
655
+ # Note: This method is only available through the gRPC API (not REST).
656
+ #
657
+ # The top-level message sent to the client by the server is
658
+ # `StreamingAnalyzeContentResponse`. Multiple response messages can be
659
+ # returned in order. The first one or more messages contain the
660
+ # `recognition_result` field. Each result represents a more complete
661
+ # transcript of what the user said. The next message contains the
662
+ # `reply_text` field and potentially the `reply_audio` field. The message can
663
+ # also contain the `automated_agent_reply` field.
664
+ #
665
+ # Note: Always use agent versions for production traffic
666
+ # sent to virtual agents. See [Versions and
667
+ # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
668
+ #
669
+ # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest, ::Hash>]
670
+ # An enumerable of {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest} instances.
671
+ # @param options [::Gapic::CallOptions, ::Hash]
672
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
673
+ #
674
+ # @yield [response, operation] Access the result along with the RPC operation
675
+ # @yieldparam response [::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse>]
676
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
677
+ #
678
+ # @return [::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse>]
679
+ #
680
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
681
+ #
682
+ # @example Basic example
683
+ # require "google/cloud/dialogflow/v2"
684
+ #
685
+ # # Create a client object. The client can be reused for multiple calls.
686
+ # client = Google::Cloud::Dialogflow::V2::Participants::Client.new
687
+ #
688
+ # # Create an input stream
689
+ # input = Gapic::StreamInput.new
690
+ #
691
+ # # Call the streaming_analyze_content method to start streaming.
692
+ # output = client.streaming_analyze_content input
693
+ #
694
+ # # Send requests on the stream. For each request, pass in keyword
695
+ # # arguments to set fields. Be sure to close the stream when done.
696
+ # input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new
697
+ # input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new
698
+ # input.close
699
+ #
700
+ # # Handle streamed responses. These may be interleaved with inputs.
701
+ # # Each response is of type ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse.
702
+ # output.each do |response|
703
+ # p response
704
+ # end
705
+ #
706
+ def streaming_analyze_content request, options = nil
707
+ unless request.is_a? ::Enumerable
708
+ raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
709
+ request = request.to_enum
710
+ end
711
+
712
+ request = request.lazy.map do |req|
713
+ ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest
714
+ end
715
+
716
+ # Converts hash and nil to an options object
717
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
718
+
719
+ # Customize the options with defaults
720
+ metadata = @config.rpcs.streaming_analyze_content.metadata.to_h
721
+
722
+ # Set x-goog-api-client and x-goog-user-project headers
723
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
724
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
725
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
726
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
727
+
728
+ options.apply_defaults timeout: @config.rpcs.streaming_analyze_content.timeout,
729
+ metadata: metadata,
730
+ retry_policy: @config.rpcs.streaming_analyze_content.retry_policy
731
+
732
+ options.apply_defaults timeout: @config.timeout,
733
+ metadata: @config.metadata,
734
+ retry_policy: @config.retry_policy
735
+
736
+ @participants_stub.call_rpc :streaming_analyze_content, request, options: options do |response, operation|
737
+ yield response, operation if block_given?
738
+ return response
739
+ end
740
+ rescue ::GRPC::BadStatus => e
741
+ raise ::Google::Cloud::Error.from_error(e)
742
+ end
743
+
650
744
  ##
651
745
  # Gets suggested articles for a participant based on specific historical
652
746
  # messages.
@@ -1110,6 +1204,11 @@ module Google
1110
1204
  #
1111
1205
  attr_reader :analyze_content
1112
1206
  ##
1207
+ # RPC-specific configuration for `streaming_analyze_content`
1208
+ # @return [::Gapic::Config::Method]
1209
+ #
1210
+ attr_reader :streaming_analyze_content
1211
+ ##
1113
1212
  # RPC-specific configuration for `suggest_articles`
1114
1213
  # @return [::Gapic::Config::Method]
1115
1214
  #
@@ -1137,6 +1236,8 @@ module Google
1137
1236
  @update_participant = ::Gapic::Config::Method.new update_participant_config
1138
1237
  analyze_content_config = parent_rpcs.analyze_content if parent_rpcs.respond_to? :analyze_content
1139
1238
  @analyze_content = ::Gapic::Config::Method.new analyze_content_config
1239
+ streaming_analyze_content_config = parent_rpcs.streaming_analyze_content if parent_rpcs.respond_to? :streaming_analyze_content
1240
+ @streaming_analyze_content = ::Gapic::Config::Method.new streaming_analyze_content_config
1140
1241
  suggest_articles_config = parent_rpcs.suggest_articles if parent_rpcs.respond_to? :suggest_articles
1141
1242
  @suggest_articles = ::Gapic::Config::Method.new suggest_articles_config
1142
1243
  suggest_faq_answers_config = parent_rpcs.suggest_faq_answers if parent_rpcs.respond_to? :suggest_faq_answers
@@ -322,7 +322,7 @@ module Google
322
322
  # If you might use
323
323
  # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
324
324
  # or other CCAI products now or in the future, consider using
325
- # [StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]
325
+ # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content StreamingAnalyzeContent}
326
326
  # instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has
327
327
  # additional functionality for Agent Assist and other CCAI products.
328
328
  #
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Dialogflow
23
23
  module V2
24
- VERSION = "0.17.1"
24
+ VERSION = "0.19.0"
25
25
  end
26
26
  end
27
27
  end
@@ -156,7 +156,7 @@ module Google
156
156
  # @!attribute [rw] disable_no_speech_recognized_event
157
157
  # @return [::Boolean]
158
158
  # Only used in {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} and
159
- # [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent].
159
+ # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent}.
160
160
  # If `false` and recognition doesn't return any result, trigger
161
161
  # `NO_SPEECH_RECOGNIZED` event to Dialogflow agent.
162
162
  class InputAudioConfig
@@ -238,16 +238,34 @@ module Google
238
238
  extend ::Google::Protobuf::MessageExts::ClassMethods
239
239
  end
240
240
 
241
+ # A wrapper of repeated TelephonyDtmf digits.
242
+ # @!attribute [rw] dtmf_events
243
+ # @return [::Array<::Google::Cloud::Dialogflow::V2::TelephonyDtmf>]
244
+ # A sequence of TelephonyDtmf digits.
245
+ class TelephonyDtmfEvents
246
+ include ::Google::Protobuf::MessageExts
247
+ extend ::Google::Protobuf::MessageExts::ClassMethods
248
+ end
249
+
241
250
  # Configures speech transcription for {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile}.
242
251
  # @!attribute [rw] speech_model_variant
243
252
  # @return [::Google::Cloud::Dialogflow::V2::SpeechModelVariant]
244
253
  # The speech model used in speech to text.
245
254
  # `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as
246
255
  # `USE_ENHANCED`. It can be overridden in {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest AnalyzeContentRequest} and
247
- # [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] request.
256
+ # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest StreamingAnalyzeContentRequest} request.
248
257
  # If enhanced model variant is specified and an enhanced
249
258
  # version of the specified model for the language does not exist, then it
250
259
  # would emit an error.
260
+ # @!attribute [rw] model
261
+ # @return [::String]
262
+ # Which Speech model to select. Select the model best suited to your domain
263
+ # to get best results. If a model is not explicitly specified, then a default
264
+ # model is used.
265
+ # Refer to
266
+ # [Cloud Speech API
267
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
268
+ # for more details.
251
269
  class SpeechToTextConfig
252
270
  include ::Google::Protobuf::MessageExts
253
271
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -386,6 +404,61 @@ module Google
386
404
  # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
387
405
  OUTPUT_AUDIO_ENCODING_MULAW = 5
388
406
  end
407
+
408
+ # [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling)
409
+ # digit in Telephony Gateway.
410
+ module TelephonyDtmf
411
+ # Not specified. This value may be used to indicate an absent digit.
412
+ TELEPHONY_DTMF_UNSPECIFIED = 0
413
+
414
+ # Number: '1'.
415
+ DTMF_ONE = 1
416
+
417
+ # Number: '2'.
418
+ DTMF_TWO = 2
419
+
420
+ # Number: '3'.
421
+ DTMF_THREE = 3
422
+
423
+ # Number: '4'.
424
+ DTMF_FOUR = 4
425
+
426
+ # Number: '5'.
427
+ DTMF_FIVE = 5
428
+
429
+ # Number: '6'.
430
+ DTMF_SIX = 6
431
+
432
+ # Number: '7'.
433
+ DTMF_SEVEN = 7
434
+
435
+ # Number: '8'.
436
+ DTMF_EIGHT = 8
437
+
438
+ # Number: '9'.
439
+ DTMF_NINE = 9
440
+
441
+ # Number: '0'.
442
+ DTMF_ZERO = 10
443
+
444
+ # Letter: 'A'.
445
+ DTMF_A = 11
446
+
447
+ # Letter: 'B'.
448
+ DTMF_B = 12
449
+
450
+ # Letter: 'C'.
451
+ DTMF_C = 13
452
+
453
+ # Letter: 'D'.
454
+ DTMF_D = 14
455
+
456
+ # Asterisk/star: '*'.
457
+ DTMF_STAR = 15
458
+
459
+ # Pound/diamond/hash/square/gate/octothorpe: '#'.
460
+ DTMF_POUND = 16
461
+ end
389
462
  end
390
463
  end
391
464
  end
@@ -195,6 +195,11 @@ module Google
195
195
  end
196
196
 
197
197
  # Metadata for [ConversationDatasets][CreateConversationDataset].
198
+ # @!attribute [rw] conversation_dataset
199
+ # @return [::String]
200
+ # The resource name of the conversation dataset that will be created. Format:
201
+ # `projects/<Project ID>/locations/<Location
202
+ # ID>/conversationDatasets/<Conversation Dataset Id>`
198
203
  class CreateConversationDatasetOperationMetadata
199
204
  include ::Google::Protobuf::MessageExts
200
205
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -418,8 +418,8 @@ module Google
418
418
  # and identifies the prevailing subjective opinion, especially to determine
419
419
  # a user's attitude as positive, negative, or neutral:
420
420
  # https://cloud.google.com/natural-language/docs/basics#sentiment_analysis
421
- # For [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] method, result will be in
422
- # [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message].
421
+ # For {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent} method, result will be in
422
+ # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse#message StreamingAnalyzeContentResponse.message.SentimentAnalysisResult}.
423
423
  # For {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} method, result will be in
424
424
  # {::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse#message AnalyzeContentResponse.message.SentimentAnalysisResult}
425
425
  # For {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages Conversations.ListMessages} method, result will be in
@@ -544,13 +544,13 @@ module Google
544
544
  # Unspecified feature type.
545
545
  TYPE_UNSPECIFIED = 0
546
546
 
547
- # Run article suggestion model.
547
+ # Run article suggestion model for chat.
548
548
  ARTICLE_SUGGESTION = 1
549
549
 
550
- # Run FAQ model.
550
+ # Run FAQ model for chat.
551
551
  FAQ = 2
552
552
 
553
- # Run smart reply model.
553
+ # Run smart reply model for chat.
554
554
  SMART_REPLY = 3
555
555
  end
556
556
  end
@@ -36,6 +36,36 @@ module Google
36
36
  # Optional. Label applied to streams representing this participant in SIPREC
37
37
  # XML metadata and SDP. This is used to assign transcriptions from that
38
38
  # media stream to this participant. This field can be updated.
39
+ # @!attribute [rw] obfuscated_external_user_id
40
+ # @return [::String]
41
+ # Optional. Obfuscated user id that should be associated with the created participant.
42
+ #
43
+ # You can specify a user id as follows:
44
+ #
45
+ # 1. If you set this field in
46
+ # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest#participant CreateParticipantRequest} or
47
+ # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest#participant UpdateParticipantRequest},
48
+ # Dialogflow adds the obfuscated user id with the participant.
49
+ #
50
+ # 2. If you set this field in
51
+ # [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or
52
+ # [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
53
+ # Dialogflow will update {::Google::Cloud::Dialogflow::V2::Participant#obfuscated_external_user_id Participant.obfuscated_external_user_id}.
54
+ #
55
+ # Dialogflow returns an error if you try to add a user id for a
56
+ # non-{::Google::Cloud::Dialogflow::V2::Participant::Role::END_USER END_USER} participant.
57
+ #
58
+ # Dialogflow uses this user id for billing and measurement purposes. For
59
+ # example, Dialogflow determines whether a user in one conversation returned
60
+ # in a later conversation.
61
+ #
62
+ # Note:
63
+ #
64
+ # * Please never pass raw user ids to Dialogflow. Always obfuscate your user
65
+ # id first.
66
+ # * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
67
+ # hash function like SHA-512.
68
+ # * The length of the user id must be <= 256 characters.
39
69
  # @!attribute [rw] documents_metadata_filters
40
70
  # @return [::Google::Protobuf::Map{::String => ::String}]
41
71
  # Optional. Key-value filters on the metadata of documents returned by article
@@ -298,6 +328,166 @@ module Google
298
328
  extend ::Google::Protobuf::MessageExts::ClassMethods
299
329
  end
300
330
 
331
+ # The top-level message sent by the client to the
332
+ # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent} method.
333
+ #
334
+ # Multiple request messages should be sent in order:
335
+ #
336
+ # 1. The first message must contain
337
+ # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#participant participant},
338
+ # [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] and optionally
339
+ # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#query_params query_params}. If you want
340
+ # to receive an audio response, it should also contain
341
+ # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#reply_audio_config reply_audio_config}.
342
+ # The message must not contain
343
+ # [input][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input].
344
+ #
345
+ # 2. If [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message
346
+ # was set to {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#audio_config audio_config},
347
+ # all subsequent messages must contain
348
+ # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#input_audio input_audio} to continue
349
+ # with Speech recognition.
350
+ # However, note that:
351
+ #
352
+ # * Dialogflow will bill you for the audio so far.
353
+ # * Dialogflow discards all Speech recognition results in favor of the
354
+ # text input.
355
+ #
356
+ # 3. If [StreamingAnalyzeContentRequest.config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message was set
357
+ # to {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#text_config StreamingAnalyzeContentRequest.text_config}, then the second message
358
+ # must contain only {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#input_text input_text}.
359
+ # Moreover, you must not send more than two messages.
360
+ #
361
+ # After you sent all input, you must half-close or abort the request stream.
362
+ # @!attribute [rw] participant
363
+ # @return [::String]
364
+ # Required. The name of the participant this text comes from.
365
+ # Format: `projects/<Project ID>/locations/<Location
366
+ # ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
367
+ # @!attribute [rw] audio_config
368
+ # @return [::Google::Cloud::Dialogflow::V2::InputAudioConfig]
369
+ # Instructs the speech recognizer how to process the speech audio.
370
+ # @!attribute [rw] text_config
371
+ # @return [::Google::Cloud::Dialogflow::V2::InputTextConfig]
372
+ # The natural language text to be processed.
373
+ # @!attribute [rw] reply_audio_config
374
+ # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig]
375
+ # Speech synthesis configuration.
376
+ # The speech synthesis settings for a virtual agent that may be configured
377
+ # for the associated conversation profile are not used when calling
378
+ # StreamingAnalyzeContent. If this configuration is not supplied, speech
379
+ # synthesis is disabled.
380
+ # @!attribute [rw] input_audio
381
+ # @return [::String]
382
+ # The input audio content to be recognized. Must be sent if `audio_config`
383
+ # is set in the first message. The complete audio over all streaming
384
+ # messages must not exceed 1 minute.
385
+ # @!attribute [rw] input_text
386
+ # @return [::String]
387
+ # The UTF-8 encoded natural language text to be processed. Must be sent if
388
+ # `text_config` is set in the first message. Text length must not exceed
389
+ # 256 bytes for virtual agent interactions. The `input_text` field can be
390
+ # only sent once.
391
+ # @!attribute [rw] input_dtmf
392
+ # @return [::Google::Cloud::Dialogflow::V2::TelephonyDtmfEvents]
393
+ # The DTMF digits used to invoke intent and fill in parameter value.
394
+ #
395
+ # This input is ignored if the previous response indicated that DTMF input
396
+ # is not accepted.
397
+ # @!attribute [rw] query_params
398
+ # @return [::Google::Cloud::Dialogflow::V2::QueryParameters]
399
+ # Parameters for a Dialogflow virtual-agent query.
400
+ # @!attribute [rw] assist_query_params
401
+ # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters]
402
+ # Parameters for a human assist query.
403
+ # @!attribute [rw] cx_parameters
404
+ # @return [::Google::Protobuf::Struct]
405
+ # Additional parameters to be put into Dialogflow CX session parameters. To
406
+ # remove a parameter from the session, clients should explicitly set the
407
+ # parameter value to null.
408
+ #
409
+ # Note: this field should only be used if you are connecting to a Dialogflow
410
+ # CX agent.
411
+ # @!attribute [rw] enable_partial_automated_agent_reply
412
+ # @return [::Boolean]
413
+ # Enable partial virtual agent responses. If this flag is not enabled,
414
+ # response stream still contains only one final response even if some
415
+ # `Fulfillment`s in Dialogflow virtual agent have been configured to return
416
+ # partial responses.
417
+ class StreamingAnalyzeContentRequest
418
+ include ::Google::Protobuf::MessageExts
419
+ extend ::Google::Protobuf::MessageExts::ClassMethods
420
+ end
421
+
422
+ # The top-level message returned from the `StreamingAnalyzeContent` method.
423
+ #
424
+ # Multiple response messages can be returned in order:
425
+ #
426
+ # 1. If the input was set to streaming audio, the first one or more messages
427
+ # contain `recognition_result`. Each `recognition_result` represents a more
428
+ # complete transcript of what the user said. The last `recognition_result`
429
+ # has `is_final` set to `true`.
430
+ #
431
+ # 2. In virtual agent stage: if `enable_partial_automated_agent_reply` is
432
+ # true, the following N (currently 1 <= N <= 4) messages
433
+ # contain `automated_agent_reply` and optionally `reply_audio`
434
+ # returned by the virtual agent. The first (N-1)
435
+ # `automated_agent_reply`s will have `automated_agent_reply_type` set to
436
+ # `PARTIAL`. The last `automated_agent_reply` has
437
+ # `automated_agent_reply_type` set to `FINAL`.
438
+ # If `enable_partial_automated_agent_reply` is not enabled, response stream
439
+ # only contains the final reply.
440
+ #
441
+ # In human assist stage: the following N (N >= 1) messages contain
442
+ # `human_agent_suggestion_results`, `end_user_suggestion_results` or
443
+ # `message`.
444
+ # @!attribute [rw] recognition_result
445
+ # @return [::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult]
446
+ # The result of speech recognition.
447
+ # @!attribute [rw] reply_text
448
+ # @return [::String]
449
+ # The output text content.
450
+ # This field is set if an automated agent responded with a text for the user.
451
+ # @!attribute [rw] reply_audio
452
+ # @return [::Google::Cloud::Dialogflow::V2::OutputAudio]
453
+ # The audio data bytes encoded as specified in the request.
454
+ # This field is set if:
455
+ #
456
+ # - The `reply_audio_config` field is specified in the request.
457
+ # - The automated agent, which this output comes from, responded with audio.
458
+ # In such case, the `reply_audio.config` field contains settings used to
459
+ # synthesize the speech.
460
+ #
461
+ # In some scenarios, multiple output audio fields may be present in the
462
+ # response structure. In these cases, only the top-most-level audio output
463
+ # has content.
464
+ # @!attribute [rw] automated_agent_reply
465
+ # @return [::Google::Cloud::Dialogflow::V2::AutomatedAgentReply]
466
+ # Only set if a Dialogflow automated agent has responded.
467
+ # Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
468
+ # and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
469
+ # are always empty, use {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse#reply_audio reply_audio} instead.
470
+ # @!attribute [rw] message
471
+ # @return [::Google::Cloud::Dialogflow::V2::Message]
472
+ # Message analyzed by CCAI.
473
+ # @!attribute [rw] human_agent_suggestion_results
474
+ # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>]
475
+ # The suggestions for most recent human agent. The order is the same as
476
+ # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} of
477
+ # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#human_agent_suggestion_config HumanAgentAssistantConfig.human_agent_suggestion_config}.
478
+ # @!attribute [rw] end_user_suggestion_results
479
+ # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>]
480
+ # The suggestions for end user. The order is the same as
481
+ # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} of
482
+ # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#end_user_suggestion_config HumanAgentAssistantConfig.end_user_suggestion_config}.
483
+ # @!attribute [rw] dtmf_parameters
484
+ # @return [::Google::Cloud::Dialogflow::V2::DtmfParameters]
485
+ # Indicates the parameters of DTMF.
486
+ class StreamingAnalyzeContentResponse
487
+ include ::Google::Protobuf::MessageExts
488
+ extend ::Google::Protobuf::MessageExts::ClassMethods
489
+ end
490
+
301
491
  # The request message for {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles Participants.SuggestArticles}.
302
492
  # @!attribute [rw] parent
303
493
  # @return [::String]
@@ -613,6 +803,17 @@ module Google
613
803
  extend ::Google::Protobuf::MessageExts::ClassMethods
614
804
  end
615
805
 
806
+ # Defines the language used in the input text.
807
+ # @!attribute [rw] language_code
808
+ # @return [::String]
809
+ # Required. The language of this conversational query. See [Language
810
+ # Support](https://cloud.google.com/dialogflow/docs/reference/language)
811
+ # for a list of the currently supported language codes.
812
+ class InputTextConfig
813
+ include ::Google::Protobuf::MessageExts
814
+ extend ::Google::Protobuf::MessageExts::ClassMethods
815
+ end
816
+
616
817
  # Represents a part of a message possibly annotated with an entity. The part
617
818
  # can be an entity or purely a part of the message between two entities or
618
819
  # message start/end.
@@ -623,7 +623,7 @@ module Google
623
623
  # [Participants.StreamingDetectIntent][], it needs to be configured in
624
624
  # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_params StreamingDetectIntentRequest.query_params}.
625
625
  # And for {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} and
626
- # [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent], it needs to be configured in
626
+ # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent}, it needs to be configured in
627
627
  # {::Google::Cloud::Dialogflow::V2::ConversationProfile#human_agent_assistant_config ConversationProfile.human_agent_assistant_config}
628
628
  # @!attribute [rw] query_text_sentiment
629
629
  # @return [::Google::Cloud::Dialogflow::V2::Sentiment]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-dialogflow-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-28 00:00:00.000000000 Z
11
+ date: 2022-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.10'
19
+ version: '0.12'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.10'
29
+ version: '0.12'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a