google-cloud-speech-v2 0.2.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/google/cloud/speech/v2/bindings_override.rb +102 -0
- data/lib/google/cloud/speech/v2/cloud_speech_pb.rb +29 -0
- data/lib/google/cloud/speech/v2/cloud_speech_services_pb.rb +1 -1
- data/lib/google/cloud/speech/v2/rest.rb +1 -0
- data/lib/google/cloud/speech/v2/speech/client.rb +30 -11
- data/lib/google/cloud/speech/v2/speech/operations.rb +2 -2
- data/lib/google/cloud/speech/v2/speech/rest/client.rb +38 -11
- data/lib/google/cloud/speech/v2/speech/rest/operations.rb +2 -2
- data/lib/google/cloud/speech/v2/speech/rest.rb +1 -0
- data/lib/google/cloud/speech/v2/version.rb +1 -1
- data/proto_docs/google/api/client.rb +67 -4
- data/proto_docs/google/cloud/speech/v2/cloud_speech.rb +136 -55
- metadata +26 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cf4d4c7df13e982a4445c71f9718dec880581b5d3af5d0144375a08ebe3ffb2
|
4
|
+
data.tar.gz: 2383d5ae6a86525d679a6bd78a4e69b006dcca5fa9cd930bb845ebb9c3221bef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f38a8ad1754232f45056ad4bf2138347c8c189bcfae40f90ad22268a231a88d1cf5458ab4b14b7f1065c42ab415442b66862b09c811bfa5a63bf0539304534a
|
7
|
+
data.tar.gz: 1dcbb075133194ce0ba9ca6989735602bd514d48a7a0106f6744a36c18fcff5e3d9873d4aee9cc6d8c003f44412db03c4e21145d8d4c9ca258e1884cc9ea1af1
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Ruby Client for the Cloud Speech-to-Text V2 API
|
2
2
|
|
3
|
-
|
3
|
+
Converts audio to text by applying powerful neural network models.
|
4
4
|
|
5
5
|
Google Speech-to-Text enables developers to convert audio to text by applying powerful neural network models in an easy-to-use API. The API recognizes more than 120 languages and variants to support your global user base. You can enable voice command-and-control, transcribe audio from call centers, and more. It can process real-time streaming or prerecorded audio, using Google's machine learning technology.
|
6
6
|
|
@@ -47,7 +47,7 @@ for general usage information.
|
|
47
47
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
49
|
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
50
|
-
or a [`Google::Cloud::Logging::Logger`](https://
|
50
|
+
or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
|
51
51
|
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
53
53
|
|
@@ -0,0 +1,102 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 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
|
+
require "gapic/config"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Speech
|
24
|
+
##
|
25
|
+
# @example Loading just the REST part of this package, including all its services, and instantiating a REST client
|
26
|
+
#
|
27
|
+
# require "google/cloud/speech/v2/rest"
|
28
|
+
# client = ::Google::Cloud::Speech::V2::Speech::Rest::Client.new
|
29
|
+
#
|
30
|
+
module V2
|
31
|
+
##
|
32
|
+
# @private
|
33
|
+
# Initialize the mixin bindings configuration
|
34
|
+
#
|
35
|
+
def self.configure
|
36
|
+
@configure ||= begin
|
37
|
+
namespace = ["Google", "Cloud", "Speech"]
|
38
|
+
parent_config = while namespace.any?
|
39
|
+
parent_name = namespace.join "::"
|
40
|
+
parent_const = const_get parent_name
|
41
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
42
|
+
namespace.pop
|
43
|
+
end
|
44
|
+
|
45
|
+
default_config = Configuration.new parent_config
|
46
|
+
default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [
|
47
|
+
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
|
48
|
+
uri_method: :get,
|
49
|
+
uri_template: "/v2/{name}",
|
50
|
+
matches: [
|
51
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
|
52
|
+
],
|
53
|
+
body: nil
|
54
|
+
)
|
55
|
+
]
|
56
|
+
default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
|
57
|
+
|
58
|
+
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
|
59
|
+
uri_method: :get,
|
60
|
+
uri_template: "/v2/{name}/locations",
|
61
|
+
matches: [
|
62
|
+
["name", %r{^projects/[^/]+/?$}, false]
|
63
|
+
],
|
64
|
+
body: nil
|
65
|
+
)
|
66
|
+
]
|
67
|
+
default_config
|
68
|
+
end
|
69
|
+
yield @configure if block_given?
|
70
|
+
@configure
|
71
|
+
end
|
72
|
+
|
73
|
+
##
|
74
|
+
# @private
|
75
|
+
# Configuration class for the google.cloud.speech.v2 package.
|
76
|
+
#
|
77
|
+
# This class contains common configuration for all services
|
78
|
+
# of the google.cloud.speech.v2 package.
|
79
|
+
#
|
80
|
+
# This configuration is for internal use of the client library classes,
|
81
|
+
# and it is not intended that the end-users will read or change it.
|
82
|
+
#
|
83
|
+
class Configuration
|
84
|
+
extend ::Gapic::Config
|
85
|
+
|
86
|
+
# @private
|
87
|
+
# Overrides for http bindings for the RPC of the mixins for this package.
|
88
|
+
# Services in this package should use these when creating clients for the mixin services.
|
89
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
90
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
91
|
+
|
92
|
+
# @private
|
93
|
+
def initialize parent_config = nil
|
94
|
+
@parent_config = parent_config unless parent_config.nil?
|
95
|
+
|
96
|
+
yield self if block_given?
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -211,13 +211,37 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
211
211
|
optional :config, :message, 4, "google.cloud.speech.v2.RecognitionConfig"
|
212
212
|
optional :config_mask, :message, 5, "google.protobuf.FieldMask"
|
213
213
|
repeated :files, :message, 3, "google.cloud.speech.v2.BatchRecognizeFileMetadata"
|
214
|
+
optional :recognition_output_config, :message, 6, "google.cloud.speech.v2.RecognitionOutputConfig"
|
215
|
+
optional :processing_strategy, :enum, 7, "google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy"
|
216
|
+
end
|
217
|
+
add_enum "google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy" do
|
218
|
+
value :PROCESSING_STRATEGY_UNSPECIFIED, 0
|
219
|
+
value :DYNAMIC_BATCHING, 1
|
220
|
+
end
|
221
|
+
add_message "google.cloud.speech.v2.GcsOutputConfig" do
|
222
|
+
optional :uri, :string, 1
|
223
|
+
end
|
224
|
+
add_message "google.cloud.speech.v2.InlineOutputConfig" do
|
225
|
+
end
|
226
|
+
add_message "google.cloud.speech.v2.RecognitionOutputConfig" do
|
227
|
+
oneof :output do
|
228
|
+
optional :gcs_output_config, :message, 1, "google.cloud.speech.v2.GcsOutputConfig"
|
229
|
+
optional :inline_response_config, :message, 2, "google.cloud.speech.v2.InlineOutputConfig"
|
230
|
+
end
|
214
231
|
end
|
215
232
|
add_message "google.cloud.speech.v2.BatchRecognizeResponse" do
|
216
233
|
map :results, :string, :message, 1, "google.cloud.speech.v2.BatchRecognizeFileResult"
|
234
|
+
optional :total_billed_duration, :message, 2, "google.protobuf.Duration"
|
235
|
+
end
|
236
|
+
add_message "google.cloud.speech.v2.BatchRecognizeResults" do
|
237
|
+
repeated :results, :message, 1, "google.cloud.speech.v2.SpeechRecognitionResult"
|
238
|
+
optional :metadata, :message, 2, "google.cloud.speech.v2.RecognitionResponseMetadata"
|
217
239
|
end
|
218
240
|
add_message "google.cloud.speech.v2.BatchRecognizeFileResult" do
|
219
241
|
optional :uri, :string, 1
|
220
242
|
optional :error, :message, 2, "google.rpc.Status"
|
243
|
+
optional :metadata, :message, 3, "google.cloud.speech.v2.RecognitionResponseMetadata"
|
244
|
+
optional :transcript, :message, 4, "google.cloud.speech.v2.BatchRecognizeResults"
|
221
245
|
end
|
222
246
|
add_message "google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata" do
|
223
247
|
optional :progress_percent, :int32, 1
|
@@ -423,7 +447,12 @@ module Google
|
|
423
447
|
StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionConfig").msgclass
|
424
448
|
StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeRequest").msgclass
|
425
449
|
BatchRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest").msgclass
|
450
|
+
BatchRecognizeRequest::ProcessingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest.ProcessingStrategy").enummodule
|
451
|
+
GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GcsOutputConfig").msgclass
|
452
|
+
InlineOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineOutputConfig").msgclass
|
453
|
+
RecognitionOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionOutputConfig").msgclass
|
426
454
|
BatchRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResponse").msgclass
|
455
|
+
BatchRecognizeResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResults").msgclass
|
427
456
|
BatchRecognizeFileResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileResult").msgclass
|
428
457
|
BatchRecognizeTranscriptionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata").msgclass
|
429
458
|
BatchRecognizeMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeMetadata").msgclass
|
@@ -39,7 +39,7 @@ module Google
|
|
39
39
|
rpc :ListRecognizers, ::Google::Cloud::Speech::V2::ListRecognizersRequest, ::Google::Cloud::Speech::V2::ListRecognizersResponse
|
40
40
|
# Returns the requested
|
41
41
|
# [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
|
42
|
-
# [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested
|
42
|
+
# [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
|
43
43
|
# exist.
|
44
44
|
rpc :GetRecognizer, ::Google::Cloud::Speech::V2::GetRecognizerRequest, ::Google::Cloud::Speech::V2::Recognizer
|
45
45
|
# Updates the [Recognizer][google.cloud.speech.v2.Recognizer].
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/speech/v2/cloud_speech_pb"
|
21
|
+
require "google/cloud/location"
|
21
22
|
|
22
23
|
module Google
|
23
24
|
module Cloud
|
@@ -144,6 +145,12 @@ module Google
|
|
144
145
|
config.endpoint = @config.endpoint
|
145
146
|
end
|
146
147
|
|
148
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
149
|
+
config.credentials = credentials
|
150
|
+
config.quota_project = @quota_project_id
|
151
|
+
config.endpoint = @config.endpoint
|
152
|
+
end
|
153
|
+
|
147
154
|
@speech_stub = ::Gapic::ServiceStub.new(
|
148
155
|
::Google::Cloud::Speech::V2::Speech::Stub,
|
149
156
|
credentials: credentials,
|
@@ -160,6 +167,13 @@ module Google
|
|
160
167
|
#
|
161
168
|
attr_reader :operations_client
|
162
169
|
|
170
|
+
##
|
171
|
+
# Get the associated client for mix-in of the Locations.
|
172
|
+
#
|
173
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
174
|
+
#
|
175
|
+
attr_reader :location_client
|
176
|
+
|
163
177
|
# Service calls
|
164
178
|
|
165
179
|
##
|
@@ -290,8 +304,8 @@ module Google
|
|
290
304
|
# format is `projects/{project}/locations/{location}`.
|
291
305
|
# @param page_size [::Integer]
|
292
306
|
# The maximum number of Recognizers to return. The service may return fewer
|
293
|
-
# than this value. If unspecified, at most
|
294
|
-
# The maximum value is
|
307
|
+
# than this value. If unspecified, at most 5 Recognizers will be returned.
|
308
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
295
309
|
# @param page_token [::String]
|
296
310
|
# A page token, received from a previous
|
297
311
|
# {::Google::Cloud::Speech::V2::Speech::Client#list_recognizers ListRecognizers} call.
|
@@ -375,7 +389,7 @@ module Google
|
|
375
389
|
##
|
376
390
|
# Returns the requested
|
377
391
|
# {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with
|
378
|
-
# [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested
|
392
|
+
# [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
|
379
393
|
# exist.
|
380
394
|
#
|
381
395
|
# @overload get_recognizer(request, options = nil)
|
@@ -985,7 +999,7 @@ module Google
|
|
985
999
|
# @param options [::Gapic::CallOptions, ::Hash]
|
986
1000
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
987
1001
|
#
|
988
|
-
# @overload batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil)
|
1002
|
+
# @overload batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil)
|
989
1003
|
# Pass arguments to `batch_recognize` via keyword arguments. Note that at
|
990
1004
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
991
1005
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -1015,6 +1029,11 @@ module Google
|
|
1015
1029
|
# request.
|
1016
1030
|
# @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>]
|
1017
1031
|
# Audio files with file metadata for ASR.
|
1032
|
+
# The maximum number of files allowed to be specified is 5.
|
1033
|
+
# @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash]
|
1034
|
+
# Configuration options for where to output the transcripts of each file.
|
1035
|
+
# @param processing_strategy [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy]
|
1036
|
+
# Processing strategy to use for this request.
|
1018
1037
|
#
|
1019
1038
|
# @yield [response, operation] Access the result along with the RPC operation
|
1020
1039
|
# @yieldparam response [::Gapic::Operation]
|
@@ -1392,10 +1411,10 @@ module Google
|
|
1392
1411
|
# Required. The project and location of CustomClass resources to list. The
|
1393
1412
|
# expected format is `projects/{project}/locations/{location}`.
|
1394
1413
|
# @param page_size [::Integer]
|
1395
|
-
# Number of results per requests. A valid page_size ranges from 0 to
|
1414
|
+
# Number of results per requests. A valid page_size ranges from 0 to 100
|
1396
1415
|
# inclusive. If the page_size is zero or unspecified, a page size of 5 will
|
1397
|
-
# be chosen. If the page size exceeds
|
1398
|
-
# that a call might return fewer results than the requested page size.
|
1416
|
+
# be chosen. If the page size exceeds 100, it will be coerced down to 100.
|
1417
|
+
# Note that a call might return fewer results than the requested page size.
|
1399
1418
|
# @param page_token [::String]
|
1400
1419
|
# A page token, received from a previous
|
1401
1420
|
# {::Google::Cloud::Speech::V2::Speech::Client#list_custom_classes ListCustomClasses} call.
|
@@ -2001,8 +2020,8 @@ module Google
|
|
2001
2020
|
# expected format is `projects/{project}/locations/{location}`.
|
2002
2021
|
# @param page_size [::Integer]
|
2003
2022
|
# The maximum number of PhraseSets to return. The service may return fewer
|
2004
|
-
# than this value. If unspecified, at most
|
2005
|
-
# The maximum value is
|
2023
|
+
# than this value. If unspecified, at most 5 PhraseSets will be returned.
|
2024
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
2006
2025
|
# @param page_token [::String]
|
2007
2026
|
# A page token, received from a previous
|
2008
2027
|
# {::Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets ListPhraseSets} call.
|
@@ -2515,9 +2534,9 @@ module Google
|
|
2515
2534
|
# * (`String`) The path to a service account key file in JSON format
|
2516
2535
|
# * (`Hash`) A service account key as a Hash
|
2517
2536
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
2518
|
-
# (see the [googleauth docs](https://
|
2537
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
2519
2538
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
2520
|
-
# (see the [signet docs](https://
|
2539
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
2521
2540
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
2522
2541
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
2523
2542
|
# * (`nil`) indicating no credentials
|
@@ -620,9 +620,9 @@ module Google
|
|
620
620
|
# * (`String`) The path to a service account key file in JSON format
|
621
621
|
# * (`Hash`) A service account key as a Hash
|
622
622
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
623
|
-
# (see the [googleauth docs](https://
|
623
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
624
624
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
625
|
-
# (see the [signet docs](https://
|
625
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
626
626
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
627
627
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
628
628
|
# * (`nil`) indicating no credentials
|
@@ -19,6 +19,7 @@
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/speech/v2/cloud_speech_pb"
|
21
21
|
require "google/cloud/speech/v2/speech/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
22
23
|
|
23
24
|
module Google
|
24
25
|
module Cloud
|
@@ -141,6 +142,13 @@ module Google
|
|
141
142
|
config.endpoint = @config.endpoint
|
142
143
|
end
|
143
144
|
|
145
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
146
|
+
config.credentials = credentials
|
147
|
+
config.quota_project = @quota_project_id
|
148
|
+
config.endpoint = @config.endpoint
|
149
|
+
config.bindings_override = @config.bindings_override
|
150
|
+
end
|
151
|
+
|
144
152
|
@speech_stub = ::Google::Cloud::Speech::V2::Speech::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
|
145
153
|
end
|
146
154
|
|
@@ -151,6 +159,13 @@ module Google
|
|
151
159
|
#
|
152
160
|
attr_reader :operations_client
|
153
161
|
|
162
|
+
##
|
163
|
+
# Get the associated client for mix-in of the Locations.
|
164
|
+
#
|
165
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
166
|
+
#
|
167
|
+
attr_reader :location_client
|
168
|
+
|
154
169
|
# Service calls
|
155
170
|
|
156
171
|
##
|
@@ -251,8 +266,8 @@ module Google
|
|
251
266
|
# format is `projects/{project}/locations/{location}`.
|
252
267
|
# @param page_size [::Integer]
|
253
268
|
# The maximum number of Recognizers to return. The service may return fewer
|
254
|
-
# than this value. If unspecified, at most
|
255
|
-
# The maximum value is
|
269
|
+
# than this value. If unspecified, at most 5 Recognizers will be returned.
|
270
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
256
271
|
# @param page_token [::String]
|
257
272
|
# A page token, received from a previous
|
258
273
|
# {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_recognizers ListRecognizers} call.
|
@@ -309,7 +324,7 @@ module Google
|
|
309
324
|
##
|
310
325
|
# Returns the requested
|
311
326
|
# {::Google::Cloud::Speech::V2::Recognizer Recognizer}. Fails with
|
312
|
-
# [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested
|
327
|
+
# [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
|
313
328
|
# exist.
|
314
329
|
#
|
315
330
|
# @overload get_recognizer(request, options = nil)
|
@@ -704,7 +719,7 @@ module Google
|
|
704
719
|
# @param options [::Gapic::CallOptions, ::Hash]
|
705
720
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
706
721
|
#
|
707
|
-
# @overload batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil)
|
722
|
+
# @overload batch_recognize(recognizer: nil, config: nil, config_mask: nil, files: nil, recognition_output_config: nil, processing_strategy: nil)
|
708
723
|
# Pass arguments to `batch_recognize` via keyword arguments. Note that at
|
709
724
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
710
725
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -734,6 +749,11 @@ module Google
|
|
734
749
|
# request.
|
735
750
|
# @param files [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata, ::Hash>]
|
736
751
|
# Audio files with file metadata for ASR.
|
752
|
+
# The maximum number of files allowed to be specified is 5.
|
753
|
+
# @param recognition_output_config [::Google::Cloud::Speech::V2::RecognitionOutputConfig, ::Hash]
|
754
|
+
# Configuration options for where to output the transcripts of each file.
|
755
|
+
# @param processing_strategy [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy]
|
756
|
+
# Processing strategy to use for this request.
|
737
757
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
738
758
|
# @yieldparam result [::Gapic::Operation]
|
739
759
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1005,10 +1025,10 @@ module Google
|
|
1005
1025
|
# Required. The project and location of CustomClass resources to list. The
|
1006
1026
|
# expected format is `projects/{project}/locations/{location}`.
|
1007
1027
|
# @param page_size [::Integer]
|
1008
|
-
# Number of results per requests. A valid page_size ranges from 0 to
|
1028
|
+
# Number of results per requests. A valid page_size ranges from 0 to 100
|
1009
1029
|
# inclusive. If the page_size is zero or unspecified, a page size of 5 will
|
1010
|
-
# be chosen. If the page size exceeds
|
1011
|
-
# that a call might return fewer results than the requested page size.
|
1030
|
+
# be chosen. If the page size exceeds 100, it will be coerced down to 100.
|
1031
|
+
# Note that a call might return fewer results than the requested page size.
|
1012
1032
|
# @param page_token [::String]
|
1013
1033
|
# A page token, received from a previous
|
1014
1034
|
# {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_custom_classes ListCustomClasses} call.
|
@@ -1444,8 +1464,8 @@ module Google
|
|
1444
1464
|
# expected format is `projects/{project}/locations/{location}`.
|
1445
1465
|
# @param page_size [::Integer]
|
1446
1466
|
# The maximum number of PhraseSets to return. The service may return fewer
|
1447
|
-
# than this value. If unspecified, at most
|
1448
|
-
# The maximum value is
|
1467
|
+
# than this value. If unspecified, at most 5 PhraseSets will be returned.
|
1468
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
1449
1469
|
# @param page_token [::String]
|
1450
1470
|
# A page token, received from a previous
|
1451
1471
|
# {::Google::Cloud::Speech::V2::Speech::Rest::Client#list_phrase_sets ListPhraseSets} call.
|
@@ -1818,9 +1838,9 @@ module Google
|
|
1818
1838
|
# * (`String`) The path to a service account key file in JSON format
|
1819
1839
|
# * (`Hash`) A service account key as a Hash
|
1820
1840
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
1821
|
-
# (see the [googleauth docs](https://
|
1841
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
1822
1842
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1823
|
-
# (see the [signet docs](https://
|
1843
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1824
1844
|
# * (`nil`) indicating no credentials
|
1825
1845
|
# @return [::Object]
|
1826
1846
|
# @!attribute [rw] scope
|
@@ -1866,6 +1886,13 @@ module Google
|
|
1866
1886
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1867
1887
|
config_attr :quota_project, nil, ::String, nil
|
1868
1888
|
|
1889
|
+
# @private
|
1890
|
+
# Overrides for http bindings for the RPCs of this service
|
1891
|
+
# are only used when this service is used as mixin, and only
|
1892
|
+
# by the host service.
|
1893
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1894
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
1895
|
+
|
1869
1896
|
# @private
|
1870
1897
|
def initialize parent_config = nil
|
1871
1898
|
@parent_config = parent_config unless parent_config.nil?
|
@@ -411,9 +411,9 @@ module Google
|
|
411
411
|
# * (`String`) The path to a service account key file in JSON format
|
412
412
|
# * (`Hash`) A service account key as a Hash
|
413
413
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
414
|
-
# (see the [googleauth docs](https://
|
414
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
415
415
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
416
|
-
# (see the [signet docs](https://
|
416
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
417
417
|
# * (`nil`) indicating no credentials
|
418
418
|
# @return [::Object]
|
419
419
|
# @!attribute [rw] scope
|
@@ -21,6 +21,7 @@ require "gapic/config"
|
|
21
21
|
require "gapic/config/method"
|
22
22
|
|
23
23
|
require "google/cloud/speech/v2/version"
|
24
|
+
require "google/cloud/speech/v2/bindings_override"
|
24
25
|
|
25
26
|
require "google/cloud/speech/v2/speech/credentials"
|
26
27
|
require "google/cloud/speech/v2/speech/paths"
|
@@ -35,7 +35,9 @@ module Google
|
|
35
35
|
# Details about how and where to publish client libraries.
|
36
36
|
# @!attribute [rw] version
|
37
37
|
# @return [::String]
|
38
|
-
# Version of the API to apply these settings to.
|
38
|
+
# Version of the API to apply these settings to. This is the full protobuf
|
39
|
+
# package for the API, ending in the version element.
|
40
|
+
# Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1".
|
39
41
|
# @!attribute [rw] launch_stage
|
40
42
|
# @return [::Google::Api::LaunchStage]
|
41
43
|
# Launch stage of this version of the API.
|
@@ -81,7 +83,7 @@ module Google
|
|
81
83
|
# long-running operation pattern.
|
82
84
|
# @!attribute [rw] new_issue_uri
|
83
85
|
# @return [::String]
|
84
|
-
# Link to a
|
86
|
+
# Link to a *public* URI where users can report issues. Example:
|
85
87
|
# https://issuetracker.google.com/issues/new?component=190865&template=1161103
|
86
88
|
# @!attribute [rw] documentation_uri
|
87
89
|
# @return [::String]
|
@@ -111,6 +113,10 @@ module Google
|
|
111
113
|
# Client library settings. If the same version string appears multiple
|
112
114
|
# times in this list, then the last one wins. Settings from earlier
|
113
115
|
# settings with the same version string are discarded.
|
116
|
+
# @!attribute [rw] proto_reference_documentation_uri
|
117
|
+
# @return [::String]
|
118
|
+
# Optional link to proto reference documentation. Example:
|
119
|
+
# https://cloud.google.com/pubsub/lite/docs/reference/rpc
|
114
120
|
class Publishing
|
115
121
|
include ::Google::Protobuf::MessageExts
|
116
122
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -203,9 +209,57 @@ module Google
|
|
203
209
|
# @!attribute [rw] common
|
204
210
|
# @return [::Google::Api::CommonLanguageSettings]
|
205
211
|
# Some settings.
|
212
|
+
# @!attribute [rw] renamed_services
|
213
|
+
# @return [::Google::Protobuf::Map{::String => ::String}]
|
214
|
+
# Map from original service names to renamed versions.
|
215
|
+
# This is used when the default generated types
|
216
|
+
# would cause a naming conflict. (Neither name is
|
217
|
+
# fully-qualified.)
|
218
|
+
# Example: Subscriber to SubscriberServiceApi.
|
219
|
+
# @!attribute [rw] renamed_resources
|
220
|
+
# @return [::Google::Protobuf::Map{::String => ::String}]
|
221
|
+
# Map from full resource types to the effective short name
|
222
|
+
# for the resource. This is used when otherwise resource
|
223
|
+
# named from different services would cause naming collisions.
|
224
|
+
# Example entry:
|
225
|
+
# "datalabeling.googleapis.com/Dataset": "DataLabelingDataset"
|
226
|
+
# @!attribute [rw] ignored_resources
|
227
|
+
# @return [::Array<::String>]
|
228
|
+
# List of full resource types to ignore during generation.
|
229
|
+
# This is typically used for API-specific Location resources,
|
230
|
+
# which should be handled by the generator as if they were actually
|
231
|
+
# the common Location resources.
|
232
|
+
# Example entry: "documentai.googleapis.com/Location"
|
233
|
+
# @!attribute [rw] forced_namespace_aliases
|
234
|
+
# @return [::Array<::String>]
|
235
|
+
# Namespaces which must be aliased in snippets due to
|
236
|
+
# a known (but non-generator-predictable) naming collision
|
237
|
+
# @!attribute [rw] handwritten_signatures
|
238
|
+
# @return [::Array<::String>]
|
239
|
+
# Method signatures (in the form "service.method(signature)")
|
240
|
+
# which are provided separately, so shouldn't be generated.
|
241
|
+
# Snippets *calling* these methods are still generated, however.
|
206
242
|
class DotnetSettings
|
207
243
|
include ::Google::Protobuf::MessageExts
|
208
244
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
245
|
+
|
246
|
+
# @!attribute [rw] key
|
247
|
+
# @return [::String]
|
248
|
+
# @!attribute [rw] value
|
249
|
+
# @return [::String]
|
250
|
+
class RenamedServicesEntry
|
251
|
+
include ::Google::Protobuf::MessageExts
|
252
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
253
|
+
end
|
254
|
+
|
255
|
+
# @!attribute [rw] key
|
256
|
+
# @return [::String]
|
257
|
+
# @!attribute [rw] value
|
258
|
+
# @return [::String]
|
259
|
+
class RenamedResourcesEntry
|
260
|
+
include ::Google::Protobuf::MessageExts
|
261
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
262
|
+
end
|
209
263
|
end
|
210
264
|
|
211
265
|
# Settings for Ruby client libraries.
|
@@ -240,8 +294,8 @@ module Google
|
|
240
294
|
# Example of a YAML configuration::
|
241
295
|
#
|
242
296
|
# publishing:
|
243
|
-
#
|
244
|
-
# - selector:
|
297
|
+
# method_settings:
|
298
|
+
# - selector: google.cloud.speech.v2.Speech.BatchRecognize
|
245
299
|
# long_running:
|
246
300
|
# initial_poll_delay:
|
247
301
|
# seconds: 60 # 1 minute
|
@@ -299,6 +353,15 @@ module Google
|
|
299
353
|
|
300
354
|
# Street View Org.
|
301
355
|
STREET_VIEW = 4
|
356
|
+
|
357
|
+
# Shopping Org.
|
358
|
+
SHOPPING = 5
|
359
|
+
|
360
|
+
# Geo Org.
|
361
|
+
GEO = 6
|
362
|
+
|
363
|
+
# Generative AI - https://developers.generativeai.google
|
364
|
+
GENERATIVE_AI = 7
|
302
365
|
end
|
303
366
|
|
304
367
|
# To where should client libraries be published?
|
@@ -134,8 +134,8 @@ module Google
|
|
134
134
|
# @!attribute [rw] page_size
|
135
135
|
# @return [::Integer]
|
136
136
|
# The maximum number of Recognizers to return. The service may return fewer
|
137
|
-
# than this value. If unspecified, at most
|
138
|
-
# The maximum value is
|
137
|
+
# than this value. If unspecified, at most 5 Recognizers will be returned.
|
138
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
139
139
|
# @!attribute [rw] page_token
|
140
140
|
# @return [::String]
|
141
141
|
# A page token, received from a previous
|
@@ -263,34 +263,19 @@ module Google
|
|
263
263
|
# Required. Which model to use for recognition requests. Select the model
|
264
264
|
# best suited to your domain to get best results.
|
265
265
|
#
|
266
|
-
#
|
267
|
-
#
|
268
|
-
# -
|
269
|
-
#
|
270
|
-
#
|
271
|
-
#
|
272
|
-
# - `latest_short`
|
273
|
-
#
|
274
|
-
# Best for short form content like commands or single shot directed speech.
|
275
|
-
# When using this model, the service will stop transcribing audio after the
|
276
|
-
# first utterance is detected and completed.
|
277
|
-
#
|
278
|
-
# When using this model,
|
279
|
-
# {::Google::Cloud::Speech::V2::RecognitionFeatures::MultiChannelMode::SEPARATE_RECOGNITION_PER_CHANNEL SEPARATE_RECOGNITION_PER_CHANNEL}
|
280
|
-
# is not supported; multi-channel audio is accepted, but only the first
|
281
|
-
# channel will be processed and transcribed.
|
266
|
+
# Guidance for choosing which model to use can be found in the [Transcription
|
267
|
+
# Models
|
268
|
+
# Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model)
|
269
|
+
# and the models supported in each region can be found in the [Table Of
|
270
|
+
# Supported
|
271
|
+
# Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
|
282
272
|
# @!attribute [rw] language_codes
|
283
273
|
# @return [::Array<::String>]
|
284
274
|
# Required. The language of the supplied audio as a
|
285
275
|
# [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
|
286
276
|
#
|
287
|
-
# Supported languages
|
288
|
-
#
|
289
|
-
# - `en-US`
|
290
|
-
#
|
291
|
-
# - `en-GB`
|
292
|
-
#
|
293
|
-
# - `fr-FR`
|
277
|
+
# Supported languages for each model are listed in the [Table of Supported
|
278
|
+
# Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
|
294
279
|
#
|
295
280
|
# If additional languages are provided, recognition result will contain
|
296
281
|
# recognition in the most likely language detected. The recognition result
|
@@ -373,14 +358,23 @@ module Google
|
|
373
358
|
|
374
359
|
# Automatically detected decoding parameters.
|
375
360
|
# Supported for the following encodings:
|
361
|
+
#
|
376
362
|
# * WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container.
|
363
|
+
#
|
377
364
|
# * WAV_MULAW: 8-bit companded mulaw samples in a WAV container.
|
365
|
+
#
|
378
366
|
# * WAV_ALAW: 8-bit companded alaw samples in a WAV container.
|
367
|
+
#
|
379
368
|
# * RFC4867_5_AMR: AMR frames with an rfc4867.5 header.
|
369
|
+
#
|
380
370
|
# * RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header.
|
371
|
+
#
|
381
372
|
# * FLAC: FLAC frames in the "native FLAC" container format.
|
373
|
+
#
|
382
374
|
# * MP3: MPEG audio frames with optional (ignored) ID3 metadata.
|
375
|
+
#
|
383
376
|
# * OGG_OPUS: Opus audio frames in an Ogg container.
|
377
|
+
#
|
384
378
|
# * WEBM_OPUS: Opus audio frames in a WebM container.
|
385
379
|
class AutoDetectDecodingConfig
|
386
380
|
include ::Google::Protobuf::MessageExts
|
@@ -398,16 +392,24 @@ module Google
|
|
398
392
|
# sampling rate of the audio source to 16000 Hz. If that's not possible, use
|
399
393
|
# the native sample rate of the audio source (instead of re-sampling).
|
400
394
|
# Supported for the following encodings:
|
395
|
+
#
|
401
396
|
# * LINEAR16: Headerless 16-bit signed little-endian PCM samples.
|
397
|
+
#
|
402
398
|
# * MULAW: Headerless 8-bit companded mulaw samples.
|
399
|
+
#
|
403
400
|
# * ALAW: Headerless 8-bit companded alaw samples.
|
404
401
|
# @!attribute [rw] audio_channel_count
|
405
402
|
# @return [::Integer]
|
406
403
|
# Number of channels present in the audio data sent for recognition.
|
407
404
|
# Supported for the following encodings:
|
405
|
+
#
|
408
406
|
# * LINEAR16: Headerless 16-bit signed little-endian PCM samples.
|
407
|
+
#
|
409
408
|
# * MULAW: Headerless 8-bit companded mulaw samples.
|
409
|
+
#
|
410
410
|
# * ALAW: Headerless 8-bit companded alaw samples.
|
411
|
+
#
|
412
|
+
# The maximum allowed value is 8.
|
411
413
|
class ExplicitDecodingConfig
|
412
414
|
include ::Google::Protobuf::MessageExts
|
413
415
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -433,7 +435,7 @@ module Google
|
|
433
435
|
# @return [::Integer]
|
434
436
|
# Required. Minimum number of speakers in the conversation. This range gives
|
435
437
|
# you more flexibility by allowing the system to automatically determine the
|
436
|
-
# correct number of speakers.
|
438
|
+
# correct number of speakers.
|
437
439
|
#
|
438
440
|
# To fix the number of speakers detected in the audio, set
|
439
441
|
# `min_speaker_count` = `max_speaker_count`.
|
@@ -521,28 +523,28 @@ module Google
|
|
521
523
|
end
|
522
524
|
|
523
525
|
# Provides "hints" to the speech recognizer to favor specific words and phrases
|
524
|
-
# in the results.
|
525
|
-
# reference to an existing
|
526
|
+
# in the results. PhraseSets can be specified as an inline resource, or a
|
527
|
+
# reference to an existing PhraseSet resource.
|
526
528
|
# @!attribute [rw] phrase_sets
|
527
529
|
# @return [::Array<::Google::Cloud::Speech::V2::SpeechAdaptation::AdaptationPhraseSet>]
|
528
|
-
# A list of inline or referenced
|
530
|
+
# A list of inline or referenced PhraseSets.
|
529
531
|
# @!attribute [rw] custom_classes
|
530
532
|
# @return [::Array<::Google::Cloud::Speech::V2::CustomClass>]
|
531
|
-
# A list of inline
|
532
|
-
# referenced directly in a
|
533
|
+
# A list of inline CustomClasses. Existing CustomClass resources can be
|
534
|
+
# referenced directly in a PhraseSet.
|
533
535
|
class SpeechAdaptation
|
534
536
|
include ::Google::Protobuf::MessageExts
|
535
537
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
536
538
|
|
537
|
-
# A biasing
|
538
|
-
# an existing
|
539
|
+
# A biasing PhraseSet, which can be either a string referencing the name of
|
540
|
+
# an existing PhraseSets resource, or an inline definition of a PhraseSet.
|
539
541
|
# @!attribute [rw] phrase_set
|
540
542
|
# @return [::String]
|
541
|
-
# The name of an existing
|
543
|
+
# The name of an existing PhraseSet resource. The user must have read
|
542
544
|
# access to the resource and it must not be deleted.
|
543
545
|
# @!attribute [rw] inline_phrase_set
|
544
546
|
# @return [::Google::Cloud::Speech::V2::PhraseSet]
|
545
|
-
# An inline defined
|
547
|
+
# An inline defined PhraseSet.
|
546
548
|
class AdaptationPhraseSet
|
547
549
|
include ::Google::Protobuf::MessageExts
|
548
550
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -651,9 +653,9 @@ module Google
|
|
651
653
|
# @!attribute [rw] words
|
652
654
|
# @return [::Array<::Google::Cloud::Speech::V2::WordInfo>]
|
653
655
|
# A list of word-specific information for each recognized word.
|
654
|
-
# When
|
655
|
-
#
|
656
|
-
# is
|
656
|
+
# When the
|
657
|
+
# {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig}
|
658
|
+
# is set, you will see all the words from the beginning of the audio.
|
657
659
|
class SpeechRecognitionAlternative
|
658
660
|
include ::Google::Protobuf::MessageExts
|
659
661
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -694,8 +696,8 @@ module Google
|
|
694
696
|
# A distinct label is assigned for every speaker within the audio. This field
|
695
697
|
# specifies which one of those speakers was detected to have spoken this
|
696
698
|
# word. `speaker_label` is set if
|
697
|
-
#
|
698
|
-
# is
|
699
|
+
# {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig}
|
700
|
+
# is given and only in the top alternative.
|
699
701
|
class WordInfo
|
700
702
|
include ::Google::Protobuf::MessageExts
|
701
703
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -795,9 +797,9 @@ module Google
|
|
795
797
|
# of the recognizer during this recognition request. If no mask is provided,
|
796
798
|
# all non-default valued fields in
|
797
799
|
# {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} override
|
798
|
-
# the values in the
|
800
|
+
# the values in the Recognizer for this recognition request. If a mask is
|
799
801
|
# provided, only the fields listed in the mask override the config in the
|
800
|
-
#
|
802
|
+
# Recognizer for this recognition request. If a wildcard (`*`) is provided,
|
801
803
|
# {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config}
|
802
804
|
# completely overrides and replaces the config in the recognizer for this
|
803
805
|
# recognition request.
|
@@ -841,6 +843,7 @@ module Google
|
|
841
843
|
# @!attribute [rw] audio
|
842
844
|
# @return [::String]
|
843
845
|
# Inline audio bytes to be Recognized.
|
846
|
+
# Maximum size for this field is 15 KB per request.
|
844
847
|
class StreamingRecognizeRequest
|
845
848
|
include ::Google::Protobuf::MessageExts
|
846
849
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -878,9 +881,60 @@ module Google
|
|
878
881
|
# @!attribute [rw] files
|
879
882
|
# @return [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata>]
|
880
883
|
# Audio files with file metadata for ASR.
|
884
|
+
# The maximum number of files allowed to be specified is 5.
|
885
|
+
# @!attribute [rw] recognition_output_config
|
886
|
+
# @return [::Google::Cloud::Speech::V2::RecognitionOutputConfig]
|
887
|
+
# Configuration options for where to output the transcripts of each file.
|
888
|
+
# @!attribute [rw] processing_strategy
|
889
|
+
# @return [::Google::Cloud::Speech::V2::BatchRecognizeRequest::ProcessingStrategy]
|
890
|
+
# Processing strategy to use for this request.
|
881
891
|
class BatchRecognizeRequest
|
882
892
|
include ::Google::Protobuf::MessageExts
|
883
893
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
894
|
+
|
895
|
+
# Possible processing strategies for batch requests.
|
896
|
+
module ProcessingStrategy
|
897
|
+
# Default value for the processing strategy. The request is processed as
|
898
|
+
# soon as its received.
|
899
|
+
PROCESSING_STRATEGY_UNSPECIFIED = 0
|
900
|
+
|
901
|
+
# If selected, processes the request during lower utilization periods for a
|
902
|
+
# price discount. The request is fulfilled within 24 hours.
|
903
|
+
DYNAMIC_BATCHING = 1
|
904
|
+
end
|
905
|
+
end
|
906
|
+
|
907
|
+
# Output configurations for Cloud Storage.
|
908
|
+
# @!attribute [rw] uri
|
909
|
+
# @return [::String]
|
910
|
+
# The Cloud Storage URI prefix with which recognition results will be
|
911
|
+
# written.
|
912
|
+
class GcsOutputConfig
|
913
|
+
include ::Google::Protobuf::MessageExts
|
914
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
915
|
+
end
|
916
|
+
|
917
|
+
# Output configurations for inline response.
|
918
|
+
class InlineOutputConfig
|
919
|
+
include ::Google::Protobuf::MessageExts
|
920
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
921
|
+
end
|
922
|
+
|
923
|
+
# Configuration options for the output(s) of recognition.
|
924
|
+
# @!attribute [rw] gcs_output_config
|
925
|
+
# @return [::Google::Cloud::Speech::V2::GcsOutputConfig]
|
926
|
+
# If this message is populated, recognition results are written to the
|
927
|
+
# provided Google Cloud Storage URI.
|
928
|
+
# @!attribute [rw] inline_response_config
|
929
|
+
# @return [::Google::Cloud::Speech::V2::InlineOutputConfig]
|
930
|
+
# If this message is populated, recognition results are provided in the
|
931
|
+
# {::Google::Cloud::Speech::V2::BatchRecognizeResponse BatchRecognizeResponse}
|
932
|
+
# message of the Operation when completed. This is only supported when
|
933
|
+
# calling {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize}
|
934
|
+
# with just one audio file.
|
935
|
+
class RecognitionOutputConfig
|
936
|
+
include ::Google::Protobuf::MessageExts
|
937
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
884
938
|
end
|
885
939
|
|
886
940
|
# Response message for
|
@@ -889,6 +943,9 @@ module Google
|
|
889
943
|
# @!attribute [rw] results
|
890
944
|
# @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeFileResult}]
|
891
945
|
# Map from filename to the final result for that file.
|
946
|
+
# @!attribute [rw] total_billed_duration
|
947
|
+
# @return [::Google::Protobuf::Duration]
|
948
|
+
# When available, billed audio seconds for the corresponding request.
|
892
949
|
class BatchRecognizeResponse
|
893
950
|
include ::Google::Protobuf::MessageExts
|
894
951
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -903,13 +960,36 @@ module Google
|
|
903
960
|
end
|
904
961
|
end
|
905
962
|
|
963
|
+
# Output type for Cloud Storage of BatchRecognize transcripts. Though this
|
964
|
+
# proto isn't returned in this API anywhere, the Cloud Storage transcripts will
|
965
|
+
# be this proto serialized and should be parsed as such.
|
966
|
+
# @!attribute [rw] results
|
967
|
+
# @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>]
|
968
|
+
# Sequential list of transcription results corresponding to sequential
|
969
|
+
# portions of audio.
|
970
|
+
# @!attribute [rw] metadata
|
971
|
+
# @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata]
|
972
|
+
# Metadata about the recognition.
|
973
|
+
class BatchRecognizeResults
|
974
|
+
include ::Google::Protobuf::MessageExts
|
975
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
976
|
+
end
|
977
|
+
|
906
978
|
# Final results for a single file.
|
907
979
|
# @!attribute [rw] uri
|
908
980
|
# @return [::String]
|
909
|
-
# The
|
981
|
+
# The Cloud Storage URI to which recognition results were written.
|
910
982
|
# @!attribute [rw] error
|
911
983
|
# @return [::Google::Rpc::Status]
|
912
984
|
# Error if one was encountered.
|
985
|
+
# @!attribute [rw] metadata
|
986
|
+
# @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata]
|
987
|
+
# @!attribute [rw] transcript
|
988
|
+
# @return [::Google::Cloud::Speech::V2::BatchRecognizeResults]
|
989
|
+
# The transcript for the audio file. This is populated only when
|
990
|
+
# {::Google::Cloud::Speech::V2::InlineOutputConfig InlineOutputConfig} is set in
|
991
|
+
# the
|
992
|
+
# [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig].
|
913
993
|
class BatchRecognizeFileResult
|
914
994
|
include ::Google::Protobuf::MessageExts
|
915
995
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -925,7 +1005,7 @@ module Google
|
|
925
1005
|
# Error if one was encountered.
|
926
1006
|
# @!attribute [rw] uri
|
927
1007
|
# @return [::String]
|
928
|
-
# The
|
1008
|
+
# The Cloud Storage URI to which recognition results will be written.
|
929
1009
|
class BatchRecognizeTranscriptionMetadata
|
930
1010
|
include ::Google::Protobuf::MessageExts
|
931
1011
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -1290,7 +1370,8 @@ module Google
|
|
1290
1370
|
# phrase will be recognized over other similar sounding phrases. The higher
|
1291
1371
|
# the boost, the higher the chance of false positive recognition as well.
|
1292
1372
|
# Valid `boost` values are between 0 (exclusive) and 20. We recommend using a
|
1293
|
-
# binary search approach to finding the optimal value for your use case
|
1373
|
+
# binary search approach to finding the optimal value for your use case as
|
1374
|
+
# well as adding phrases both with and without boost to your requests.
|
1294
1375
|
# @!attribute [rw] display_name
|
1295
1376
|
# @return [::String]
|
1296
1377
|
# User-settable, human-readable name for the PhraseSet. Must be 63
|
@@ -1358,11 +1439,11 @@ module Google
|
|
1358
1439
|
# be recognized over other similar sounding phrases. The higher the boost,
|
1359
1440
|
# the higher the chance of false positive recognition as well. Negative
|
1360
1441
|
# boost values would correspond to anti-biasing. Anti-biasing is not
|
1361
|
-
# enabled, so negative boost will
|
1362
|
-
#
|
1363
|
-
#
|
1364
|
-
#
|
1365
|
-
#
|
1442
|
+
# enabled, so negative boost values will return an error. Boost values must
|
1443
|
+
# be between 0 and 20. Any values outside that range will return an error.
|
1444
|
+
# We recommend using a binary search approach to finding the optimal value
|
1445
|
+
# for your use case as well as adding phrases both with and without boost
|
1446
|
+
# to your requests.
|
1366
1447
|
class Phrase
|
1367
1448
|
include ::Google::Protobuf::MessageExts
|
1368
1449
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -1424,10 +1505,10 @@ module Google
|
|
1424
1505
|
# expected format is `projects/{project}/locations/{location}`.
|
1425
1506
|
# @!attribute [rw] page_size
|
1426
1507
|
# @return [::Integer]
|
1427
|
-
# Number of results per requests. A valid page_size ranges from 0 to
|
1508
|
+
# Number of results per requests. A valid page_size ranges from 0 to 100
|
1428
1509
|
# inclusive. If the page_size is zero or unspecified, a page size of 5 will
|
1429
|
-
# be chosen. If the page size exceeds
|
1430
|
-
# that a call might return fewer results than the requested page size.
|
1510
|
+
# be chosen. If the page size exceeds 100, it will be coerced down to 100.
|
1511
|
+
# Note that a call might return fewer results than the requested page size.
|
1431
1512
|
# @!attribute [rw] page_token
|
1432
1513
|
# @return [::String]
|
1433
1514
|
# A page token, received from a previous
|
@@ -1575,8 +1656,8 @@ module Google
|
|
1575
1656
|
# @!attribute [rw] page_size
|
1576
1657
|
# @return [::Integer]
|
1577
1658
|
# The maximum number of PhraseSets to return. The service may return fewer
|
1578
|
-
# than this value. If unspecified, at most
|
1579
|
-
# The maximum value is
|
1659
|
+
# than this value. If unspecified, at most 5 PhraseSets will be returned.
|
1660
|
+
# The maximum value is 100; values above 100 will be coerced to 100.
|
1580
1661
|
# @!attribute [rw] page_token
|
1581
1662
|
# @return [::String]
|
1582
1663
|
# A page token, received from a previous
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-speech-v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.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: 2023-
|
11
|
+
date: 2023-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.18.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.18.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -44,6 +44,26 @@ dependencies:
|
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '1.0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: google-cloud-location
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0.4'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 2.a
|
57
|
+
type: :runtime
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0.4'
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 2.a
|
47
67
|
- !ruby/object:Gem::Dependency
|
48
68
|
name: google-style
|
49
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -175,6 +195,7 @@ files:
|
|
175
195
|
- README.md
|
176
196
|
- lib/google-cloud-speech-v2.rb
|
177
197
|
- lib/google/cloud/speech/v2.rb
|
198
|
+
- lib/google/cloud/speech/v2/bindings_override.rb
|
178
199
|
- lib/google/cloud/speech/v2/cloud_speech_pb.rb
|
179
200
|
- lib/google/cloud/speech/v2/cloud_speech_services_pb.rb
|
180
201
|
- lib/google/cloud/speech/v2/rest.rb
|
@@ -223,5 +244,5 @@ requirements: []
|
|
223
244
|
rubygems_version: 3.4.2
|
224
245
|
signing_key:
|
225
246
|
specification_version: 4
|
226
|
-
summary:
|
247
|
+
summary: Converts audio to text by applying powerful neural network models.
|
227
248
|
test_files: []
|