google-cloud-speech-v1p1beta1 0.3.6 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +188 -190
- data/README.md +66 -2
- data/lib/google/cloud/speech/v1p1beta1.rb +1 -0
- data/lib/google/cloud/speech/v1p1beta1/adaptation.rb +49 -0
- data/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb +1102 -0
- data/lib/google/cloud/speech/v1p1beta1/adaptation/credentials.rb +51 -0
- data/lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb +88 -0
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb +85 -0
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb +65 -0
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb +13 -1
- data/lib/google/cloud/speech/v1p1beta1/resource_pb.rb +3 -2
- data/lib/google/cloud/speech/v1p1beta1/speech/client.rb +22 -14
- data/lib/google/cloud/speech/v1p1beta1/speech/operations.rb +94 -9
- data/lib/google/cloud/speech/v1p1beta1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb +70 -24
- data/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb +218 -0
- data/proto_docs/google/cloud/speech/v1p1beta1/resource.rb +4 -1
- data/proto_docs/google/longrunning/operations.rb +17 -3
- data/proto_docs/google/protobuf/any.rb +5 -2
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- metadata +20 -9
@@ -103,8 +103,13 @@ module Google
|
|
103
103
|
# Lists operations that match the specified filter in the request. If the
|
104
104
|
# server doesn't support this method, it returns `UNIMPLEMENTED`.
|
105
105
|
#
|
106
|
-
# NOTE: the `name` binding
|
107
|
-
# to use different resource name schemes, such as `users/*/operations`.
|
106
|
+
# NOTE: the `name` binding allows API services to override the binding
|
107
|
+
# to use different resource name schemes, such as `users/*/operations`. To
|
108
|
+
# override the binding, API services can add a binding such as
|
109
|
+
# `"/v1/{name=users/*}/operations"` to their service configuration.
|
110
|
+
# For backwards compatibility, the default name includes the operations
|
111
|
+
# collection id, however overriding users must ensure the name binding
|
112
|
+
# is the parent resource, without the operations collection id.
|
108
113
|
#
|
109
114
|
# @overload list_operations(request, options = nil)
|
110
115
|
# Pass arguments to `list_operations` via a request object, either of type
|
@@ -122,7 +127,7 @@ module Google
|
|
122
127
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
123
128
|
#
|
124
129
|
# @param name [::String]
|
125
|
-
# The name of the operation
|
130
|
+
# The name of the operation's parent resource.
|
126
131
|
# @param filter [::String]
|
127
132
|
# The standard list filter.
|
128
133
|
# @param page_size [::Integer]
|
@@ -390,6 +395,79 @@ module Google
|
|
390
395
|
raise ::Google::Cloud::Error.from_error(e)
|
391
396
|
end
|
392
397
|
|
398
|
+
##
|
399
|
+
# Waits for the specified long-running operation until it is done or reaches
|
400
|
+
# at most a specified timeout, returning the latest state. If the operation
|
401
|
+
# is already done, the latest state is immediately returned. If the timeout
|
402
|
+
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
|
+
# timeout is used. If the server does not support this method, it returns
|
404
|
+
# `google.rpc.Code.UNIMPLEMENTED`.
|
405
|
+
# Note that this method is on a best-effort basis. It may return the latest
|
406
|
+
# state before the specified timeout (including immediately), meaning even an
|
407
|
+
# immediate response is no guarantee that the operation is done.
|
408
|
+
#
|
409
|
+
# @overload wait_operation(request, options = nil)
|
410
|
+
# Pass arguments to `wait_operation` via a request object, either of type
|
411
|
+
# {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
|
412
|
+
#
|
413
|
+
# @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
|
414
|
+
# A request object representing the call parameters. Required. To specify no
|
415
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
416
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
417
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
418
|
+
#
|
419
|
+
# @overload wait_operation(name: nil, timeout: nil)
|
420
|
+
# Pass arguments to `wait_operation` via keyword arguments. Note that at
|
421
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
422
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
423
|
+
#
|
424
|
+
# @param name [::String]
|
425
|
+
# The name of the operation resource to wait on.
|
426
|
+
# @param timeout [::Google::Protobuf::Duration, ::Hash]
|
427
|
+
# The maximum duration to wait before timing out. If left blank, the wait
|
428
|
+
# will be at most the time permitted by the underlying HTTP/RPC protocol.
|
429
|
+
# If RPC context deadline is also specified, the shorter one will be used.
|
430
|
+
#
|
431
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
432
|
+
# @yieldparam response [::Gapic::Operation]
|
433
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
434
|
+
#
|
435
|
+
# @return [::Gapic::Operation]
|
436
|
+
#
|
437
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
438
|
+
#
|
439
|
+
def wait_operation request, options = nil
|
440
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
441
|
+
|
442
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
|
443
|
+
|
444
|
+
# Converts hash and nil to an options object
|
445
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
446
|
+
|
447
|
+
# Customize the options with defaults
|
448
|
+
metadata = @config.rpcs.wait_operation.metadata.to_h
|
449
|
+
|
450
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
451
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
452
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
453
|
+
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION
|
454
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
455
|
+
|
456
|
+
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
|
+
metadata: metadata,
|
458
|
+
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
+
options.apply_defaults metadata: @config.metadata,
|
460
|
+
retry_policy: @config.retry_policy
|
461
|
+
|
462
|
+
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
463
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
464
|
+
yield response, operation if block_given?
|
465
|
+
return response
|
466
|
+
end
|
467
|
+
rescue ::GRPC::BadStatus => e
|
468
|
+
raise ::Google::Cloud::Error.from_error(e)
|
469
|
+
end
|
470
|
+
|
393
471
|
##
|
394
472
|
# Configuration class for the Operations API.
|
395
473
|
#
|
@@ -482,7 +560,7 @@ module Google
|
|
482
560
|
config_attr :scope, nil, ::String, ::Array, nil
|
483
561
|
config_attr :lib_name, nil, ::String, nil
|
484
562
|
config_attr :lib_version, nil, ::String, nil
|
485
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
563
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
486
564
|
config_attr :interceptors, nil, ::Array, nil
|
487
565
|
config_attr :timeout, nil, ::Numeric, nil
|
488
566
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -503,7 +581,7 @@ module Google
|
|
503
581
|
def rpcs
|
504
582
|
@rpcs ||= begin
|
505
583
|
parent_rpcs = nil
|
506
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
584
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
507
585
|
Rpcs.new parent_rpcs
|
508
586
|
end
|
509
587
|
end
|
@@ -546,17 +624,24 @@ module Google
|
|
546
624
|
# @return [::Gapic::Config::Method]
|
547
625
|
#
|
548
626
|
attr_reader :cancel_operation
|
627
|
+
##
|
628
|
+
# RPC-specific configuration for `wait_operation`
|
629
|
+
# @return [::Gapic::Config::Method]
|
630
|
+
#
|
631
|
+
attr_reader :wait_operation
|
549
632
|
|
550
633
|
# @private
|
551
634
|
def initialize parent_rpcs = nil
|
552
|
-
list_operations_config = parent_rpcs
|
635
|
+
list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
|
553
636
|
@list_operations = ::Gapic::Config::Method.new list_operations_config
|
554
|
-
get_operation_config = parent_rpcs
|
637
|
+
get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
|
555
638
|
@get_operation = ::Gapic::Config::Method.new get_operation_config
|
556
|
-
delete_operation_config = parent_rpcs
|
639
|
+
delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
|
557
640
|
@delete_operation = ::Gapic::Config::Method.new delete_operation_config
|
558
|
-
cancel_operation_config = parent_rpcs
|
641
|
+
cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
|
559
642
|
@cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
|
643
|
+
wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
|
644
|
+
@wait_operation = ::Gapic::Config::Method.new wait_operation_config
|
560
645
|
|
561
646
|
yield self if block_given?
|
562
647
|
end
|
@@ -54,6 +54,12 @@ module Google
|
|
54
54
|
# This indicates that the field may be set once in a request to create a
|
55
55
|
# resource, but may not be changed thereafter.
|
56
56
|
IMMUTABLE = 5
|
57
|
+
|
58
|
+
# Denotes that a (repeated) field is an unordered list.
|
59
|
+
# This indicates that the service may provide the elements of the list
|
60
|
+
# in any arbitrary order, rather than the order the user originally
|
61
|
+
# provided. Additionally, the list's order may or may not be stable.
|
62
|
+
UNORDERED_LIST = 6
|
57
63
|
end
|
58
64
|
end
|
59
65
|
end
|
@@ -43,11 +43,25 @@ module Google
|
|
43
43
|
# @!attribute [rw] audio
|
44
44
|
# @return [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio]
|
45
45
|
# Required. The audio data to be recognized.
|
46
|
+
# @!attribute [rw] output_config
|
47
|
+
# @return [::Google::Cloud::Speech::V1p1beta1::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
|
@@ -109,8 +133,7 @@ module Google
|
|
109
133
|
# @return [::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding]
|
110
134
|
# Encoding of audio data sent in all `RecognitionAudio` messages.
|
111
135
|
# This field is optional for `FLAC` and `WAV` audio files and required
|
112
|
-
# for all other audio formats. For details, see
|
113
|
-
# {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}.
|
136
|
+
# for all other audio formats. For details, see {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}.
|
114
137
|
# @!attribute [rw] sample_rate_hertz
|
115
138
|
# @return [::Integer]
|
116
139
|
# Sample rate in Hertz of the audio data sent in all
|
@@ -119,8 +142,7 @@ module Google
|
|
119
142
|
# source to 16000 Hz. If that's not possible, use the native sample rate of
|
120
143
|
# the audio source (instead of re-sampling).
|
121
144
|
# This field is optional for FLAC and WAV audio files, but is
|
122
|
-
# required for all other audio formats. For details, see
|
123
|
-
# {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}.
|
145
|
+
# required for all other audio formats. For details, see {::Google::Cloud::Speech::V1p1beta1::RecognitionConfig::AudioEncoding AudioEncoding}.
|
124
146
|
# @!attribute [rw] audio_channel_count
|
125
147
|
# @return [::Integer]
|
126
148
|
# The number of channels in the input audio data.
|
@@ -181,7 +203,7 @@ module Google
|
|
181
203
|
# Speech adaptation configuration improves the accuracy of speech
|
182
204
|
# recognition. When speech adaptation is set it supersedes the
|
183
205
|
# `speech_contexts` field. For more information, see the [speech
|
184
|
-
# adaptation](https://cloud.google.com/speech-to-text/docs/
|
206
|
+
# adaptation](https://cloud.google.com/speech-to-text/docs/adaptation)
|
185
207
|
# documentation.
|
186
208
|
# @!attribute [rw] speech_contexts
|
187
209
|
# @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechContext>]
|
@@ -189,7 +211,7 @@ module Google
|
|
189
211
|
# A means to provide context to assist the speech recognition. For more
|
190
212
|
# information, see
|
191
213
|
# [speech
|
192
|
-
# adaptation](https://cloud.google.com/speech-to-text/docs/
|
214
|
+
# adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
|
193
215
|
# @!attribute [rw] enable_word_time_offsets
|
194
216
|
# @return [::Boolean]
|
195
217
|
# If `true`, the top result includes a list of words and
|
@@ -207,6 +229,22 @@ module Google
|
|
207
229
|
# This feature is only available in select languages. Setting this for
|
208
230
|
# requests in other languages has no effect at all.
|
209
231
|
# The default 'false' value does not add punctuation to result hypotheses.
|
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.
|
210
248
|
# @!attribute [rw] enable_speaker_diarization
|
211
249
|
# @return [::Boolean]
|
212
250
|
# If 'true', enables speaker detection for each recognized word in
|
@@ -289,7 +327,7 @@ module Google
|
|
289
327
|
# a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
|
290
328
|
# recognition can be reduced if lossy codecs are used to capture or transmit
|
291
329
|
# audio, particularly if background noise is present. Lossy codecs include
|
292
|
-
# `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`,
|
330
|
+
# `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`.
|
293
331
|
#
|
294
332
|
# The `FLAC` and `WAV` audio file formats include a header that describes the
|
295
333
|
# included audio content. You can request recognition for `WAV` files that
|
@@ -300,8 +338,7 @@ module Google
|
|
300
338
|
# an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the
|
301
339
|
# encoding configuration must match the encoding described in the audio
|
302
340
|
# header; otherwise the request returns an
|
303
|
-
# [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error
|
304
|
-
# code.
|
341
|
+
# [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code.
|
305
342
|
module AudioEncoding
|
306
343
|
# Not specified.
|
307
344
|
ENCODING_UNSPECIFIED = 0
|
@@ -346,7 +383,8 @@ module Google
|
|
346
383
|
# wideband is supported. `sample_rate_hertz` must be 16000.
|
347
384
|
SPEEX_WITH_HEADER_BYTE = 7
|
348
385
|
|
349
|
-
# MP3 audio.
|
386
|
+
# MP3 audio. MP3 encoding is a Beta feature and only available in
|
387
|
+
# v1p1beta1. Support all standard MP3 bitrates (which range from 32-320
|
350
388
|
# kbps). When using this encoding, `sample_rate_hertz` has to match the
|
351
389
|
# sample rate of the file being used.
|
352
390
|
MP3 = 8
|
@@ -544,8 +582,8 @@ module Google
|
|
544
582
|
|
545
583
|
# Contains audio data in the encoding specified in the `RecognitionConfig`.
|
546
584
|
# Either `content` or `uri` must be supplied. Supplying both or neither
|
547
|
-
# returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
|
548
|
-
#
|
585
|
+
# returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See
|
586
|
+
# [content limits](https://cloud.google.com/speech-to-text/quotas#content).
|
549
587
|
# @!attribute [rw] content
|
550
588
|
# @return [::String]
|
551
589
|
# The audio data bytes encoded as specified in
|
@@ -558,9 +596,8 @@ module Google
|
|
558
596
|
# Currently, only Google Cloud Storage URIs are
|
559
597
|
# supported, which must be specified in the following format:
|
560
598
|
# `gs://bucket_name/object_name` (other URI formats return
|
561
|
-
# [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]).
|
562
|
-
#
|
563
|
-
# URIs](https://cloud.google.com/storage/docs/reference-uris).
|
599
|
+
# [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see
|
600
|
+
# [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
|
564
601
|
class RecognitionAudio
|
565
602
|
include ::Google::Protobuf::MessageExts
|
566
603
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -587,6 +624,12 @@ module Google
|
|
587
624
|
# @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>]
|
588
625
|
# Sequential list of transcription results corresponding to
|
589
626
|
# sequential portions of audio.
|
627
|
+
# @!attribute [rw] output_config
|
628
|
+
# @return [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig]
|
629
|
+
# Original output config if present in the request.
|
630
|
+
# @!attribute [rw] output_error
|
631
|
+
# @return [::Google::Rpc::Status]
|
632
|
+
# If the transcript output fails this field contains the relevant error.
|
590
633
|
class LongRunningRecognizeResponse
|
591
634
|
include ::Google::Protobuf::MessageExts
|
592
635
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -607,8 +650,11 @@ module Google
|
|
607
650
|
# Time of the most recent processing update.
|
608
651
|
# @!attribute [r] uri
|
609
652
|
# @return [::String]
|
610
|
-
# The URI of the audio file being transcribed. Empty if the audio was sent
|
653
|
+
# Output only. The URI of the audio file being transcribed. Empty if the audio was sent
|
611
654
|
# as byte content.
|
655
|
+
# @!attribute [r] output_config
|
656
|
+
# @return [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig]
|
657
|
+
# Output only. A copy of the TranscriptOutputConfig if it was set in the request.
|
612
658
|
class LongRunningRecognizeMetadata
|
613
659
|
include ::Google::Protobuf::MessageExts
|
614
660
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -620,8 +666,8 @@ module Google
|
|
620
666
|
# audio, and `single_utterance` is set to false, then no messages are streamed
|
621
667
|
# back to the client.
|
622
668
|
#
|
623
|
-
# Here's an example of a series of
|
624
|
-
#
|
669
|
+
# Here's an example of a series of `StreamingRecognizeResponse`s that might be
|
670
|
+
# returned while processing audio:
|
625
671
|
#
|
626
672
|
# 1. results { alternatives { transcript: "tube" } stability: 0.01 }
|
627
673
|
#
|
@@ -729,9 +775,9 @@ module Google
|
|
729
775
|
# For audio_channel_count = N, its output values can range from '1' to 'N'.
|
730
776
|
# @!attribute [r] language_code
|
731
777
|
# @return [::String]
|
732
|
-
# Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
|
733
|
-
#
|
734
|
-
#
|
778
|
+
# Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
|
779
|
+
# of the language in this result. This language code was detected to have
|
780
|
+
# the most likelihood of being spoken in the audio.
|
735
781
|
class StreamingRecognitionResult
|
736
782
|
include ::Google::Protobuf::MessageExts
|
737
783
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -751,9 +797,9 @@ module Google
|
|
751
797
|
# For audio_channel_count = N, its output values can range from '1' to 'N'.
|
752
798
|
# @!attribute [r] language_code
|
753
799
|
# @return [::String]
|
754
|
-
# Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt)
|
755
|
-
#
|
756
|
-
#
|
800
|
+
# Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag
|
801
|
+
# of the language in this result. This language code was detected to have
|
802
|
+
# the most likelihood of being spoken in the audio.
|
757
803
|
class SpeechRecognitionResult
|
758
804
|
include ::Google::Protobuf::MessageExts
|
759
805
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -0,0 +1,218 @@
|
|
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 V1p1beta1
|
24
|
+
# Message sent by the client for the `CreatePhraseSet` method.
|
25
|
+
# @!attribute [rw] parent
|
26
|
+
# @return [::String]
|
27
|
+
# Required. The parent resource where this phrase set will be created.
|
28
|
+
# Format:
|
29
|
+
# \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets
|
30
|
+
# @!attribute [rw] phrase_set_id
|
31
|
+
# @return [::String]
|
32
|
+
# The ID to use for the phrase set, which will become the final
|
33
|
+
# component of the phrase set's resource name.
|
34
|
+
#
|
35
|
+
# This value should be 4-63 characters, and valid characters
|
36
|
+
# are /[a-z][0-9]-/.
|
37
|
+
# @!attribute [rw] phrase_set
|
38
|
+
# @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet]
|
39
|
+
# Required. The phrase set to create.
|
40
|
+
class CreatePhraseSetRequest
|
41
|
+
include ::Google::Protobuf::MessageExts
|
42
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
43
|
+
end
|
44
|
+
|
45
|
+
# Message sent by the client for the `UpdatePhraseSet` method.
|
46
|
+
# @!attribute [rw] phrase_set
|
47
|
+
# @return [::Google::Cloud::Speech::V1p1beta1::PhraseSet]
|
48
|
+
# Required. The phrase set to update.
|
49
|
+
#
|
50
|
+
# The phrase set's `name` field is used to identify the set to be
|
51
|
+
# updated. Format:
|
52
|
+
# \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets/\\{phrase_set}
|
53
|
+
# @!attribute [rw] update_mask
|
54
|
+
# @return [::Google::Protobuf::FieldMask]
|
55
|
+
# The list of fields to be updated.
|
56
|
+
class UpdatePhraseSetRequest
|
57
|
+
include ::Google::Protobuf::MessageExts
|
58
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
59
|
+
end
|
60
|
+
|
61
|
+
# Message sent by the client for the `GetPhraseSet` method.
|
62
|
+
# @!attribute [rw] name
|
63
|
+
# @return [::String]
|
64
|
+
# Required. The name of the phrase set to retrieve.
|
65
|
+
# Format:
|
66
|
+
# \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets/\\{phrase_set}
|
67
|
+
class GetPhraseSetRequest
|
68
|
+
include ::Google::Protobuf::MessageExts
|
69
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
70
|
+
end
|
71
|
+
|
72
|
+
# Message sent by the client for the `ListPhraseSet` method.
|
73
|
+
# @!attribute [rw] parent
|
74
|
+
# @return [::String]
|
75
|
+
# Required. The parent, which owns this collection of phrase set.
|
76
|
+
# Format:
|
77
|
+
# projects/\\{project}/locations/\\{location}
|
78
|
+
# @!attribute [rw] page_size
|
79
|
+
# @return [::Integer]
|
80
|
+
# The maximum number of phrase sets to return. The service may return
|
81
|
+
# fewer than this value. If unspecified, at most 50 phrase sets will be
|
82
|
+
# returned. The maximum value is 1000; values above 1000 will be coerced to
|
83
|
+
# 1000.
|
84
|
+
# @!attribute [rw] page_token
|
85
|
+
# @return [::String]
|
86
|
+
# A page token, received from a previous `ListPhraseSet` call.
|
87
|
+
# Provide this to retrieve the subsequent page.
|
88
|
+
#
|
89
|
+
# When paginating, all other parameters provided to `ListPhraseSet` must
|
90
|
+
# match the call that provided the page token.
|
91
|
+
class ListPhraseSetRequest
|
92
|
+
include ::Google::Protobuf::MessageExts
|
93
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
94
|
+
end
|
95
|
+
|
96
|
+
# Message returned to the client by the `ListPhraseSet` method.
|
97
|
+
# @!attribute [rw] phrase_sets
|
98
|
+
# @return [::Array<::Google::Cloud::Speech::V1p1beta1::PhraseSet>]
|
99
|
+
# The phrase set.
|
100
|
+
# @!attribute [rw] next_page_token
|
101
|
+
# @return [::String]
|
102
|
+
# A token, which can be sent as `page_token` to retrieve the next page.
|
103
|
+
# If this field is omitted, there are no subsequent pages.
|
104
|
+
class ListPhraseSetResponse
|
105
|
+
include ::Google::Protobuf::MessageExts
|
106
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
107
|
+
end
|
108
|
+
|
109
|
+
# Message sent by the client for the `DeletePhraseSet` method.
|
110
|
+
# @!attribute [rw] name
|
111
|
+
# @return [::String]
|
112
|
+
# Required. The name of the phrase set to delete.
|
113
|
+
# Format:
|
114
|
+
# \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets/\\{phrase_set}
|
115
|
+
class DeletePhraseSetRequest
|
116
|
+
include ::Google::Protobuf::MessageExts
|
117
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
118
|
+
end
|
119
|
+
|
120
|
+
# Message sent by the client for the `CreateCustomClass` method.
|
121
|
+
# @!attribute [rw] parent
|
122
|
+
# @return [::String]
|
123
|
+
# Required. The parent resource where this custom class will be created.
|
124
|
+
# Format:
|
125
|
+
# \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses
|
126
|
+
# @!attribute [rw] custom_class_id
|
127
|
+
# @return [::String]
|
128
|
+
# The ID to use for the custom class, which will become the final
|
129
|
+
# component of the custom class' resource name.
|
130
|
+
#
|
131
|
+
# This value should be 4-63 characters, and valid characters
|
132
|
+
# are /[a-z][0-9]-/.
|
133
|
+
# @!attribute [rw] custom_class
|
134
|
+
# @return [::Google::Cloud::Speech::V1p1beta1::CustomClass]
|
135
|
+
# Required. The custom class to create.
|
136
|
+
class CreateCustomClassRequest
|
137
|
+
include ::Google::Protobuf::MessageExts
|
138
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
139
|
+
end
|
140
|
+
|
141
|
+
# Message sent by the client for the `UpdateCustomClass` method.
|
142
|
+
# @!attribute [rw] custom_class
|
143
|
+
# @return [::Google::Cloud::Speech::V1p1beta1::CustomClass]
|
144
|
+
# Required. The custom class to update.
|
145
|
+
#
|
146
|
+
# The custom class's `name` field is used to identify the custom class to be
|
147
|
+
# updated. Format:
|
148
|
+
# \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses/\\{custom_class}
|
149
|
+
# @!attribute [rw] update_mask
|
150
|
+
# @return [::Google::Protobuf::FieldMask]
|
151
|
+
# The list of fields to be updated.
|
152
|
+
class UpdateCustomClassRequest
|
153
|
+
include ::Google::Protobuf::MessageExts
|
154
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
155
|
+
end
|
156
|
+
|
157
|
+
# Message sent by the client for the `GetCustomClass` method.
|
158
|
+
# @!attribute [rw] name
|
159
|
+
# @return [::String]
|
160
|
+
# Required. The name of the custom class to retrieve.
|
161
|
+
# Format:
|
162
|
+
# \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses/\\{custom_class}
|
163
|
+
class GetCustomClassRequest
|
164
|
+
include ::Google::Protobuf::MessageExts
|
165
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
166
|
+
end
|
167
|
+
|
168
|
+
# Message sent by the client for the `ListCustomClasses` method.
|
169
|
+
# @!attribute [rw] parent
|
170
|
+
# @return [::String]
|
171
|
+
# Required. The parent, which owns this collection of custom classes.
|
172
|
+
# Format:
|
173
|
+
# \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses
|
174
|
+
# @!attribute [rw] page_size
|
175
|
+
# @return [::Integer]
|
176
|
+
# The maximum number of custom classes to return. The service may return
|
177
|
+
# fewer than this value. If unspecified, at most 50 custom classes will be
|
178
|
+
# returned. The maximum value is 1000; values above 1000 will be coerced to
|
179
|
+
# 1000.
|
180
|
+
# @!attribute [rw] page_token
|
181
|
+
# @return [::String]
|
182
|
+
# A page token, received from a previous `ListCustomClass` call.
|
183
|
+
# Provide this to retrieve the subsequent page.
|
184
|
+
#
|
185
|
+
# When paginating, all other parameters provided to `ListCustomClass` must
|
186
|
+
# match the call that provided the page token.
|
187
|
+
class ListCustomClassesRequest
|
188
|
+
include ::Google::Protobuf::MessageExts
|
189
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
190
|
+
end
|
191
|
+
|
192
|
+
# Message returned to the client by the `ListCustomClasses` method.
|
193
|
+
# @!attribute [rw] custom_classes
|
194
|
+
# @return [::Array<::Google::Cloud::Speech::V1p1beta1::CustomClass>]
|
195
|
+
# The custom classes.
|
196
|
+
# @!attribute [rw] next_page_token
|
197
|
+
# @return [::String]
|
198
|
+
# A token, which can be sent as `page_token` to retrieve the next page.
|
199
|
+
# If this field is omitted, there are no subsequent pages.
|
200
|
+
class ListCustomClassesResponse
|
201
|
+
include ::Google::Protobuf::MessageExts
|
202
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
203
|
+
end
|
204
|
+
|
205
|
+
# Message sent by the client for the `DeleteCustomClass` method.
|
206
|
+
# @!attribute [rw] name
|
207
|
+
# @return [::String]
|
208
|
+
# Required. The name of the custom class to delete.
|
209
|
+
# Format:
|
210
|
+
# \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses/\\{custom_class}
|
211
|
+
class DeleteCustomClassRequest
|
212
|
+
include ::Google::Protobuf::MessageExts
|
213
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|