google-cloud-dialogflow 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92b5c30e5897a4f6d758eb5cbd9310327f5990a092614eeb9706c6639f0607ca
4
- data.tar.gz: d1cd937baff519d9826fe8496989cb530d463c75d06961710eaff958523b4b6c
3
+ metadata.gz: de14dd82beb35115c1c6e68a30a764c9ce892342e95391fca91540855df8d3c5
4
+ data.tar.gz: d0c74e2dc3c330173be0ede40f81892ade58897638805e0fd48baa894769c6e2
5
5
  SHA512:
6
- metadata.gz: c1b9f3a934de895868b48706974b9f9304f6b60ad07c688c3b8f79c380da6ae97cf65e0e1cd819140699188787d74e1040e45de1cb79066a5a56170fff0bbb29
7
- data.tar.gz: e00b444804da8598903cb76f74a3d1880216487ca91b7b4c6a65ff7f5a68ef58b597c370273ed7b0c227eb5e3d41b6b52d5bc0ae748c38b9f8a3f43358c302cb
6
+ metadata.gz: b1738cd4bbdc9c2d818b337bffea41962fe44698c5147a41f86ed1ef47cb8797e57165cc981ba24916f772b0f64263d1255072c42a533c48dfeb6fd6c054e171
7
+ data.tar.gz: 7f5cb21d7015a0801a13eda3c5d9959a777579a6c548eff9c7afdd5c51522a9a1db726bb4f901960b968bbde548ab7813febc5caca688b69c15ee2d538cddb09
@@ -9,11 +9,24 @@ require 'google/api/resource_pb'
9
9
  require 'google/protobuf/duration_pb'
10
10
  require 'google/api/annotations_pb'
11
11
  Google::Protobuf::DescriptorPool.generated_pool.build do
12
+ add_message "google.cloud.dialogflow.v2.SpeechContext" do
13
+ repeated :phrases, :string, 1
14
+ optional :boost, :float, 2
15
+ end
16
+ add_message "google.cloud.dialogflow.v2.SpeechWordInfo" do
17
+ optional :word, :string, 3
18
+ optional :start_offset, :message, 1, "google.protobuf.Duration"
19
+ optional :end_offset, :message, 2, "google.protobuf.Duration"
20
+ optional :confidence, :float, 4
21
+ end
12
22
  add_message "google.cloud.dialogflow.v2.InputAudioConfig" do
13
23
  optional :audio_encoding, :enum, 1, "google.cloud.dialogflow.v2.AudioEncoding"
14
24
  optional :sample_rate_hertz, :int32, 2
15
25
  optional :language_code, :string, 3
26
+ optional :enable_word_info, :bool, 13
16
27
  repeated :phrase_hints, :string, 4
28
+ repeated :speech_contexts, :message, 11, "google.cloud.dialogflow.v2.SpeechContext"
29
+ optional :model, :string, 7
17
30
  optional :model_variant, :enum, 10, "google.cloud.dialogflow.v2.SpeechModelVariant"
18
31
  optional :single_utterance, :bool, 8
19
32
  end
@@ -67,6 +80,8 @@ module Google
67
80
  module Cloud
68
81
  module Dialogflow
69
82
  module V2
83
+ SpeechContext = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechContext").msgclass
84
+ SpeechWordInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechWordInfo").msgclass
70
85
  InputAudioConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputAudioConfig").msgclass
71
86
  VoiceSelectionParams = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.VoiceSelectionParams").msgclass
72
87
  SynthesizeSpeechConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SynthesizeSpeechConfig").msgclass
@@ -17,6 +17,59 @@ module Google
17
17
  module Cloud
18
18
  module Dialogflow
19
19
  module V2
20
+ # Hints for the speech recognizer to help with recognition in a specific
21
+ # conversation state.
22
+ # @!attribute [rw] phrases
23
+ # @return [Array<String>]
24
+ # Optional. A list of strings containing words and phrases that the speech
25
+ # recognizer should recognize with higher likelihood.
26
+ #
27
+ # This list can be used to:
28
+ # * improve accuracy for words and phrases you expect the user to say,
29
+ # e.g. typical commands for your Dialogflow agent
30
+ # * add additional words to the speech recognizer vocabulary
31
+ # * ...
32
+ #
33
+ # See the [Cloud Speech
34
+ # documentation](https://cloud.google.com/speech-to-text/quotas) for usage
35
+ # limits.
36
+ # @!attribute [rw] boost
37
+ # @return [Float]
38
+ # Optional. Boost for this context compared to other contexts:
39
+ # * If the boost is positive, Dialogflow will increase the probability that
40
+ # the phrases in this context are recognized over similar sounding phrases.
41
+ # * If the boost is unspecified or non-positive, Dialogflow will not apply
42
+ # any boost.
43
+ #
44
+ # Dialogflow recommends that you use boosts in the range (0, 20] and that you
45
+ # find a value that fits your use case with binary search.
46
+ class SpeechContext; end
47
+
48
+ # Information for a word recognized by the speech recognizer.
49
+ # @!attribute [rw] word
50
+ # @return [String]
51
+ # The word this info is for.
52
+ # @!attribute [rw] start_offset
53
+ # @return [Google::Protobuf::Duration]
54
+ # Time offset relative to the beginning of the audio that corresponds to the
55
+ # start of the spoken word. This is an experimental feature and the accuracy
56
+ # of the time offset can vary.
57
+ # @!attribute [rw] end_offset
58
+ # @return [Google::Protobuf::Duration]
59
+ # Time offset relative to the beginning of the audio that corresponds to the
60
+ # end of the spoken word. This is an experimental feature and the accuracy of
61
+ # the time offset can vary.
62
+ # @!attribute [rw] confidence
63
+ # @return [Float]
64
+ # The Speech confidence between 0.0 and 1.0 for this word. A higher number
65
+ # indicates an estimated greater likelihood that the recognized word is
66
+ # correct. The default of 0.0 is a sentinel value indicating that confidence
67
+ # was not set.
68
+ #
69
+ # This field is not guaranteed to be fully stable over time for the same
70
+ # audio input. Users should also not rely on it to always be provided.
71
+ class SpeechWordInfo; end
72
+
20
73
  # Instructs the speech recognizer how to process the audio content.
21
74
  # @!attribute [rw] audio_encoding
22
75
  # @return [Google::Cloud::Dialogflow::V2::AudioEncoding]
@@ -35,6 +88,12 @@ module Google
35
88
  # Support](https://cloud.google.com/dialogflow/docs/reference/language)
36
89
  # for a list of the currently supported language codes. Note that queries in
37
90
  # the same session do not necessarily need to specify the same language.
91
+ # @!attribute [rw] enable_word_info
92
+ # @return [true, false]
93
+ # Optional. If `true`, Dialogflow returns {Google::Cloud::Dialogflow::V2::SpeechWordInfo SpeechWordInfo} in
94
+ # {Google::Cloud::Dialogflow::V2::StreamingRecognitionResult StreamingRecognitionResult} with information about the recognized speech
95
+ # words, e.g. start and end time offsets. If false or unspecified, Speech
96
+ # doesn't return any word-level information.
38
97
  # @!attribute [rw] phrase_hints
39
98
  # @return [Array<String>]
40
99
  # Optional. A list of strings containing words and phrases that the speech
@@ -43,6 +102,30 @@ module Google
43
102
  # See [the Cloud Speech
44
103
  # documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
45
104
  # for more details.
105
+ #
106
+ # This field is deprecated. Please use [speech_contexts]() instead. If you
107
+ # specify both [phrase_hints]() and [speech_contexts](), Dialogflow will
108
+ # treat the [phrase_hints]() as a single additional [SpeechContext]().
109
+ # @!attribute [rw] speech_contexts
110
+ # @return [Array<Google::Cloud::Dialogflow::V2::SpeechContext>]
111
+ # Optional. Context information to assist speech recognition.
112
+ #
113
+ # See [the Cloud Speech
114
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints)
115
+ # for more details.
116
+ # @!attribute [rw] model
117
+ # @return [String]
118
+ # Optional. Which Speech model to select for the given request. Select the
119
+ # model best suited to your domain to get best results. If a model is not
120
+ # explicitly specified, then we auto-select a model based on the parameters
121
+ # in the InputAudioConfig.
122
+ # If enhanced speech model is enabled for the agent and an enhanced
123
+ # version of the specified model for the language does not exist, then the
124
+ # speech is recognized using the standard version of the specified model.
125
+ # Refer to
126
+ # [Cloud Speech API
127
+ # documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
128
+ # for more details.
46
129
  # @!attribute [rw] model_variant
47
130
  # @return [Google::Cloud::Dialogflow::V2::SpeechModelVariant]
48
131
  # Optional. Which variant of the {Google::Cloud::Dialogflow::V2::InputAudioConfig#model Speech model} to use.
@@ -25,6 +25,13 @@ module Google
25
25
  #
26
26
  # The `Context ID` is always converted to lowercase, may only contain
27
27
  # characters in [a-zA-Z0-9_-%] and may be at most 250 bytes long.
28
+ #
29
+ # The following context names are reserved for internal use by Dialogflow.
30
+ # You should not use these contexts or create contexts with these names:
31
+ #
32
+ # * `__system_counters__`
33
+ # * `*_id_dialog_context`
34
+ # * `*_dialog_params_size`
28
35
  # @!attribute [rw] lifespan_count
29
36
  # @return [Integer]
30
37
  # Optional. The number of conversational query requests after which the
@@ -102,8 +102,9 @@ module Google
102
102
  # @return [String]
103
103
  # Read-only after creation. The unique identifier of the parent intent in the
104
104
  # chain of followup intents. You can set this field when creating an intent,
105
- # for example with {CreateIntent} or {BatchUpdateIntents}, in order to
106
- # make this intent a followup intent.
105
+ # for example with {Google::Cloud::Dialogflow::V2::Intents::CreateIntent CreateIntent} or
106
+ # {Google::Cloud::Dialogflow::V2::Intents::BatchUpdateIntents BatchUpdateIntents}, in order to make this
107
+ # intent a followup intent.
107
108
  #
108
109
  # It identifies the parent followup intent.
109
110
  # Format: `projects/<Project ID>/agent/intents/<Intent ID>`.
@@ -208,9 +208,13 @@ module Google
208
208
  # the greatest `knowledgeAnswers.match_confidence` value in the list.
209
209
  # @!attribute [rw] diagnostic_info
210
210
  # @return [Google::Protobuf::Struct]
211
- # The free-form diagnostic info. For example, this field could contain
212
- # webhook call latency. The string keys of the Struct's fields map can change
213
- # without notice.
211
+ # Free-form diagnostic information for the associated detect intent request.
212
+ # The fields of this data can change without notice, so you should not write
213
+ # code that depends on its structure.
214
+ # The data may contain:
215
+ #
216
+ # * webhook call latency
217
+ # * webhook errors
214
218
  # @!attribute [rw] sentiment_analysis_result
215
219
  # @return [Google::Cloud::Dialogflow::V2::SentimentAnalysisResult]
216
220
  # The sentiment analysis result, which depends on the
@@ -218,23 +222,26 @@ module Google
218
222
  class QueryResult; end
219
223
 
220
224
  # The top-level message sent by the client to the
221
- # {StreamingDetectIntent} method.
225
+ # {Google::Cloud::Dialogflow::V2::Sessions::StreamingDetectIntent Sessions::StreamingDetectIntent} method.
222
226
  #
223
227
  # Multiple request messages should be sent in order:
224
228
  #
225
- # 1. The first message must contain {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#session StreamingDetectIntentRequest#session},
226
- # [StreamingDetectIntentRequest.query_input] plus optionally
227
- # [StreamingDetectIntentRequest.query_params]. If the client wants to
228
- # receive an audio response, it should also contain
229
- # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config StreamingDetectIntentRequest#output_audio_config}. The message
230
- # must not contain {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio StreamingDetectIntentRequest#input_audio}.
231
- # 2. If {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_input StreamingDetectIntentRequest#query_input} was set to
232
- # {StreamingDetectIntentRequest#query_input#audio_config}, all subsequent
233
- # messages must contain [StreamingDetectIntentRequest.input_audio] to
234
- # continue with Speech recognition.
229
+ # 1. The first message must contain
230
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#session session},
231
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_input query_input} plus optionally
232
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_params query_params}. If the client
233
+ # wants to receive an audio response, it should also contain
234
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#output_audio_config output_audio_config}.
235
+ # The message must not contain
236
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio input_audio}.
237
+ # 2. If {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_input query_input} was set to
238
+ # {Google::Cloud::Dialogflow::V2::InputAudioConfig query_input::audio_config}, all subsequent
239
+ # messages must contain
240
+ # {Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#input_audio input_audio} to continue with
241
+ # Speech recognition.
235
242
  # If you decide to rather detect an intent from text input after you
236
243
  # already started Speech recognition, please send a message with
237
- # {StreamingDetectIntentRequest#query_input#text}.
244
+ # {Google::Cloud::Dialogflow::V2::QueryInput#text query_input::text}.
238
245
  #
239
246
  # However, note that:
240
247
  #
@@ -380,6 +387,15 @@ module Google
380
387
  #
381
388
  # This field is typically only provided if `is_final` is true and you should
382
389
  # not rely on it being accurate or even set.
390
+ # @!attribute [rw] speech_word_info
391
+ # @return [Array<Google::Cloud::Dialogflow::V2::SpeechWordInfo>]
392
+ # Word-specific information for the words recognized by Speech in
393
+ # {Google::Cloud::Dialogflow::V2::StreamingRecognitionResult#transcript transcript}. Populated if and only if `message_type` = `TRANSCRIPT` and
394
+ # [InputAudioConfig.enable_word_info] is set.
395
+ # @!attribute [rw] speech_end_offset
396
+ # @return [Google::Protobuf::Duration]
397
+ # Time offset of the end of this Speech recognition result relative to the
398
+ # beginning of the audio. Only populated for `message_type` = `TRANSCRIPT`.
383
399
  class StreamingRecognitionResult
384
400
  # Type of the response message.
385
401
  module MessageType
@@ -0,0 +1,91 @@
1
+ # Copyright 2019 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ module Google
17
+ module Protobuf
18
+ # A Duration represents a signed, fixed-length span of time represented
19
+ # as a count of seconds and fractions of seconds at nanosecond
20
+ # resolution. It is independent of any calendar and concepts like "day"
21
+ # or "month". It is related to Timestamp in that the difference between
22
+ # two Timestamp values is a Duration and it can be added or subtracted
23
+ # from a Timestamp. Range is approximately +-10,000 years.
24
+ #
25
+ # = Examples
26
+ #
27
+ # Example 1: Compute Duration from two Timestamps in pseudo code.
28
+ #
29
+ # Timestamp start = ...;
30
+ # Timestamp end = ...;
31
+ # Duration duration = ...;
32
+ #
33
+ # duration.seconds = end.seconds - start.seconds;
34
+ # duration.nanos = end.nanos - start.nanos;
35
+ #
36
+ # if (duration.seconds < 0 && duration.nanos > 0) {
37
+ # duration.seconds += 1;
38
+ # duration.nanos -= 1000000000;
39
+ # } else if (durations.seconds > 0 && duration.nanos < 0) {
40
+ # duration.seconds -= 1;
41
+ # duration.nanos += 1000000000;
42
+ # }
43
+ #
44
+ # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
45
+ #
46
+ # Timestamp start = ...;
47
+ # Duration duration = ...;
48
+ # Timestamp end = ...;
49
+ #
50
+ # end.seconds = start.seconds + duration.seconds;
51
+ # end.nanos = start.nanos + duration.nanos;
52
+ #
53
+ # if (end.nanos < 0) {
54
+ # end.seconds -= 1;
55
+ # end.nanos += 1000000000;
56
+ # } else if (end.nanos >= 1000000000) {
57
+ # end.seconds += 1;
58
+ # end.nanos -= 1000000000;
59
+ # }
60
+ #
61
+ # Example 3: Compute Duration from datetime.timedelta in Python.
62
+ #
63
+ # td = datetime.timedelta(days=3, minutes=10)
64
+ # duration = Duration()
65
+ # duration.FromTimedelta(td)
66
+ #
67
+ # = JSON Mapping
68
+ #
69
+ # In JSON format, the Duration type is encoded as a string rather than an
70
+ # object, where the string ends in the suffix "s" (indicating seconds) and
71
+ # is preceded by the number of seconds, with nanoseconds expressed as
72
+ # fractional seconds. For example, 3 seconds with 0 nanoseconds should be
73
+ # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
74
+ # be expressed in JSON format as "3.000000001s", and 3 seconds and 1
75
+ # microsecond should be expressed in JSON format as "3.000001s".
76
+ # @!attribute [rw] seconds
77
+ # @return [Integer]
78
+ # Signed seconds of the span of time. Must be from -315,576,000,000
79
+ # to +315,576,000,000 inclusive. Note: these bounds are computed from:
80
+ # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
81
+ # @!attribute [rw] nanos
82
+ # @return [Integer]
83
+ # Signed fractions of a second at nanosecond resolution of the span
84
+ # of time. Durations less than one second are represented with a 0
85
+ # `seconds` field and a positive or negative `nanos` field. For durations
86
+ # of one second or more, a non-zero value for the `nanos` field must be
87
+ # of the same sign as the `seconds` field. Must be from -999,999,999
88
+ # to +999,999,999 inclusive.
89
+ class Duration; end
90
+ end
91
+ end
@@ -88,10 +88,12 @@ module Google
88
88
  # method does not affect entities in the entity type that aren't explicitly
89
89
  # specified in the request.
90
90
  #
91
+ #
91
92
  # Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
92
93
  rpc :BatchUpdateEntities, BatchUpdateEntitiesRequest, Google::Longrunning::Operation
93
94
  # Deletes entities in the specified entity type.
94
95
  #
96
+ #
95
97
  # Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
96
98
  rpc :BatchDeleteEntities, BatchDeleteEntitiesRequest, Google::Longrunning::Operation
97
99
  end
@@ -820,6 +820,7 @@ module Google
820
820
  # method does not affect entities in the entity type that aren't explicitly
821
821
  # specified in the request.
822
822
  #
823
+ #
823
824
  # Operation <response: {Google::Protobuf::Empty}>
824
825
  #
825
826
  # @param parent [String]
@@ -907,6 +908,7 @@ module Google
907
908
 
908
909
  # Deletes entities in the specified entity type.
909
910
  #
911
+ #
910
912
  # Operation <response: {Google::Protobuf::Empty}>
911
913
  #
912
914
  # @param parent [String]
@@ -84,6 +84,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
84
84
  optional :transcript, :string, 2
85
85
  optional :is_final, :bool, 3
86
86
  optional :confidence, :float, 4
87
+ repeated :speech_word_info, :message, 7, "google.cloud.dialogflow.v2.SpeechWordInfo"
88
+ optional :speech_end_offset, :message, 8, "google.protobuf.Duration"
87
89
  end
88
90
  add_enum "google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType" do
89
91
  value :MESSAGE_TYPE_UNSPECIFIED, 0
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Dialogflow
19
- VERSION = "0.11.1".freeze
19
+ VERSION = "0.12.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-dialogflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.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: 2019-11-20 00:00:00.000000000 Z
11
+ date: 2019-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-gax
@@ -165,6 +165,7 @@ files:
165
165
  - lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session_entity_type.rb
166
166
  - lib/google/cloud/dialogflow/v2/doc/google/longrunning/operations.rb
167
167
  - lib/google/cloud/dialogflow/v2/doc/google/protobuf/any.rb
168
+ - lib/google/cloud/dialogflow/v2/doc/google/protobuf/duration.rb
168
169
  - lib/google/cloud/dialogflow/v2/doc/google/protobuf/empty.rb
169
170
  - lib/google/cloud/dialogflow/v2/doc/google/protobuf/field_mask.rb
170
171
  - lib/google/cloud/dialogflow/v2/doc/google/protobuf/struct.rb