google-cloud-speech-v1p1beta1 0.9.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb +62 -49
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb +3 -0
- data/lib/google/cloud/speech/v1p1beta1/speech/client.rb +41 -48
- data/lib/google/cloud/speech/v1p1beta1/speech/operations.rb +34 -25
- data/lib/google/cloud/speech/v1p1beta1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb +10 -0
- data/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb +2 -2
- metadata +13 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20f63757c8cfc052d0d74875c69ce42acf77cec45a59c35f332dad3625fa5c24
|
4
|
+
data.tar.gz: 79923a57f03488321d859a7d0b132b51c1d38948aade2ab4ad6f94e6c262b772
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bde0d60815c6a4cf07e3b42796fddc514fde3dace61b49ba4c48a0ee34d7fe79d748eab0e80c265e07aa7614a887c2e0d5519cdae186f71a8fe0f4dcdf8db857
|
7
|
+
data.tar.gz: 23e2cb90679b48e9cdacd61508ff9cee7089bec5760c90e8c9c503175ff591b385340236d7d2e74b61f113f2401e9feb91911e459940e7ebe3d19993d85a6430
|
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-speech-v1p1beta1
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::Speech::V1p1beta1::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/v1p1beta1"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Speech::V1p1beta1::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/v1p1beta1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Speech::V1p1beta1::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/v1p1beta1"
|
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/v1p1beta1"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.recognize request
|
38
38
|
```
|
39
39
|
|
@@ -41,13 +41,12 @@ module Google
|
|
41
41
|
# See {::Google::Cloud::Speech::V1p1beta1::Adaptation::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all Adaptation clients
|
47
|
+
# ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
51
50
|
#
|
52
51
|
# @yield [config] Configure the Client client.
|
53
52
|
# @yieldparam config [Client::Configuration]
|
@@ -94,19 +93,15 @@ module Google
|
|
94
93
|
##
|
95
94
|
# Create a new Adaptation client object.
|
96
95
|
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
# To create a new Adaptation client with the default
|
100
|
-
# configuration:
|
101
|
-
#
|
102
|
-
# client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
96
|
+
# @example
|
103
97
|
#
|
104
|
-
#
|
105
|
-
#
|
98
|
+
# # Create a client using the default configuration
|
99
|
+
# client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new
|
106
100
|
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
101
|
+
# # Create a client using a custom configuration
|
102
|
+
# client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config|
|
103
|
+
# config.timeout = 10.0
|
104
|
+
# end
|
110
105
|
#
|
111
106
|
# @yield [config] Configure the Adaptation client.
|
112
107
|
# @yieldparam config [Client::Configuration]
|
@@ -126,14 +121,13 @@ module Google
|
|
126
121
|
|
127
122
|
# Create credentials
|
128
123
|
credentials = @config.credentials
|
129
|
-
# Use self-signed JWT if the
|
124
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
130
125
|
# but only if the default endpoint does not have a region prefix.
|
131
|
-
enable_self_signed_jwt = @config.
|
132
|
-
@config.endpoint == Client.configure.endpoint &&
|
126
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
133
127
|
!@config.endpoint.split(".").first.include?("-")
|
134
128
|
credentials ||= Credentials.default scope: @config.scope,
|
135
129
|
enable_self_signed_jwt: enable_self_signed_jwt
|
136
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
130
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
137
131
|
credentials = Credentials.new credentials, scope: @config.scope
|
138
132
|
end
|
139
133
|
@quota_project_id = @config.quota_project
|
@@ -175,7 +169,7 @@ module Google
|
|
175
169
|
# Format:
|
176
170
|
# \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets
|
177
171
|
# @param phrase_set_id [::String]
|
178
|
-
# The ID to use for the phrase set, which will become the final
|
172
|
+
# Required. The ID to use for the phrase set, which will become the final
|
179
173
|
# component of the phrase set's resource name.
|
180
174
|
#
|
181
175
|
# This value should be 4-63 characters, and valid characters
|
@@ -217,7 +211,9 @@ module Google
|
|
217
211
|
options.apply_defaults timeout: @config.rpcs.create_phrase_set.timeout,
|
218
212
|
metadata: metadata,
|
219
213
|
retry_policy: @config.rpcs.create_phrase_set.retry_policy
|
220
|
-
|
214
|
+
|
215
|
+
options.apply_defaults timeout: @config.timeout,
|
216
|
+
metadata: @config.metadata,
|
221
217
|
retry_policy: @config.retry_policy
|
222
218
|
|
223
219
|
@adaptation_stub.call_rpc :create_phrase_set, request, options: options do |response, operation|
|
@@ -285,7 +281,9 @@ module Google
|
|
285
281
|
options.apply_defaults timeout: @config.rpcs.get_phrase_set.timeout,
|
286
282
|
metadata: metadata,
|
287
283
|
retry_policy: @config.rpcs.get_phrase_set.retry_policy
|
288
|
-
|
284
|
+
|
285
|
+
options.apply_defaults timeout: @config.timeout,
|
286
|
+
metadata: @config.metadata,
|
289
287
|
retry_policy: @config.retry_policy
|
290
288
|
|
291
289
|
@adaptation_stub.call_rpc :get_phrase_set, request, options: options do |response, operation|
|
@@ -364,7 +362,9 @@ module Google
|
|
364
362
|
options.apply_defaults timeout: @config.rpcs.list_phrase_set.timeout,
|
365
363
|
metadata: metadata,
|
366
364
|
retry_policy: @config.rpcs.list_phrase_set.retry_policy
|
367
|
-
|
365
|
+
|
366
|
+
options.apply_defaults timeout: @config.timeout,
|
367
|
+
metadata: @config.metadata,
|
368
368
|
retry_policy: @config.retry_policy
|
369
369
|
|
370
370
|
@adaptation_stub.call_rpc :list_phrase_set, request, options: options do |response, operation|
|
@@ -437,7 +437,9 @@ module Google
|
|
437
437
|
options.apply_defaults timeout: @config.rpcs.update_phrase_set.timeout,
|
438
438
|
metadata: metadata,
|
439
439
|
retry_policy: @config.rpcs.update_phrase_set.retry_policy
|
440
|
-
|
440
|
+
|
441
|
+
options.apply_defaults timeout: @config.timeout,
|
442
|
+
metadata: @config.metadata,
|
441
443
|
retry_policy: @config.retry_policy
|
442
444
|
|
443
445
|
@adaptation_stub.call_rpc :update_phrase_set, request, options: options do |response, operation|
|
@@ -505,7 +507,9 @@ module Google
|
|
505
507
|
options.apply_defaults timeout: @config.rpcs.delete_phrase_set.timeout,
|
506
508
|
metadata: metadata,
|
507
509
|
retry_policy: @config.rpcs.delete_phrase_set.retry_policy
|
508
|
-
|
510
|
+
|
511
|
+
options.apply_defaults timeout: @config.timeout,
|
512
|
+
metadata: @config.metadata,
|
509
513
|
retry_policy: @config.retry_policy
|
510
514
|
|
511
515
|
@adaptation_stub.call_rpc :delete_phrase_set, request, options: options do |response, operation|
|
@@ -539,7 +543,7 @@ module Google
|
|
539
543
|
# Format:
|
540
544
|
# \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses
|
541
545
|
# @param custom_class_id [::String]
|
542
|
-
# The ID to use for the custom class, which will become the final
|
546
|
+
# Required. The ID to use for the custom class, which will become the final
|
543
547
|
# component of the custom class' resource name.
|
544
548
|
#
|
545
549
|
# This value should be 4-63 characters, and valid characters
|
@@ -581,7 +585,9 @@ module Google
|
|
581
585
|
options.apply_defaults timeout: @config.rpcs.create_custom_class.timeout,
|
582
586
|
metadata: metadata,
|
583
587
|
retry_policy: @config.rpcs.create_custom_class.retry_policy
|
584
|
-
|
588
|
+
|
589
|
+
options.apply_defaults timeout: @config.timeout,
|
590
|
+
metadata: @config.metadata,
|
585
591
|
retry_policy: @config.retry_policy
|
586
592
|
|
587
593
|
@adaptation_stub.call_rpc :create_custom_class, request, options: options do |response, operation|
|
@@ -649,7 +655,9 @@ module Google
|
|
649
655
|
options.apply_defaults timeout: @config.rpcs.get_custom_class.timeout,
|
650
656
|
metadata: metadata,
|
651
657
|
retry_policy: @config.rpcs.get_custom_class.retry_policy
|
652
|
-
|
658
|
+
|
659
|
+
options.apply_defaults timeout: @config.timeout,
|
660
|
+
metadata: @config.metadata,
|
653
661
|
retry_policy: @config.retry_policy
|
654
662
|
|
655
663
|
@adaptation_stub.call_rpc :get_custom_class, request, options: options do |response, operation|
|
@@ -728,7 +736,9 @@ module Google
|
|
728
736
|
options.apply_defaults timeout: @config.rpcs.list_custom_classes.timeout,
|
729
737
|
metadata: metadata,
|
730
738
|
retry_policy: @config.rpcs.list_custom_classes.retry_policy
|
731
|
-
|
739
|
+
|
740
|
+
options.apply_defaults timeout: @config.timeout,
|
741
|
+
metadata: @config.metadata,
|
732
742
|
retry_policy: @config.retry_policy
|
733
743
|
|
734
744
|
@adaptation_stub.call_rpc :list_custom_classes, request, options: options do |response, operation|
|
@@ -801,7 +811,9 @@ module Google
|
|
801
811
|
options.apply_defaults timeout: @config.rpcs.update_custom_class.timeout,
|
802
812
|
metadata: metadata,
|
803
813
|
retry_policy: @config.rpcs.update_custom_class.retry_policy
|
804
|
-
|
814
|
+
|
815
|
+
options.apply_defaults timeout: @config.timeout,
|
816
|
+
metadata: @config.metadata,
|
805
817
|
retry_policy: @config.retry_policy
|
806
818
|
|
807
819
|
@adaptation_stub.call_rpc :update_custom_class, request, options: options do |response, operation|
|
@@ -869,7 +881,9 @@ module Google
|
|
869
881
|
options.apply_defaults timeout: @config.rpcs.delete_custom_class.timeout,
|
870
882
|
metadata: metadata,
|
871
883
|
retry_policy: @config.rpcs.delete_custom_class.retry_policy
|
872
|
-
|
884
|
+
|
885
|
+
options.apply_defaults timeout: @config.timeout,
|
886
|
+
metadata: @config.metadata,
|
873
887
|
retry_policy: @config.retry_policy
|
874
888
|
|
875
889
|
@adaptation_stub.call_rpc :delete_custom_class, request, options: options do |response, operation|
|
@@ -893,22 +907,21 @@ module Google
|
|
893
907
|
# Configuration can be applied globally to all clients, or to a single client
|
894
908
|
# on construction.
|
895
909
|
#
|
896
|
-
#
|
897
|
-
#
|
898
|
-
#
|
899
|
-
# to 20 seconds,
|
900
|
-
#
|
901
|
-
#
|
902
|
-
#
|
903
|
-
#
|
904
|
-
#
|
905
|
-
#
|
906
|
-
#
|
907
|
-
#
|
908
|
-
#
|
909
|
-
#
|
910
|
-
#
|
911
|
-
# end
|
910
|
+
# @example
|
911
|
+
#
|
912
|
+
# # Modify the global config, setting the timeout for
|
913
|
+
# # create_phrase_set to 20 seconds,
|
914
|
+
# # and all remaining timeouts to 10 seconds.
|
915
|
+
# ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.configure do |config|
|
916
|
+
# config.timeout = 10.0
|
917
|
+
# config.rpcs.create_phrase_set.timeout = 20.0
|
918
|
+
# end
|
919
|
+
#
|
920
|
+
# # Apply the above configuration only to a new client.
|
921
|
+
# client = ::Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new do |config|
|
922
|
+
# config.timeout = 10.0
|
923
|
+
# config.rpcs.create_phrase_set.timeout = 20.0
|
924
|
+
# end
|
912
925
|
#
|
913
926
|
# @!attribute [rw] endpoint
|
914
927
|
# The hostname or hostname:port of the service endpoint.
|
@@ -135,9 +135,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
135
135
|
end
|
136
136
|
add_message "google.cloud.speech.v1p1beta1.RecognizeResponse" do
|
137
137
|
repeated :results, :message, 2, "google.cloud.speech.v1p1beta1.SpeechRecognitionResult"
|
138
|
+
optional :total_billed_time, :message, 3, "google.protobuf.Duration"
|
138
139
|
end
|
139
140
|
add_message "google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse" do
|
140
141
|
repeated :results, :message, 2, "google.cloud.speech.v1p1beta1.SpeechRecognitionResult"
|
142
|
+
optional :total_billed_time, :message, 3, "google.protobuf.Duration"
|
141
143
|
optional :output_config, :message, 6, "google.cloud.speech.v1p1beta1.TranscriptOutputConfig"
|
142
144
|
optional :output_error, :message, 7, "google.rpc.Status"
|
143
145
|
end
|
@@ -152,6 +154,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
152
154
|
optional :error, :message, 1, "google.rpc.Status"
|
153
155
|
repeated :results, :message, 2, "google.cloud.speech.v1p1beta1.StreamingRecognitionResult"
|
154
156
|
optional :speech_event_type, :enum, 4, "google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType"
|
157
|
+
optional :total_billed_time, :message, 5, "google.protobuf.Duration"
|
155
158
|
end
|
156
159
|
add_enum "google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType" do
|
157
160
|
value :SPEECH_EVENT_UNSPECIFIED, 0
|
@@ -41,13 +41,12 @@ module Google
|
|
41
41
|
# See {::Google::Cloud::Speech::V1p1beta1::Speech::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all Speech clients
|
47
|
+
# ::Google::Cloud::Speech::V1p1beta1::Speech::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
51
50
|
#
|
52
51
|
# @yield [config] Configure the Client client.
|
53
52
|
# @yieldparam config [Client::Configuration]
|
@@ -67,20 +66,14 @@ module Google
|
|
67
66
|
|
68
67
|
default_config.rpcs.recognize.timeout = 5000.0
|
69
68
|
default_config.rpcs.recognize.retry_policy = {
|
70
|
-
initial_delay: 0.1,
|
71
|
-
max_delay: 60.0,
|
72
|
-
multiplier: 1.3,
|
73
|
-
retry_codes: [4, 14]
|
69
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
74
70
|
}
|
75
71
|
|
76
72
|
default_config.rpcs.long_running_recognize.timeout = 5000.0
|
77
73
|
|
78
74
|
default_config.rpcs.streaming_recognize.timeout = 5000.0
|
79
75
|
default_config.rpcs.streaming_recognize.retry_policy = {
|
80
|
-
initial_delay: 0.1,
|
81
|
-
max_delay: 60.0,
|
82
|
-
multiplier: 1.3,
|
83
|
-
retry_codes: [4, 14]
|
76
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
|
84
77
|
}
|
85
78
|
|
86
79
|
default_config
|
@@ -112,19 +105,15 @@ module Google
|
|
112
105
|
##
|
113
106
|
# Create a new Speech client object.
|
114
107
|
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
# To create a new Speech client with the default
|
118
|
-
# configuration:
|
119
|
-
#
|
120
|
-
# client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new
|
108
|
+
# @example
|
121
109
|
#
|
122
|
-
#
|
123
|
-
#
|
110
|
+
# # Create a client using the default configuration
|
111
|
+
# client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new
|
124
112
|
#
|
125
|
-
#
|
126
|
-
#
|
127
|
-
#
|
113
|
+
# # Create a client using a custom configuration
|
114
|
+
# client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config|
|
115
|
+
# config.timeout = 10.0
|
116
|
+
# end
|
128
117
|
#
|
129
118
|
# @yield [config] Configure the Speech client.
|
130
119
|
# @yieldparam config [Client::Configuration]
|
@@ -144,14 +133,13 @@ module Google
|
|
144
133
|
|
145
134
|
# Create credentials
|
146
135
|
credentials = @config.credentials
|
147
|
-
# Use self-signed JWT if the
|
136
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
148
137
|
# but only if the default endpoint does not have a region prefix.
|
149
|
-
enable_self_signed_jwt = @config.
|
150
|
-
@config.endpoint == Client.configure.endpoint &&
|
138
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
151
139
|
!@config.endpoint.split(".").first.include?("-")
|
152
140
|
credentials ||= Credentials.default scope: @config.scope,
|
153
141
|
enable_self_signed_jwt: enable_self_signed_jwt
|
154
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
142
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
155
143
|
credentials = Credentials.new credentials, scope: @config.scope
|
156
144
|
end
|
157
145
|
@quota_project_id = @config.quota_project
|
@@ -233,7 +221,9 @@ module Google
|
|
233
221
|
options.apply_defaults timeout: @config.rpcs.recognize.timeout,
|
234
222
|
metadata: metadata,
|
235
223
|
retry_policy: @config.rpcs.recognize.retry_policy
|
236
|
-
|
224
|
+
|
225
|
+
options.apply_defaults timeout: @config.timeout,
|
226
|
+
metadata: @config.metadata,
|
237
227
|
retry_policy: @config.retry_policy
|
238
228
|
|
239
229
|
@speech_stub.call_rpc :recognize, request, options: options do |response, operation|
|
@@ -303,7 +293,9 @@ module Google
|
|
303
293
|
options.apply_defaults timeout: @config.rpcs.long_running_recognize.timeout,
|
304
294
|
metadata: metadata,
|
305
295
|
retry_policy: @config.rpcs.long_running_recognize.retry_policy
|
306
|
-
|
296
|
+
|
297
|
+
options.apply_defaults timeout: @config.timeout,
|
298
|
+
metadata: @config.metadata,
|
307
299
|
retry_policy: @config.retry_policy
|
308
300
|
|
309
301
|
@speech_stub.call_rpc :long_running_recognize, request, options: options do |response, operation|
|
@@ -357,7 +349,9 @@ module Google
|
|
357
349
|
options.apply_defaults timeout: @config.rpcs.streaming_recognize.timeout,
|
358
350
|
metadata: metadata,
|
359
351
|
retry_policy: @config.rpcs.streaming_recognize.retry_policy
|
360
|
-
|
352
|
+
|
353
|
+
options.apply_defaults timeout: @config.timeout,
|
354
|
+
metadata: @config.metadata,
|
361
355
|
retry_policy: @config.retry_policy
|
362
356
|
|
363
357
|
@speech_stub.call_rpc :streaming_recognize, request, options: options do |response, operation|
|
@@ -381,22 +375,21 @@ module Google
|
|
381
375
|
# Configuration can be applied globally to all clients, or to a single client
|
382
376
|
# on construction.
|
383
377
|
#
|
384
|
-
#
|
385
|
-
#
|
386
|
-
#
|
387
|
-
# to 20 seconds,
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
391
|
-
#
|
392
|
-
#
|
393
|
-
#
|
394
|
-
#
|
395
|
-
#
|
396
|
-
#
|
397
|
-
#
|
398
|
-
#
|
399
|
-
# end
|
378
|
+
# @example
|
379
|
+
#
|
380
|
+
# # Modify the global config, setting the timeout for
|
381
|
+
# # recognize to 20 seconds,
|
382
|
+
# # and all remaining timeouts to 10 seconds.
|
383
|
+
# ::Google::Cloud::Speech::V1p1beta1::Speech::Client.configure do |config|
|
384
|
+
# config.timeout = 10.0
|
385
|
+
# config.rpcs.recognize.timeout = 20.0
|
386
|
+
# end
|
387
|
+
#
|
388
|
+
# # Apply the above configuration only to a new client.
|
389
|
+
# client = ::Google::Cloud::Speech::V1p1beta1::Speech::Client.new do |config|
|
390
|
+
# config.timeout = 10.0
|
391
|
+
# config.rpcs.recognize.timeout = 20.0
|
392
|
+
# end
|
400
393
|
#
|
401
394
|
# @!attribute [rw] endpoint
|
402
395
|
# 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
|
@@ -616,6 +616,9 @@ module Google
|
|
616
616
|
# @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>]
|
617
617
|
# Sequential list of transcription results corresponding to
|
618
618
|
# sequential portions of audio.
|
619
|
+
# @!attribute [rw] total_billed_time
|
620
|
+
# @return [::Google::Protobuf::Duration]
|
621
|
+
# When available, billed audio seconds for the corresponding request.
|
619
622
|
class RecognizeResponse
|
620
623
|
include ::Google::Protobuf::MessageExts
|
621
624
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -630,6 +633,9 @@ module Google
|
|
630
633
|
# @return [::Array<::Google::Cloud::Speech::V1p1beta1::SpeechRecognitionResult>]
|
631
634
|
# Sequential list of transcription results corresponding to
|
632
635
|
# sequential portions of audio.
|
636
|
+
# @!attribute [rw] total_billed_time
|
637
|
+
# @return [::Google::Protobuf::Duration]
|
638
|
+
# When available, billed audio seconds for the corresponding request.
|
633
639
|
# @!attribute [rw] output_config
|
634
640
|
# @return [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig]
|
635
641
|
# Original output config if present in the request.
|
@@ -728,6 +734,10 @@ module Google
|
|
728
734
|
# @!attribute [rw] speech_event_type
|
729
735
|
# @return [::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse::SpeechEventType]
|
730
736
|
# Indicates the type of speech event.
|
737
|
+
# @!attribute [rw] total_billed_time
|
738
|
+
# @return [::Google::Protobuf::Duration]
|
739
|
+
# When available, billed audio seconds for the stream.
|
740
|
+
# Set only if this is the last response in the stream.
|
731
741
|
class StreamingRecognizeResponse
|
732
742
|
include ::Google::Protobuf::MessageExts
|
733
743
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -29,7 +29,7 @@ module Google
|
|
29
29
|
# \\{api_version}/projects/\\{project}/locations/\\{location}/phraseSets
|
30
30
|
# @!attribute [rw] phrase_set_id
|
31
31
|
# @return [::String]
|
32
|
-
# The ID to use for the phrase set, which will become the final
|
32
|
+
# Required. The ID to use for the phrase set, which will become the final
|
33
33
|
# component of the phrase set's resource name.
|
34
34
|
#
|
35
35
|
# This value should be 4-63 characters, and valid characters
|
@@ -125,7 +125,7 @@ module Google
|
|
125
125
|
# \\{api_version}/projects/\\{project}/locations/\\{location}/customClasses
|
126
126
|
# @!attribute [rw] custom_class_id
|
127
127
|
# @return [::String]
|
128
|
-
# The ID to use for the custom class, which will become the final
|
128
|
+
# Required. The ID to use for the custom class, which will become the final
|
129
129
|
# component of the custom class' resource name.
|
130
130
|
#
|
131
131
|
# This value should be 4-63 characters, and valid characters
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-speech-v1p1beta1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.1
|
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-08-11 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
|
@@ -217,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
223
|
- !ruby/object:Gem::Version
|
218
224
|
version: '0'
|
219
225
|
requirements: []
|
220
|
-
rubygems_version: 3.2.
|
226
|
+
rubygems_version: 3.2.17
|
221
227
|
signing_key:
|
222
228
|
specification_version: 4
|
223
229
|
summary: API Client library for the Cloud Speech-to-Text V1p1beta1 API
|