google-cloud-speech-v1 0.4.0 → 0.6.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 +4 -4
- data/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/speech/v1/cloud_speech_pb.rb +12 -0
- data/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb +1 -2
- data/lib/google/cloud/speech/v1/speech/client.rb +44 -49
- data/lib/google/cloud/speech/v1/speech/operations.rb +34 -25
- data/lib/google/cloud/speech/v1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/cloud/speech/v1/cloud_speech.rb +45 -10
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- metadata +14 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9984572dbaa4bad34ec0daa2c887652f8dc7219e8e644495ece0c6133fc5a48e
|
4
|
+
data.tar.gz: 1d2fba87d6821a8f3badeb54f4862c6516d665b49fbb2d6dd6771acfe70ae62e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aa1c659223d1f0c1d3c2b59843e498d60c1013b2f824446130f254299678426d9bc2c0c97bb93f1026c66ab3f33c80411d944ace87705f2b69962969a5a247c
|
7
|
+
data.tar.gz: 8fbb30489b1e039db43a58babdbda3e816e933438b51284e30a5cd908f7ccbf6d16fc7f09bc214450a2e152035861dc3d343f59c18f8ea3732cfd3f87eb4a9bf
|
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-speech-v1
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::Speech::V1::Speech::Credentials}):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
* `SPEECH_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
|
+
* `SPEECH_KEYFILE` - Path to JSON file, or JSON contents
|
71
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
72
|
+
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
73
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
require "google/cloud/speech/v1"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Speech::V1::Speech::Client.new
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/speech/v1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config|
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/speech/v1"
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
|
|
33
33
|
require "google/cloud/speech/v1"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::Speech::V1::Speech::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::Speech::V1::RecognizeRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.recognize request
|
38
38
|
```
|
39
39
|
|
@@ -10,6 +10,7 @@ require 'google/longrunning/operations_pb'
|
|
10
10
|
require 'google/protobuf/any_pb'
|
11
11
|
require 'google/protobuf/duration_pb'
|
12
12
|
require 'google/protobuf/timestamp_pb'
|
13
|
+
require 'google/protobuf/wrappers_pb'
|
13
14
|
require 'google/rpc/status_pb'
|
14
15
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
15
16
|
add_file("google/cloud/speech/v1/cloud_speech.proto", :syntax => :proto3) do
|
@@ -20,6 +21,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
20
21
|
add_message "google.cloud.speech.v1.LongRunningRecognizeRequest" do
|
21
22
|
optional :config, :message, 1, "google.cloud.speech.v1.RecognitionConfig"
|
22
23
|
optional :audio, :message, 2, "google.cloud.speech.v1.RecognitionAudio"
|
24
|
+
optional :output_config, :message, 4, "google.cloud.speech.v1.TranscriptOutputConfig"
|
25
|
+
end
|
26
|
+
add_message "google.cloud.speech.v1.TranscriptOutputConfig" do
|
27
|
+
oneof :output_type do
|
28
|
+
optional :gcs_uri, :string, 1
|
29
|
+
end
|
23
30
|
end
|
24
31
|
add_message "google.cloud.speech.v1.StreamingRecognizeRequest" do
|
25
32
|
oneof :streaming_request do
|
@@ -116,19 +123,23 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
116
123
|
end
|
117
124
|
add_message "google.cloud.speech.v1.RecognizeResponse" do
|
118
125
|
repeated :results, :message, 2, "google.cloud.speech.v1.SpeechRecognitionResult"
|
126
|
+
optional :total_billed_time, :message, 3, "google.protobuf.Duration"
|
119
127
|
end
|
120
128
|
add_message "google.cloud.speech.v1.LongRunningRecognizeResponse" do
|
121
129
|
repeated :results, :message, 2, "google.cloud.speech.v1.SpeechRecognitionResult"
|
130
|
+
optional :total_billed_time, :message, 3, "google.protobuf.Duration"
|
122
131
|
end
|
123
132
|
add_message "google.cloud.speech.v1.LongRunningRecognizeMetadata" do
|
124
133
|
optional :progress_percent, :int32, 1
|
125
134
|
optional :start_time, :message, 2, "google.protobuf.Timestamp"
|
126
135
|
optional :last_update_time, :message, 3, "google.protobuf.Timestamp"
|
136
|
+
optional :uri, :string, 4
|
127
137
|
end
|
128
138
|
add_message "google.cloud.speech.v1.StreamingRecognizeResponse" do
|
129
139
|
optional :error, :message, 1, "google.rpc.Status"
|
130
140
|
repeated :results, :message, 2, "google.cloud.speech.v1.StreamingRecognitionResult"
|
131
141
|
optional :speech_event_type, :enum, 4, "google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType"
|
142
|
+
optional :total_billed_time, :message, 5, "google.protobuf.Duration"
|
132
143
|
end
|
133
144
|
add_enum "google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType" do
|
134
145
|
value :SPEECH_EVENT_UNSPECIFIED, 0
|
@@ -166,6 +177,7 @@ module Google
|
|
166
177
|
module V1
|
167
178
|
RecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognizeRequest").msgclass
|
168
179
|
LongRunningRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.LongRunningRecognizeRequest").msgclass
|
180
|
+
TranscriptOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.TranscriptOutputConfig").msgclass
|
169
181
|
StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognizeRequest").msgclass
|
170
182
|
StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.StreamingRecognitionConfig").msgclass
|
171
183
|
RecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1.RecognitionConfig").msgclass
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/cloud/speech/v1/cloud_speech.proto for package 'google.cloud.speech.v1'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2021 Google LLC
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -15,7 +15,6 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
-
#
|
19
18
|
|
20
19
|
require 'grpc'
|
21
20
|
require 'google/cloud/speech/v1/cloud_speech_pb'
|
@@ -39,13 +39,12 @@ module Google
|
|
39
39
|
# See {::Google::Cloud::Speech::V1::Speech::Client::Configuration}
|
40
40
|
# for a description of the configuration fields.
|
41
41
|
#
|
42
|
-
#
|
42
|
+
# @example
|
43
43
|
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
# end
|
44
|
+
# # Modify the configuration for all Speech clients
|
45
|
+
# ::Google::Cloud::Speech::V1::Speech::Client.configure do |config|
|
46
|
+
# config.timeout = 10.0
|
47
|
+
# end
|
49
48
|
#
|
50
49
|
# @yield [config] Configure the Client client.
|
51
50
|
# @yieldparam config [Client::Configuration]
|
@@ -65,20 +64,14 @@ module Google
|
|
65
64
|
|
66
65
|
default_config.rpcs.recognize.timeout = 5000.0
|
67
66
|
default_config.rpcs.recognize.retry_policy = {
|
68
|
-
initial_delay: 0.1,
|
69
|
-
max_delay: 60.0,
|
70
|
-
multiplier: 1.3,
|
71
|
-
retry_codes: [14, 4]
|
67
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
72
68
|
}
|
73
69
|
|
74
70
|
default_config.rpcs.long_running_recognize.timeout = 5000.0
|
75
71
|
|
76
72
|
default_config.rpcs.streaming_recognize.timeout = 5000.0
|
77
73
|
default_config.rpcs.streaming_recognize.retry_policy = {
|
78
|
-
initial_delay: 0.1,
|
79
|
-
max_delay: 60.0,
|
80
|
-
multiplier: 1.3,
|
81
|
-
retry_codes: [14, 4]
|
74
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
82
75
|
}
|
83
76
|
|
84
77
|
default_config
|
@@ -110,19 +103,15 @@ module Google
|
|
110
103
|
##
|
111
104
|
# Create a new Speech client object.
|
112
105
|
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
# To create a new Speech client with the default
|
116
|
-
# configuration:
|
117
|
-
#
|
118
|
-
# client = ::Google::Cloud::Speech::V1::Speech::Client.new
|
106
|
+
# @example
|
119
107
|
#
|
120
|
-
#
|
121
|
-
#
|
108
|
+
# # Create a client using the default configuration
|
109
|
+
# client = ::Google::Cloud::Speech::V1::Speech::Client.new
|
122
110
|
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
111
|
+
# # Create a client using a custom configuration
|
112
|
+
# client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config|
|
113
|
+
# config.timeout = 10.0
|
114
|
+
# end
|
126
115
|
#
|
127
116
|
# @yield [config] Configure the Speech client.
|
128
117
|
# @yieldparam config [Client::Configuration]
|
@@ -142,14 +131,13 @@ module Google
|
|
142
131
|
|
143
132
|
# Create credentials
|
144
133
|
credentials = @config.credentials
|
145
|
-
# Use self-signed JWT if the
|
134
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
146
135
|
# but only if the default endpoint does not have a region prefix.
|
147
|
-
enable_self_signed_jwt = @config.
|
148
|
-
@config.endpoint == Client.configure.endpoint &&
|
136
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
149
137
|
!@config.endpoint.split(".").first.include?("-")
|
150
138
|
credentials ||= Credentials.default scope: @config.scope,
|
151
139
|
enable_self_signed_jwt: enable_self_signed_jwt
|
152
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
140
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
153
141
|
credentials = Credentials.new credentials, scope: @config.scope
|
154
142
|
end
|
155
143
|
@quota_project_id = @config.quota_project
|
@@ -231,7 +219,9 @@ module Google
|
|
231
219
|
options.apply_defaults timeout: @config.rpcs.recognize.timeout,
|
232
220
|
metadata: metadata,
|
233
221
|
retry_policy: @config.rpcs.recognize.retry_policy
|
234
|
-
|
222
|
+
|
223
|
+
options.apply_defaults timeout: @config.timeout,
|
224
|
+
metadata: @config.metadata,
|
235
225
|
retry_policy: @config.retry_policy
|
236
226
|
|
237
227
|
@speech_stub.call_rpc :recognize, request, options: options do |response, operation|
|
@@ -260,7 +250,7 @@ module Google
|
|
260
250
|
# @param options [::Gapic::CallOptions, ::Hash]
|
261
251
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
262
252
|
#
|
263
|
-
# @overload long_running_recognize(config: nil, audio: nil)
|
253
|
+
# @overload long_running_recognize(config: nil, audio: nil, output_config: nil)
|
264
254
|
# Pass arguments to `long_running_recognize` via keyword arguments. Note that at
|
265
255
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
266
256
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -270,6 +260,8 @@ module Google
|
|
270
260
|
# process the request.
|
271
261
|
# @param audio [::Google::Cloud::Speech::V1::RecognitionAudio, ::Hash]
|
272
262
|
# Required. The audio data to be recognized.
|
263
|
+
# @param output_config [::Google::Cloud::Speech::V1::TranscriptOutputConfig, ::Hash]
|
264
|
+
# Optional. Specifies an optional destination for the recognition results.
|
273
265
|
#
|
274
266
|
# @yield [response, operation] Access the result along with the RPC operation
|
275
267
|
# @yieldparam response [::Gapic::Operation]
|
@@ -299,7 +291,9 @@ module Google
|
|
299
291
|
options.apply_defaults timeout: @config.rpcs.long_running_recognize.timeout,
|
300
292
|
metadata: metadata,
|
301
293
|
retry_policy: @config.rpcs.long_running_recognize.retry_policy
|
302
|
-
|
294
|
+
|
295
|
+
options.apply_defaults timeout: @config.timeout,
|
296
|
+
metadata: @config.metadata,
|
303
297
|
retry_policy: @config.retry_policy
|
304
298
|
|
305
299
|
@speech_stub.call_rpc :long_running_recognize, request, options: options do |response, operation|
|
@@ -353,7 +347,9 @@ module Google
|
|
353
347
|
options.apply_defaults timeout: @config.rpcs.streaming_recognize.timeout,
|
354
348
|
metadata: metadata,
|
355
349
|
retry_policy: @config.rpcs.streaming_recognize.retry_policy
|
356
|
-
|
350
|
+
|
351
|
+
options.apply_defaults timeout: @config.timeout,
|
352
|
+
metadata: @config.metadata,
|
357
353
|
retry_policy: @config.retry_policy
|
358
354
|
|
359
355
|
@speech_stub.call_rpc :streaming_recognize, request, options: options do |response, operation|
|
@@ -377,22 +373,21 @@ module Google
|
|
377
373
|
# Configuration can be applied globally to all clients, or to a single client
|
378
374
|
# on construction.
|
379
375
|
#
|
380
|
-
#
|
381
|
-
#
|
382
|
-
#
|
383
|
-
# to 20 seconds,
|
384
|
-
#
|
385
|
-
#
|
386
|
-
#
|
387
|
-
#
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
391
|
-
#
|
392
|
-
#
|
393
|
-
#
|
394
|
-
#
|
395
|
-
# end
|
376
|
+
# @example
|
377
|
+
#
|
378
|
+
# # Modify the global config, setting the timeout for
|
379
|
+
# # recognize to 20 seconds,
|
380
|
+
# # and all remaining timeouts to 10 seconds.
|
381
|
+
# ::Google::Cloud::Speech::V1::Speech::Client.configure do |config|
|
382
|
+
# config.timeout = 10.0
|
383
|
+
# config.rpcs.recognize.timeout = 20.0
|
384
|
+
# end
|
385
|
+
#
|
386
|
+
# # Apply the above configuration only to a new client.
|
387
|
+
# client = ::Google::Cloud::Speech::V1::Speech::Client.new do |config|
|
388
|
+
# config.timeout = 10.0
|
389
|
+
# config.rpcs.recognize.timeout = 20.0
|
390
|
+
# end
|
396
391
|
#
|
397
392
|
# @!attribute [rw] endpoint
|
398
393
|
# The hostname or hostname:port of the service endpoint.
|
@@ -82,7 +82,7 @@ module Google
|
|
82
82
|
# Create credentials
|
83
83
|
credentials = @config.credentials
|
84
84
|
credentials ||= Credentials.default scope: @config.scope
|
85
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
85
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
86
86
|
credentials = Credentials.new credentials, scope: @config.scope
|
87
87
|
end
|
88
88
|
@quota_project_id = @config.quota_project
|
@@ -169,7 +169,9 @@ module Google
|
|
169
169
|
options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
|
170
170
|
metadata: metadata,
|
171
171
|
retry_policy: @config.rpcs.list_operations.retry_policy
|
172
|
-
|
172
|
+
|
173
|
+
options.apply_defaults timeout: @config.timeout,
|
174
|
+
metadata: @config.metadata,
|
173
175
|
retry_policy: @config.retry_policy
|
174
176
|
|
175
177
|
@operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
|
@@ -239,7 +241,9 @@ module Google
|
|
239
241
|
options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
|
240
242
|
metadata: metadata,
|
241
243
|
retry_policy: @config.rpcs.get_operation.retry_policy
|
242
|
-
|
244
|
+
|
245
|
+
options.apply_defaults timeout: @config.timeout,
|
246
|
+
metadata: @config.metadata,
|
243
247
|
retry_policy: @config.retry_policy
|
244
248
|
|
245
249
|
@operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
|
@@ -309,7 +313,9 @@ module Google
|
|
309
313
|
options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
|
310
314
|
metadata: metadata,
|
311
315
|
retry_policy: @config.rpcs.delete_operation.retry_policy
|
312
|
-
|
316
|
+
|
317
|
+
options.apply_defaults timeout: @config.timeout,
|
318
|
+
metadata: @config.metadata,
|
313
319
|
retry_policy: @config.retry_policy
|
314
320
|
|
315
321
|
@operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
|
@@ -384,7 +390,9 @@ module Google
|
|
384
390
|
options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
|
385
391
|
metadata: metadata,
|
386
392
|
retry_policy: @config.rpcs.cancel_operation.retry_policy
|
387
|
-
|
393
|
+
|
394
|
+
options.apply_defaults timeout: @config.timeout,
|
395
|
+
metadata: @config.metadata,
|
388
396
|
retry_policy: @config.retry_policy
|
389
397
|
|
390
398
|
@operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
|
@@ -396,9 +404,9 @@ module Google
|
|
396
404
|
end
|
397
405
|
|
398
406
|
##
|
399
|
-
# Waits
|
400
|
-
#
|
401
|
-
#
|
407
|
+
# Waits until the specified long-running operation is done or reaches at most
|
408
|
+
# a specified timeout, returning the latest state. If the operation is
|
409
|
+
# already done, the latest state is immediately returned. If the timeout
|
402
410
|
# specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
|
403
411
|
# timeout is used. If the server does not support this method, it returns
|
404
412
|
# `google.rpc.Code.UNIMPLEMENTED`.
|
@@ -456,7 +464,9 @@ module Google
|
|
456
464
|
options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
|
457
465
|
metadata: metadata,
|
458
466
|
retry_policy: @config.rpcs.wait_operation.retry_policy
|
459
|
-
|
467
|
+
|
468
|
+
options.apply_defaults timeout: @config.timeout,
|
469
|
+
metadata: @config.metadata,
|
460
470
|
retry_policy: @config.retry_policy
|
461
471
|
|
462
472
|
@operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
|
@@ -481,22 +491,21 @@ module Google
|
|
481
491
|
# Configuration can be applied globally to all clients, or to a single client
|
482
492
|
# on construction.
|
483
493
|
#
|
484
|
-
#
|
485
|
-
#
|
486
|
-
#
|
487
|
-
# to 20 seconds,
|
488
|
-
#
|
489
|
-
#
|
490
|
-
#
|
491
|
-
#
|
492
|
-
#
|
493
|
-
#
|
494
|
-
#
|
495
|
-
#
|
496
|
-
#
|
497
|
-
#
|
498
|
-
#
|
499
|
-
# end
|
494
|
+
# @example
|
495
|
+
#
|
496
|
+
# # Modify the global config, setting the timeout for
|
497
|
+
# # list_operations to 20 seconds,
|
498
|
+
# # and all remaining timeouts to 10 seconds.
|
499
|
+
# ::Google::Longrunning::Operations::Client.configure do |config|
|
500
|
+
# config.timeout = 10.0
|
501
|
+
# config.rpcs.list_operations.timeout = 20.0
|
502
|
+
# end
|
503
|
+
#
|
504
|
+
# # Apply the above configuration only to a new client.
|
505
|
+
# client = ::Google::Longrunning::Operations::Client.new do |config|
|
506
|
+
# config.timeout = 10.0
|
507
|
+
# config.rpcs.list_operations.timeout = 20.0
|
508
|
+
# end
|
500
509
|
#
|
501
510
|
# @!attribute [rw] endpoint
|
502
511
|
# The hostname or hostname:port of the service endpoint.
|
@@ -57,9 +57,15 @@ module Google
|
|
57
57
|
|
58
58
|
# Denotes that a (repeated) field is an unordered list.
|
59
59
|
# This indicates that the service may provide the elements of the list
|
60
|
-
# in any arbitrary
|
60
|
+
# in any arbitrary order, rather than the order the user originally
|
61
61
|
# provided. Additionally, the list's order may or may not be stable.
|
62
62
|
UNORDERED_LIST = 6
|
63
|
+
|
64
|
+
# Denotes that this field returns a non-empty default value if not set.
|
65
|
+
# This indicates that if the user provides the empty value in a request,
|
66
|
+
# a non-empty value will be returned. The user will not be aware of what
|
67
|
+
# non-empty value to expect.
|
68
|
+
NON_EMPTY_DEFAULT = 7
|
63
69
|
end
|
64
70
|
end
|
65
71
|
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
|
@@ -166,7 +190,7 @@ module Google
|
|
166
190
|
# A means to provide context to assist the speech recognition. For more
|
167
191
|
# information, see
|
168
192
|
# [speech
|
169
|
-
# adaptation](https://cloud.google.com/speech-to-text/docs/
|
193
|
+
# adaptation](https://cloud.google.com/speech-to-text/docs/adaptation).
|
170
194
|
# @!attribute [rw] enable_word_time_offsets
|
171
195
|
# @return [::Boolean]
|
172
196
|
# If `true`, the top result includes a list of words and
|
@@ -179,9 +203,6 @@ module Google
|
|
179
203
|
# This feature is only available in select languages. Setting this for
|
180
204
|
# requests in other languages has no effect at all.
|
181
205
|
# 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.
|
185
206
|
# @!attribute [rw] diarization_config
|
186
207
|
# @return [::Google::Cloud::Speech::V1::SpeakerDiarizationConfig]
|
187
208
|
# Config to enable speaker diarization and set additional
|
@@ -217,7 +238,7 @@ module Google
|
|
217
238
|
# </tr>
|
218
239
|
# <tr>
|
219
240
|
# <td><code>video</code></td>
|
220
|
-
# <td>Best for audio that originated from
|
241
|
+
# <td>Best for audio that originated from video or includes multiple
|
221
242
|
# speakers. Ideally the audio is recorded at a 16khz or greater
|
222
243
|
# sampling rate. This is a premium model that costs more than the
|
223
244
|
# standard rate.</td>
|
@@ -253,7 +274,7 @@ module Google
|
|
253
274
|
# a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
|
254
275
|
# recognition can be reduced if lossy codecs are used to capture or transmit
|
255
276
|
# audio, particularly if background noise is present. Lossy codecs include
|
256
|
-
# `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`,
|
277
|
+
# `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, `MP3`.
|
257
278
|
#
|
258
279
|
# The `FLAC` and `WAV` audio file formats include a header that describes the
|
259
280
|
# included audio content. You can request recognition for `WAV` files that
|
@@ -329,7 +350,7 @@ module Google
|
|
329
350
|
# number of speakers. If not set, the default value is 6.
|
330
351
|
# @!attribute [r] speaker_tag
|
331
352
|
# @return [::Integer]
|
332
|
-
# Unused.
|
353
|
+
# Output only. Unused.
|
333
354
|
class SpeakerDiarizationConfig
|
334
355
|
include ::Google::Protobuf::MessageExts
|
335
356
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -516,6 +537,9 @@ module Google
|
|
516
537
|
# @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionResult>]
|
517
538
|
# Sequential list of transcription results corresponding to
|
518
539
|
# sequential portions of audio.
|
540
|
+
# @!attribute [rw] total_billed_time
|
541
|
+
# @return [::Google::Protobuf::Duration]
|
542
|
+
# When available, billed audio seconds for the corresponding request.
|
519
543
|
class RecognizeResponse
|
520
544
|
include ::Google::Protobuf::MessageExts
|
521
545
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -530,6 +554,9 @@ module Google
|
|
530
554
|
# @return [::Array<::Google::Cloud::Speech::V1::SpeechRecognitionResult>]
|
531
555
|
# Sequential list of transcription results corresponding to
|
532
556
|
# sequential portions of audio.
|
557
|
+
# @!attribute [rw] total_billed_time
|
558
|
+
# @return [::Google::Protobuf::Duration]
|
559
|
+
# When available, billed audio seconds for the corresponding request.
|
533
560
|
class LongRunningRecognizeResponse
|
534
561
|
include ::Google::Protobuf::MessageExts
|
535
562
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -548,6 +575,10 @@ module Google
|
|
548
575
|
# @!attribute [rw] last_update_time
|
549
576
|
# @return [::Google::Protobuf::Timestamp]
|
550
577
|
# Time of the most recent processing update.
|
578
|
+
# @!attribute [r] uri
|
579
|
+
# @return [::String]
|
580
|
+
# Output only. The URI of the audio file being transcribed. Empty if the audio was sent
|
581
|
+
# as byte content.
|
551
582
|
class LongRunningRecognizeMetadata
|
552
583
|
include ::Google::Protobuf::MessageExts
|
553
584
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -559,8 +590,8 @@ module Google
|
|
559
590
|
# audio, and `single_utterance` is set to false, then no messages are streamed
|
560
591
|
# back to the client.
|
561
592
|
#
|
562
|
-
# Here's an example of a series of
|
563
|
-
#
|
593
|
+
# Here's an example of a series of `StreamingRecognizeResponse`s that might be
|
594
|
+
# returned while processing audio:
|
564
595
|
#
|
565
596
|
# 1. results { alternatives { transcript: "tube" } stability: 0.01 }
|
566
597
|
#
|
@@ -615,6 +646,10 @@ module Google
|
|
615
646
|
# @!attribute [rw] speech_event_type
|
616
647
|
# @return [::Google::Cloud::Speech::V1::StreamingRecognizeResponse::SpeechEventType]
|
617
648
|
# Indicates the type of speech event.
|
649
|
+
# @!attribute [rw] total_billed_time
|
650
|
+
# @return [::Google::Protobuf::Duration]
|
651
|
+
# When available, billed audio seconds for the stream.
|
652
|
+
# Set only if this is the last response in the stream.
|
618
653
|
class StreamingRecognizeResponse
|
619
654
|
include ::Google::Protobuf::MessageExts
|
620
655
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -738,7 +773,7 @@ module Google
|
|
738
773
|
# The word corresponding to this set of information.
|
739
774
|
# @!attribute [r] speaker_tag
|
740
775
|
# @return [::Integer]
|
741
|
-
# A distinct integer value is assigned for every speaker within
|
776
|
+
# Output only. A distinct integer value is assigned for every speaker within
|
742
777
|
# the audio. This field specifies which one of those speakers was detected to
|
743
778
|
# have spoken this word. Value ranges from '1' to diarization_speaker_count.
|
744
779
|
# speaker_tag is set if enable_speaker_diarization = 'true' and only in the
|
@@ -0,0 +1,121 @@
|
|
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 Protobuf
|
22
|
+
# Wrapper message for `double`.
|
23
|
+
#
|
24
|
+
# The JSON representation for `DoubleValue` is JSON number.
|
25
|
+
# @!attribute [rw] value
|
26
|
+
# @return [::Float]
|
27
|
+
# The double value.
|
28
|
+
class DoubleValue
|
29
|
+
include ::Google::Protobuf::MessageExts
|
30
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
31
|
+
end
|
32
|
+
|
33
|
+
# Wrapper message for `float`.
|
34
|
+
#
|
35
|
+
# The JSON representation for `FloatValue` is JSON number.
|
36
|
+
# @!attribute [rw] value
|
37
|
+
# @return [::Float]
|
38
|
+
# The float value.
|
39
|
+
class FloatValue
|
40
|
+
include ::Google::Protobuf::MessageExts
|
41
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
42
|
+
end
|
43
|
+
|
44
|
+
# Wrapper message for `int64`.
|
45
|
+
#
|
46
|
+
# The JSON representation for `Int64Value` is JSON string.
|
47
|
+
# @!attribute [rw] value
|
48
|
+
# @return [::Integer]
|
49
|
+
# The int64 value.
|
50
|
+
class Int64Value
|
51
|
+
include ::Google::Protobuf::MessageExts
|
52
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
53
|
+
end
|
54
|
+
|
55
|
+
# Wrapper message for `uint64`.
|
56
|
+
#
|
57
|
+
# The JSON representation for `UInt64Value` is JSON string.
|
58
|
+
# @!attribute [rw] value
|
59
|
+
# @return [::Integer]
|
60
|
+
# The uint64 value.
|
61
|
+
class UInt64Value
|
62
|
+
include ::Google::Protobuf::MessageExts
|
63
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
64
|
+
end
|
65
|
+
|
66
|
+
# Wrapper message for `int32`.
|
67
|
+
#
|
68
|
+
# The JSON representation for `Int32Value` is JSON number.
|
69
|
+
# @!attribute [rw] value
|
70
|
+
# @return [::Integer]
|
71
|
+
# The int32 value.
|
72
|
+
class Int32Value
|
73
|
+
include ::Google::Protobuf::MessageExts
|
74
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
75
|
+
end
|
76
|
+
|
77
|
+
# Wrapper message for `uint32`.
|
78
|
+
#
|
79
|
+
# The JSON representation for `UInt32Value` is JSON number.
|
80
|
+
# @!attribute [rw] value
|
81
|
+
# @return [::Integer]
|
82
|
+
# The uint32 value.
|
83
|
+
class UInt32Value
|
84
|
+
include ::Google::Protobuf::MessageExts
|
85
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
86
|
+
end
|
87
|
+
|
88
|
+
# Wrapper message for `bool`.
|
89
|
+
#
|
90
|
+
# The JSON representation for `BoolValue` is JSON `true` and `false`.
|
91
|
+
# @!attribute [rw] value
|
92
|
+
# @return [::Boolean]
|
93
|
+
# The bool value.
|
94
|
+
class BoolValue
|
95
|
+
include ::Google::Protobuf::MessageExts
|
96
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
97
|
+
end
|
98
|
+
|
99
|
+
# Wrapper message for `string`.
|
100
|
+
#
|
101
|
+
# The JSON representation for `StringValue` is JSON string.
|
102
|
+
# @!attribute [rw] value
|
103
|
+
# @return [::String]
|
104
|
+
# The string value.
|
105
|
+
class StringValue
|
106
|
+
include ::Google::Protobuf::MessageExts
|
107
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
108
|
+
end
|
109
|
+
|
110
|
+
# Wrapper message for `bytes`.
|
111
|
+
#
|
112
|
+
# The JSON representation for `BytesValue` is JSON string.
|
113
|
+
# @!attribute [rw] value
|
114
|
+
# @return [::String]
|
115
|
+
# The bytes value.
|
116
|
+
class BytesValue
|
117
|
+
include ::Google::Protobuf::MessageExts
|
118
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-speech-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.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: 2021-
|
11
|
+
date: 2021-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.7'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 2.a
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.7'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 2.a
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: google-cloud-errors
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,6 +191,7 @@ files:
|
|
185
191
|
- proto_docs/google/protobuf/duration.rb
|
186
192
|
- proto_docs/google/protobuf/empty.rb
|
187
193
|
- proto_docs/google/protobuf/timestamp.rb
|
194
|
+
- proto_docs/google/protobuf/wrappers.rb
|
188
195
|
- proto_docs/google/rpc/status.rb
|
189
196
|
homepage: https://github.com/googleapis/google-cloud-ruby
|
190
197
|
licenses:
|
@@ -205,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
212
|
- !ruby/object:Gem::Version
|
206
213
|
version: '0'
|
207
214
|
requirements: []
|
208
|
-
rubygems_version: 3.2.
|
215
|
+
rubygems_version: 3.2.17
|
209
216
|
signing_key:
|
210
217
|
specification_version: 4
|
211
218
|
summary: API Client library for the Cloud Speech-to-Text V1 API
|