google-cloud-speech-v1 0.4.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -143,6 +143,27 @@ module Google
143
143
  #
144
144
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
145
145
  #
146
+ # @example Basic example
147
+ # require "google/longrunning"
148
+ #
149
+ # # Create a client object. The client can be reused for multiple calls.
150
+ # client = Google::Longrunning::Operations::Client.new
151
+ #
152
+ # # Create a request. To set request fields, pass in keyword arguments.
153
+ # request = Google::Longrunning::ListOperationsRequest.new
154
+ #
155
+ # # Call the list_operations method.
156
+ # result = client.list_operations request
157
+ #
158
+ # # The returned object is of type Gapic::PagedEnumerable. You can
159
+ # # iterate over all elements by calling #each, and the enumerable
160
+ # # will lazily make API calls to fetch subsequent pages. Other
161
+ # # methods are also available for managing paging directly.
162
+ # result.each do |response|
163
+ # # Each element is of type ::Google::Longrunning::Operation.
164
+ # p response
165
+ # end
166
+ #
146
167
  def list_operations request, options = nil
147
168
  raise ::ArgumentError, "request must be provided" if request.nil?
148
169
 
@@ -160,16 +181,20 @@ module Google
160
181
  gapic_version: ::Google::Cloud::Speech::V1::VERSION
161
182
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
162
183
 
163
- header_params = {
164
- "name" => request.name
165
- }
184
+ header_params = {}
185
+ if request.name
186
+ header_params["name"] = request.name
187
+ end
188
+
166
189
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
167
190
  metadata[:"x-goog-request-params"] ||= request_params_header
168
191
 
169
192
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
170
193
  metadata: metadata,
171
194
  retry_policy: @config.rpcs.list_operations.retry_policy
172
- options.apply_defaults metadata: @config.metadata,
195
+
196
+ options.apply_defaults timeout: @config.timeout,
197
+ metadata: @config.metadata,
173
198
  retry_policy: @config.retry_policy
174
199
 
175
200
  @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
@@ -213,6 +238,28 @@ module Google
213
238
  #
214
239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
215
240
  #
241
+ # @example Basic example
242
+ # require "google/longrunning"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Longrunning::Operations::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Longrunning::GetOperationRequest.new
249
+ #
250
+ # # Call the get_operation method.
251
+ # result = client.get_operation request
252
+ #
253
+ # # The returned object is of type Gapic::Operation. You can use this
254
+ # # object to check the status of an operation, cancel it, or wait
255
+ # # for results. Here is how to block until completion:
256
+ # result.wait_until_done! timeout: 60
257
+ # if result.response?
258
+ # p result.response
259
+ # else
260
+ # puts "Error!"
261
+ # end
262
+ #
216
263
  def get_operation request, options = nil
217
264
  raise ::ArgumentError, "request must be provided" if request.nil?
218
265
 
@@ -230,16 +277,20 @@ module Google
230
277
  gapic_version: ::Google::Cloud::Speech::V1::VERSION
231
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
232
279
 
233
- header_params = {
234
- "name" => request.name
235
- }
280
+ header_params = {}
281
+ if request.name
282
+ header_params["name"] = request.name
283
+ end
284
+
236
285
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
237
286
  metadata[:"x-goog-request-params"] ||= request_params_header
238
287
 
239
288
  options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
240
289
  metadata: metadata,
241
290
  retry_policy: @config.rpcs.get_operation.retry_policy
242
- options.apply_defaults metadata: @config.metadata,
291
+
292
+ options.apply_defaults timeout: @config.timeout,
293
+ metadata: @config.metadata,
243
294
  retry_policy: @config.retry_policy
244
295
 
245
296
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
@@ -283,6 +334,21 @@ module Google
283
334
  #
284
335
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
285
336
  #
337
+ # @example Basic example
338
+ # require "google/longrunning"
339
+ #
340
+ # # Create a client object. The client can be reused for multiple calls.
341
+ # client = Google::Longrunning::Operations::Client.new
342
+ #
343
+ # # Create a request. To set request fields, pass in keyword arguments.
344
+ # request = Google::Longrunning::DeleteOperationRequest.new
345
+ #
346
+ # # Call the delete_operation method.
347
+ # result = client.delete_operation request
348
+ #
349
+ # # The returned object is of type Google::Protobuf::Empty.
350
+ # p result
351
+ #
286
352
  def delete_operation request, options = nil
287
353
  raise ::ArgumentError, "request must be provided" if request.nil?
288
354
 
@@ -300,16 +366,20 @@ module Google
300
366
  gapic_version: ::Google::Cloud::Speech::V1::VERSION
301
367
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
302
368
 
303
- header_params = {
304
- "name" => request.name
305
- }
369
+ header_params = {}
370
+ if request.name
371
+ header_params["name"] = request.name
372
+ end
373
+
306
374
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
307
375
  metadata[:"x-goog-request-params"] ||= request_params_header
308
376
 
309
377
  options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
310
378
  metadata: metadata,
311
379
  retry_policy: @config.rpcs.delete_operation.retry_policy
312
- options.apply_defaults metadata: @config.metadata,
380
+
381
+ options.apply_defaults timeout: @config.timeout,
382
+ metadata: @config.metadata,
313
383
  retry_policy: @config.retry_policy
314
384
 
315
385
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
@@ -358,6 +428,21 @@ module Google
358
428
  #
359
429
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
360
430
  #
431
+ # @example Basic example
432
+ # require "google/longrunning"
433
+ #
434
+ # # Create a client object. The client can be reused for multiple calls.
435
+ # client = Google::Longrunning::Operations::Client.new
436
+ #
437
+ # # Create a request. To set request fields, pass in keyword arguments.
438
+ # request = Google::Longrunning::CancelOperationRequest.new
439
+ #
440
+ # # Call the cancel_operation method.
441
+ # result = client.cancel_operation request
442
+ #
443
+ # # The returned object is of type Google::Protobuf::Empty.
444
+ # p result
445
+ #
361
446
  def cancel_operation request, options = nil
362
447
  raise ::ArgumentError, "request must be provided" if request.nil?
363
448
 
@@ -375,16 +460,20 @@ module Google
375
460
  gapic_version: ::Google::Cloud::Speech::V1::VERSION
376
461
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
377
462
 
378
- header_params = {
379
- "name" => request.name
380
- }
463
+ header_params = {}
464
+ if request.name
465
+ header_params["name"] = request.name
466
+ end
467
+
381
468
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
382
469
  metadata[:"x-goog-request-params"] ||= request_params_header
383
470
 
384
471
  options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
385
472
  metadata: metadata,
386
473
  retry_policy: @config.rpcs.cancel_operation.retry_policy
387
- options.apply_defaults metadata: @config.metadata,
474
+
475
+ options.apply_defaults timeout: @config.timeout,
476
+ metadata: @config.metadata,
388
477
  retry_policy: @config.retry_policy
389
478
 
390
479
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
@@ -436,6 +525,28 @@ module Google
436
525
  #
437
526
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
438
527
  #
528
+ # @example Basic example
529
+ # require "google/longrunning"
530
+ #
531
+ # # Create a client object. The client can be reused for multiple calls.
532
+ # client = Google::Longrunning::Operations::Client.new
533
+ #
534
+ # # Create a request. To set request fields, pass in keyword arguments.
535
+ # request = Google::Longrunning::WaitOperationRequest.new
536
+ #
537
+ # # Call the wait_operation method.
538
+ # result = client.wait_operation request
539
+ #
540
+ # # The returned object is of type Gapic::Operation. You can use this
541
+ # # object to check the status of an operation, cancel it, or wait
542
+ # # for results. Here is how to block until completion:
543
+ # result.wait_until_done! timeout: 60
544
+ # if result.response?
545
+ # p result.response
546
+ # else
547
+ # puts "Error!"
548
+ # end
549
+ #
439
550
  def wait_operation request, options = nil
440
551
  raise ::ArgumentError, "request must be provided" if request.nil?
441
552
 
@@ -456,7 +567,9 @@ module Google
456
567
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
457
568
  metadata: metadata,
458
569
  retry_policy: @config.rpcs.wait_operation.retry_policy
459
- options.apply_defaults metadata: @config.metadata,
570
+
571
+ options.apply_defaults timeout: @config.timeout,
572
+ metadata: @config.metadata,
460
573
  retry_policy: @config.retry_policy
461
574
 
462
575
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
@@ -481,22 +594,21 @@ module Google
481
594
  # Configuration can be applied globally to all clients, or to a single client
482
595
  # on construction.
483
596
  #
484
- # # Examples
485
- #
486
- # To modify the global config, setting the timeout for list_operations
487
- # to 20 seconds, and all remaining timeouts to 10 seconds:
488
- #
489
- # ::Google::Longrunning::Operations::Client.configure do |config|
490
- # config.timeout = 10.0
491
- # config.rpcs.list_operations.timeout = 20.0
492
- # end
493
- #
494
- # To apply the above configuration only to a new client:
495
- #
496
- # client = ::Google::Longrunning::Operations::Client.new do |config|
497
- # config.timeout = 10.0
498
- # config.rpcs.list_operations.timeout = 20.0
499
- # end
597
+ # @example
598
+ #
599
+ # # Modify the global config, setting the timeout for
600
+ # # list_operations to 20 seconds,
601
+ # # and all remaining timeouts to 10 seconds.
602
+ # ::Google::Longrunning::Operations::Client.configure do |config|
603
+ # config.timeout = 10.0
604
+ # config.rpcs.list_operations.timeout = 20.0
605
+ # end
606
+ #
607
+ # # Apply the above configuration only to a new client.
608
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
609
+ # config.timeout = 10.0
610
+ # config.rpcs.list_operations.timeout = 20.0
611
+ # end
500
612
  #
501
613
  # @!attribute [rw] endpoint
502
614
  # The hostname or hostname:port of the service endpoint.
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Speech
23
+ module V1
24
+ module Speech
25
+ # Path helper methods for the Speech API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified CustomClass resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/customClasses/{custom_class}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param custom_class [String]
37
+ #
38
+ # @return [::String]
39
+ def custom_class_path project:, location:, custom_class:
40
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
42
+
43
+ "projects/#{project}/locations/#{location}/customClasses/#{custom_class}"
44
+ end
45
+
46
+ ##
47
+ # Create a fully-qualified PhraseSet resource string.
48
+ #
49
+ # The resource will be in the following format:
50
+ #
51
+ # `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
52
+ #
53
+ # @param project [String]
54
+ # @param location [String]
55
+ # @param phrase_set [String]
56
+ #
57
+ # @return [::String]
58
+ def phrase_set_path project:, location:, phrase_set:
59
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
60
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
61
+
62
+ "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}"
63
+ end
64
+
65
+ extend self
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -23,6 +23,7 @@ require "gapic/config/method"
23
23
  require "google/cloud/speech/v1/version"
24
24
 
25
25
  require "google/cloud/speech/v1/speech/credentials"
26
+ require "google/cloud/speech/v1/speech/paths"
26
27
  require "google/cloud/speech/v1/speech/operations"
27
28
  require "google/cloud/speech/v1/speech/client"
28
29
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Speech
23
23
  module V1
24
- VERSION = "0.4.2"
24
+ VERSION = "0.7.0"
25
25
  end
26
26
  end
27
27
  end
@@ -43,11 +43,25 @@ module Google
43
43
  # @!attribute [rw] audio
44
44
  # @return [::Google::Cloud::Speech::V1::RecognitionAudio]
45
45
  # Required. The audio data to be recognized.
46
+ # @!attribute [rw] output_config
47
+ # @return [::Google::Cloud::Speech::V1::TranscriptOutputConfig]
48
+ # Optional. Specifies an optional destination for the recognition results.
46
49
  class LongRunningRecognizeRequest
47
50
  include ::Google::Protobuf::MessageExts
48
51
  extend ::Google::Protobuf::MessageExts::ClassMethods
49
52
  end
50
53
 
54
+ # Specifies an optional destination for the recognition results.
55
+ # @!attribute [rw] gcs_uri
56
+ # @return [::String]
57
+ # Specifies a Cloud Storage URI for the recognition results. Must be
58
+ # specified in the format: `gs://bucket_name/object_name`, and the bucket
59
+ # must already exist.
60
+ class TranscriptOutputConfig
61
+ include ::Google::Protobuf::MessageExts
62
+ extend ::Google::Protobuf::MessageExts::ClassMethods
63
+ end
64
+
51
65
  # The top-level message sent by the client for the `StreamingRecognize` method.
52
66
  # Multiple `StreamingRecognizeRequest` messages are sent. The first message
53
67
  # must contain a `streaming_config` message and must not contain
@@ -92,6 +106,16 @@ module Google
92
106
  # `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
93
107
  # more than one `StreamingRecognitionResult` with the `is_final` flag set to
94
108
  # `true`.
109
+ #
110
+ # The `single_utterance` field can only be used with specified models,
111
+ # otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
112
+ # must be set to:
113
+ #
114
+ # * `command_and_search`
115
+ # * `phone_call` AND additional field `useEnhanced`=`true`
116
+ # * The `model` field is left undefined. In this case the API auto-selects
117
+ # a model based on any other parameters that you set in
118
+ # `RecognitionConfig`.
95
119
  # @!attribute [rw] interim_results
96
120
  # @return [::Boolean]
97
121
  # If `true`, interim results (tentative hypotheses) may be
@@ -146,6 +170,20 @@ module Google
146
170
  # See [Language
147
171
  # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
148
172
  # of the currently supported language codes.
173
+ # @!attribute [rw] alternative_language_codes
174
+ # @return [::Array<::String>]
175
+ # A list of up to 3 additional
176
+ # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags,
177
+ # listing possible alternative languages of the supplied audio.
178
+ # See [Language
179
+ # Support](https://cloud.google.com/speech-to-text/docs/languages) for a list
180
+ # of the currently supported language codes. If alternative languages are
181
+ # listed, recognition result will contain recognition in the most likely
182
+ # language detected including the main language_code. The recognition result
183
+ # will include the language tag of the language detected in the audio. Note:
184
+ # This feature is only supported for Voice Command and Voice Search use cases
185
+ # and performance may vary for other use cases (e.g., phone call
186
+ # transcription).
149
187
  # @!attribute [rw] max_alternatives
150
188
  # @return [::Integer]
151
189
  # Maximum number of recognition hypotheses to be returned.
@@ -160,28 +198,53 @@ module Google
160
198
  # profanities, replacing all but the initial character in each filtered word
161
199
  # with asterisks, e.g. "f***". If set to `false` or omitted, profanities
162
200
  # won't be filtered out.
201
+ # @!attribute [rw] adaptation
202
+ # @return [::Google::Cloud::Speech::V1::SpeechAdaptation]
203
+ # Speech adaptation configuration improves the accuracy of speech
204
+ # recognition. For more information, see the [speech
205
+ # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
206
+ # documentation.
207
+ # When speech adaptation is set it supersedes the `speech_contexts` field.
163
208
  # @!attribute [rw] speech_contexts
164
209
  # @return [::Array<::Google::Cloud::Speech::V1::SpeechContext>]
165
210
  # Array of {::Google::Cloud::Speech::V1::SpeechContext SpeechContext}.
166
211
  # A means to provide context to assist the speech recognition. For more
167
212
  # information, see
168
213
  # [speech
169
- # adaptation](https://cloud.google.com/speech-to-text/docs/context-strength).
214
+ # adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
170
215
  # @!attribute [rw] enable_word_time_offsets
171
216
  # @return [::Boolean]
172
217
  # If `true`, the top result includes a list of words and
173
218
  # the start and end time offsets (timestamps) for those words. If
174
219
  # `false`, no word-level time offset information is returned. The default is
175
220
  # `false`.
221
+ # @!attribute [rw] enable_word_confidence
222
+ # @return [::Boolean]
223
+ # If `true`, the top result includes a list of words and the
224
+ # confidence for those words. If `false`, no word-level confidence
225
+ # information is returned. The default is `false`.
176
226
  # @!attribute [rw] enable_automatic_punctuation
177
227
  # @return [::Boolean]
178
228
  # If 'true', adds punctuation to recognition result hypotheses.
179
229
  # This feature is only available in select languages. Setting this for
180
230
  # requests in other languages has no effect at all.
181
231
  # The default 'false' value does not add punctuation to result hypotheses.
182
- # Note: This is currently offered as an experimental service, complimentary
183
- # to all users. In the future this may be exclusively available as a
184
- # premium feature.
232
+ # @!attribute [rw] enable_spoken_punctuation
233
+ # @return [::Google::Protobuf::BoolValue]
234
+ # The spoken punctuation behavior for the call
235
+ # If not set, uses default behavior based on model of choice
236
+ # e.g. command_and_search will enable spoken punctuation by default
237
+ # If 'true', replaces spoken punctuation with the corresponding symbols in
238
+ # the request. For example, "how are you question mark" becomes "how are
239
+ # you?". See https://cloud.google.com/speech-to-text/docs/spoken-punctuation
240
+ # for support. If 'false', spoken punctuation is not replaced.
241
+ # @!attribute [rw] enable_spoken_emojis
242
+ # @return [::Google::Protobuf::BoolValue]
243
+ # The spoken emoji behavior for the call
244
+ # If not set, uses default behavior based on model of choice
245
+ # If 'true', adds spoken emoji formatting for the request. This will replace
246
+ # spoken emojis with the corresponding Unicode symbols in the final
247
+ # transcript. If 'false', spoken emojis are not replaced.
185
248
  # @!attribute [rw] diarization_config
186
249
  # @return [::Google::Cloud::Speech::V1::SpeakerDiarizationConfig]
187
250
  # Config to enable speaker diarization and set additional
@@ -217,7 +280,7 @@ module Google
217
280
  # </tr>
218
281
  # <tr>
219
282
  # <td><code>video</code></td>
220
- # <td>Best for audio that originated from from video or includes multiple
283
+ # <td>Best for audio that originated from video or includes multiple
221
284
  # speakers. Ideally the audio is recorded at a 16khz or greater
222
285
  # sampling rate. This is a premium model that costs more than the
223
286
  # standard rate.</td>
@@ -253,7 +316,8 @@ module Google
253
316
  # a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
254
317
  # recognition can be reduced if lossy codecs are used to capture or transmit
255
318
  # audio, particularly if background noise is present. Lossy codecs include
256
- # `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, and `MP3`.
319
+ # `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`,
320
+ # and `WEBM_OPUS`.
257
321
  #
258
322
  # The `FLAC` and `WAV` audio file formats include a header that describes the
259
323
  # included audio content. You can request recognition for `WAV` files that
@@ -308,6 +372,11 @@ module Google
308
372
  # is replaced with a single byte containing the block length. Only Speex
309
373
  # wideband is supported. `sample_rate_hertz` must be 16000.
310
374
  SPEEX_WITH_HEADER_BYTE = 7
375
+
376
+ # Opus encoded audio frames in WebM container
377
+ # ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
378
+ # one of 8000, 12000, 16000, 24000, or 48000.
379
+ WEBM_OPUS = 9
311
380
  end
312
381
  end
313
382
 
@@ -329,7 +398,7 @@ module Google
329
398
  # number of speakers. If not set, the default value is 6.
330
399
  # @!attribute [r] speaker_tag
331
400
  # @return [::Integer]
332
- # Unused.
401
+ # Output only. Unused.
333
402
  class SpeakerDiarizationConfig
334
403
  include ::Google::Protobuf::MessageExts
335
404
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -481,6 +550,16 @@ module Google
481
550
  # providing phrase hints for every month of the year, using the $MONTH class
482
551
  # improves the likelihood of correctly transcribing audio that includes
483
552
  # months.
553
+ # @!attribute [rw] boost
554
+ # @return [::Float]
555
+ # Hint Boost. Positive value will increase the probability that a specific
556
+ # phrase will be recognized over other similar sounding phrases. The higher
557
+ # the boost, the higher the chance of false positive recognition as well.
558
+ # Negative boost values would correspond to anti-biasing. Anti-biasing is not
559
+ # enabled, so negative boost will simply be ignored. Though `boost` can
560
+ # accept a wide range of positive values, most use cases are best served with
561
+ # values between 0 and 20. We recommend using a binary search approach to
562
+ # finding the optimal value for your use case.
484
563
  class SpeechContext
485
564
  include ::Google::Protobuf::MessageExts
486
565
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -516,6 +595,9 @@ module Google
516
595
  # @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionResult>]
517
596
  # Sequential list of transcription results corresponding to
518
597
  # sequential portions of audio.
598
+ # @!attribute [rw] total_billed_time
599
+ # @return [::Google::Protobuf::Duration]
600
+ # When available, billed audio seconds for the corresponding request.
519
601
  class RecognizeResponse
520
602
  include ::Google::Protobuf::MessageExts
521
603
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -530,6 +612,15 @@ module Google
530
612
  # @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionResult>]
531
613
  # Sequential list of transcription results corresponding to
532
614
  # sequential portions of audio.
615
+ # @!attribute [rw] total_billed_time
616
+ # @return [::Google::Protobuf::Duration]
617
+ # When available, billed audio seconds for the corresponding request.
618
+ # @!attribute [rw] output_config
619
+ # @return [::Google::Cloud::Speech::V1::TranscriptOutputConfig]
620
+ # Original output config if present in the request.
621
+ # @!attribute [rw] output_error
622
+ # @return [::Google::Rpc::Status]
623
+ # If the transcript output fails this field contains the relevant error.
533
624
  class LongRunningRecognizeResponse
534
625
  include ::Google::Protobuf::MessageExts
535
626
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -548,6 +639,10 @@ module Google
548
639
  # @!attribute [rw] last_update_time
549
640
  # @return [::Google::Protobuf::Timestamp]
550
641
  # Time of the most recent processing update.
642
+ # @!attribute [r] uri
643
+ # @return [::String]
644
+ # Output only. The URI of the audio file being transcribed. Empty if the audio was sent
645
+ # as byte content.
551
646
  class LongRunningRecognizeMetadata
552
647
  include ::Google::Protobuf::MessageExts
553
648
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -559,8 +654,8 @@ module Google
559
654
  # audio, and `single_utterance` is set to false, then no messages are streamed
560
655
  # back to the client.
561
656
  #
562
- # Here's an example of a series of ten `StreamingRecognizeResponse`s that might
563
- # be returned while processing audio:
657
+ # Here's an example of a series of `StreamingRecognizeResponse`s that might be
658
+ # returned while processing audio:
564
659
  #
565
660
  # 1. results { alternatives { transcript: "tube" } stability: 0.01 }
566
661
  #
@@ -615,6 +710,10 @@ module Google
615
710
  # @!attribute [rw] speech_event_type
616
711
  # @return [::Google::Cloud::Speech::V1::StreamingRecognizeResponse::SpeechEventType]
617
712
  # Indicates the type of speech event.
713
+ # @!attribute [rw] total_billed_time
714
+ # @return [::Google::Protobuf::Duration]
715
+ # When available, billed audio seconds for the stream.
716
+ # Set only if this is the last response in the stream.
618
717
  class StreamingRecognizeResponse
619
718
  include ::Google::Protobuf::MessageExts
620
719
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -668,9 +767,9 @@ module Google
668
767
  # For audio_channel_count = N, its output values can range from '1' to 'N'.
669
768
  # @!attribute [r] language_code
670
769
  # @return [::String]
671
- # The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of
672
- # the language in this result. This language code was detected to have the
673
- # most likelihood of being spoken in the audio.
770
+ # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
771
+ # of the language in this result. This language code was detected to have
772
+ # the most likelihood of being spoken in the audio.
674
773
  class StreamingRecognitionResult
675
774
  include ::Google::Protobuf::MessageExts
676
775
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -688,6 +787,15 @@ module Google
688
787
  # For multi-channel audio, this is the channel number corresponding to the
689
788
  # recognized result for the audio from that channel.
690
789
  # For audio_channel_count = N, its output values can range from '1' to 'N'.
790
+ # @!attribute [rw] result_end_time
791
+ # @return [::Google::Protobuf::Duration]
792
+ # Time offset of the end of this result relative to the
793
+ # beginning of the audio.
794
+ # @!attribute [r] language_code
795
+ # @return [::String]
796
+ # Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
797
+ # of the language in this result. This language code was detected to have
798
+ # the most likelihood of being spoken in the audio.
691
799
  class SpeechRecognitionResult
692
800
  include ::Google::Protobuf::MessageExts
693
801
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -736,9 +844,18 @@ module Google
736
844
  # @!attribute [rw] word
737
845
  # @return [::String]
738
846
  # The word corresponding to this set of information.
847
+ # @!attribute [rw] confidence
848
+ # @return [::Float]
849
+ # The confidence estimate between 0.0 and 1.0. A higher number
850
+ # indicates an estimated greater likelihood that the recognized words are
851
+ # correct. This field is set only for the top alternative of a non-streaming
852
+ # result or, of a streaming result where `is_final=true`.
853
+ # This field is not guaranteed to be accurate and users should not rely on it
854
+ # to be always provided.
855
+ # The default of 0.0 is a sentinel value indicating `confidence` was not set.
739
856
  # @!attribute [r] speaker_tag
740
857
  # @return [::Integer]
741
- # A distinct integer value is assigned for every speaker within
858
+ # Output only. A distinct integer value is assigned for every speaker within
742
859
  # the audio. This field specifies which one of those speakers was detected to
743
860
  # have spoken this word. Value ranges from '1' to diarization_speaker_count.
744
861
  # speaker_tag is set if enable_speaker_diarization = 'true' and only in the