google-cloud-speech-v2 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf12e4d7b09605a803e9337cf9085e0e83db8d381e0c16de517c8d50dad3d88e
4
- data.tar.gz: 7ff56273fd9befca33be9ebc2e342be9d8c7050f4a2be53c65b0126cb327382b
3
+ metadata.gz: 968563d525eccf954b107c73edfb327cc252d97912a5ca5ee688aa308ccafc04
4
+ data.tar.gz: cbba46b095a9649b5ebcefad32cf7fda937c76f1119e3792ff5e3ef41b49931a
5
5
  SHA512:
6
- metadata.gz: 178fe7e5ce4d79f4f49a0cd64cb296e8afdb6b3507fe934c03369ab20ac7070aa0ef6fef8b81ec08510c69b2730008a42fc9d4a52581d710a68dcc99018f64f2
7
- data.tar.gz: f0789fbd8ef72e18634fc27a4becc2fccba89f17e501399398d8519373e116f6e62bb2522fdce43e5393890f48c60c03aa111ad2810e5a43fa6a48cd94fa3d17
6
+ metadata.gz: 2cd7b6ecdce54170bdc1b7f35f0b0aee18e88a2cf6dc3dc8710bff3239b234a6154071c78a3fd49d8225a3dcfdca5d87aadf3d1c34ed722b1600e565f185f27a
7
+ data.tar.gz: 7e82039c8de923e79efe5e4e3ab8dba62c50db60e0a84b8cc194272b873ccbc0508a419ab6300b9dde3c483e0f17f8e500d64df510e8b4a8b7d6187ac6f5a4c8
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Cloud Speech-to-Text V2 API
2
2
 
3
- API Client library for the Cloud Speech-to-Text V2 API
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://googleapis.dev/ruby/google-cloud-logging/latest)
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,32 @@ 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
+ end
216
+ add_message "google.cloud.speech.v2.GcsOutputConfig" do
217
+ optional :uri, :string, 1
218
+ end
219
+ add_message "google.cloud.speech.v2.InlineOutputConfig" do
220
+ end
221
+ add_message "google.cloud.speech.v2.RecognitionOutputConfig" do
222
+ oneof :output do
223
+ optional :gcs_output_config, :message, 1, "google.cloud.speech.v2.GcsOutputConfig"
224
+ optional :inline_response_config, :message, 2, "google.cloud.speech.v2.InlineOutputConfig"
225
+ end
214
226
  end
215
227
  add_message "google.cloud.speech.v2.BatchRecognizeResponse" do
216
228
  map :results, :string, :message, 1, "google.cloud.speech.v2.BatchRecognizeFileResult"
229
+ optional :total_billed_duration, :message, 2, "google.protobuf.Duration"
230
+ end
231
+ add_message "google.cloud.speech.v2.BatchRecognizeResults" do
232
+ repeated :results, :message, 1, "google.cloud.speech.v2.SpeechRecognitionResult"
233
+ optional :metadata, :message, 2, "google.cloud.speech.v2.RecognitionResponseMetadata"
217
234
  end
218
235
  add_message "google.cloud.speech.v2.BatchRecognizeFileResult" do
219
236
  optional :uri, :string, 1
220
237
  optional :error, :message, 2, "google.rpc.Status"
238
+ optional :metadata, :message, 3, "google.cloud.speech.v2.RecognitionResponseMetadata"
239
+ optional :transcript, :message, 4, "google.cloud.speech.v2.BatchRecognizeResults"
221
240
  end
222
241
  add_message "google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata" do
223
242
  optional :progress_percent, :int32, 1
@@ -423,7 +442,11 @@ module Google
423
442
  StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognitionConfig").msgclass
424
443
  StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.StreamingRecognizeRequest").msgclass
425
444
  BatchRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeRequest").msgclass
445
+ GcsOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.GcsOutputConfig").msgclass
446
+ InlineOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.InlineOutputConfig").msgclass
447
+ RecognitionOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.RecognitionOutputConfig").msgclass
426
448
  BatchRecognizeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResponse").msgclass
449
+ BatchRecognizeResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeResults").msgclass
427
450
  BatchRecognizeFileResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeFileResult").msgclass
428
451
  BatchRecognizeTranscriptionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v2.BatchRecognizeTranscriptionMetadata").msgclass
429
452
  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 recognizer doesn't
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].
@@ -17,6 +17,7 @@
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
19
  require "google/cloud/speech/v2/speech/rest"
20
+ require "google/cloud/speech/v2/bindings_override"
20
21
  require "google/cloud/speech/v2/version"
21
22
 
22
23
  module Google
@@ -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
  ##
@@ -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 recognizer doesn't
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)
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,9 @@ 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.
1018
1035
  #
1019
1036
  # @yield [response, operation] Access the result along with the RPC operation
1020
1037
  # @yieldparam response [::Gapic::Operation]
@@ -2515,9 +2532,9 @@ module Google
2515
2532
  # * (`String`) The path to a service account key file in JSON format
2516
2533
  # * (`Hash`) A service account key as a Hash
2517
2534
  # * (`Google::Auth::Credentials`) A googleauth credentials object
2518
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
2535
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2519
2536
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2520
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
2537
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2521
2538
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
2522
2539
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
2523
2540
  # * (`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://googleapis.dev/ruby/googleauth/latest/index.html))
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://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
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
  ##
@@ -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 recognizer doesn't
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)
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,9 @@ 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.
737
755
  # @yield [result, operation] Access the result along with the TransportOperation object
738
756
  # @yieldparam result [::Gapic::Operation]
739
757
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -1818,9 +1836,9 @@ module Google
1818
1836
  # * (`String`) The path to a service account key file in JSON format
1819
1837
  # * (`Hash`) A service account key as a Hash
1820
1838
  # * (`Google::Auth::Credentials`) A googleauth credentials object
1821
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1839
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1822
1840
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1823
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1841
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1824
1842
  # * (`nil`) indicating no credentials
1825
1843
  # @return [::Object]
1826
1844
  # @!attribute [rw] scope
@@ -1866,6 +1884,13 @@ module Google
1866
1884
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1867
1885
  config_attr :quota_project, nil, ::String, nil
1868
1886
 
1887
+ # @private
1888
+ # Overrides for http bindings for the RPCs of this service
1889
+ # are only used when this service is used as mixin, and only
1890
+ # by the host service.
1891
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1892
+ config_attr :bindings_override, {}, ::Hash, nil
1893
+
1869
1894
  # @private
1870
1895
  def initialize parent_config = nil
1871
1896
  @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://googleapis.dev/ruby/googleauth/latest/index.html))
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://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
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"
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Speech
23
23
  module V2
24
- VERSION = "0.2.0"
24
+ VERSION = "0.3.0"
25
25
  end
26
26
  end
27
27
  end
@@ -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.
@@ -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
@@ -240,8 +246,8 @@ module Google
240
246
  # Example of a YAML configuration::
241
247
  #
242
248
  # publishing:
243
- # method_behavior:
244
- # - selector: CreateAdDomain
249
+ # method_settings:
250
+ # - selector: google.cloud.speech.v2.Speech.BatchRecognize
245
251
  # long_running:
246
252
  # initial_poll_delay:
247
253
  # seconds: 60 # 1 minute
@@ -275,22 +275,44 @@ module Google
275
275
  # When using this model, the service will stop transcribing audio after the
276
276
  # first utterance is detected and completed.
277
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.
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.
282
+ #
283
+ # - `telephony`
284
+ #
285
+ # Best for audio that originated from a phone call (typically recorded at
286
+ # an 8khz sampling rate).
287
+ #
288
+ # - `medical_conversation`
289
+ #
290
+ # For conversations between a medical provider—for example, a doctor or
291
+ # nurse—and a patient. Use this model when both a provider and a patient
292
+ # are speaking. Words uttered by each speaker are automatically detected
293
+ # and labeled in the returned transcript.
294
+ #
295
+ # For supported features please see [medical models
296
+ # documentation](https://cloud.google.com/speech-to-text/docs/medical-models).
297
+ #
298
+ # - `medical_dictation`
299
+ #
300
+ # For dictated notes spoken by a single medical provider—for example, a
301
+ # doctor dictating notes about a patient's blood test results.
302
+ #
303
+ # For supported features please see [medical models
304
+ # documentation](https://cloud.google.com/speech-to-text/docs/medical-models).
305
+ #
306
+ # - `usm`
307
+ #
308
+ # The next generation of Speech-to-Text models from Google.
282
309
  # @!attribute [rw] language_codes
283
310
  # @return [::Array<::String>]
284
311
  # Required. The language of the supplied audio as a
285
312
  # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
286
313
  #
287
- # Supported languages:
288
- #
289
- # - `en-US`
290
- #
291
- # - `en-GB`
292
- #
293
- # - `fr-FR`
314
+ # Supported languages for each model are listed at:
315
+ # https://cloud.google.com/speech-to-text/docs/languages
294
316
  #
295
317
  # If additional languages are provided, recognition result will contain
296
318
  # recognition in the most likely language detected. The recognition result
@@ -373,14 +395,23 @@ module Google
373
395
 
374
396
  # Automatically detected decoding parameters.
375
397
  # Supported for the following encodings:
398
+ #
376
399
  # * WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container.
400
+ #
377
401
  # * WAV_MULAW: 8-bit companded mulaw samples in a WAV container.
402
+ #
378
403
  # * WAV_ALAW: 8-bit companded alaw samples in a WAV container.
404
+ #
379
405
  # * RFC4867_5_AMR: AMR frames with an rfc4867.5 header.
406
+ #
380
407
  # * RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header.
408
+ #
381
409
  # * FLAC: FLAC frames in the "native FLAC" container format.
410
+ #
382
411
  # * MP3: MPEG audio frames with optional (ignored) ID3 metadata.
412
+ #
383
413
  # * OGG_OPUS: Opus audio frames in an Ogg container.
414
+ #
384
415
  # * WEBM_OPUS: Opus audio frames in a WebM container.
385
416
  class AutoDetectDecodingConfig
386
417
  include ::Google::Protobuf::MessageExts
@@ -398,16 +429,24 @@ module Google
398
429
  # sampling rate of the audio source to 16000 Hz. If that's not possible, use
399
430
  # the native sample rate of the audio source (instead of re-sampling).
400
431
  # Supported for the following encodings:
432
+ #
401
433
  # * LINEAR16: Headerless 16-bit signed little-endian PCM samples.
434
+ #
402
435
  # * MULAW: Headerless 8-bit companded mulaw samples.
436
+ #
403
437
  # * ALAW: Headerless 8-bit companded alaw samples.
404
438
  # @!attribute [rw] audio_channel_count
405
439
  # @return [::Integer]
406
440
  # Number of channels present in the audio data sent for recognition.
407
441
  # Supported for the following encodings:
442
+ #
408
443
  # * LINEAR16: Headerless 16-bit signed little-endian PCM samples.
444
+ #
409
445
  # * MULAW: Headerless 8-bit companded mulaw samples.
446
+ #
410
447
  # * ALAW: Headerless 8-bit companded alaw samples.
448
+ #
449
+ # The maximum allowed value is 8.
411
450
  class ExplicitDecodingConfig
412
451
  include ::Google::Protobuf::MessageExts
413
452
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -433,7 +472,7 @@ module Google
433
472
  # @return [::Integer]
434
473
  # Required. Minimum number of speakers in the conversation. This range gives
435
474
  # you more flexibility by allowing the system to automatically determine the
436
- # correct number of speakers. If not set, the default value is 2.
475
+ # correct number of speakers.
437
476
  #
438
477
  # To fix the number of speakers detected in the audio, set
439
478
  # `min_speaker_count` = `max_speaker_count`.
@@ -521,28 +560,28 @@ module Google
521
560
  end
522
561
 
523
562
  # Provides "hints" to the speech recognizer to favor specific words and phrases
524
- # in the results. Phrase sets can be specified as an inline resource, or a
525
- # reference to an existing phrase set resource.
563
+ # in the results. PhraseSets can be specified as an inline resource, or a
564
+ # reference to an existing PhraseSet resource.
526
565
  # @!attribute [rw] phrase_sets
527
566
  # @return [::Array<::Google::Cloud::Speech::V2::SpeechAdaptation::AdaptationPhraseSet>]
528
- # A list of inline or referenced phrase sets.
567
+ # A list of inline or referenced PhraseSets.
529
568
  # @!attribute [rw] custom_classes
530
569
  # @return [::Array<::Google::Cloud::Speech::V2::CustomClass>]
531
- # A list of inline custom classes. Existing custom class resources can be
532
- # referenced directly in a phrase set.
570
+ # A list of inline CustomClasses. Existing CustomClass resources can be
571
+ # referenced directly in a PhraseSet.
533
572
  class SpeechAdaptation
534
573
  include ::Google::Protobuf::MessageExts
535
574
  extend ::Google::Protobuf::MessageExts::ClassMethods
536
575
 
537
- # A biasing phrase set, which can be either a string referencing the name of
538
- # an existing phrase set resource, or an inline definition of a phrase set.
576
+ # A biasing PhraseSet, which can be either a string referencing the name of
577
+ # an existing PhraseSets resource, or an inline definition of a PhraseSet.
539
578
  # @!attribute [rw] phrase_set
540
579
  # @return [::String]
541
- # The name of an existing phrase set resource. The user must have read
580
+ # The name of an existing PhraseSet resource. The user must have read
542
581
  # access to the resource and it must not be deleted.
543
582
  # @!attribute [rw] inline_phrase_set
544
583
  # @return [::Google::Cloud::Speech::V2::PhraseSet]
545
- # An inline defined phrase set.
584
+ # An inline defined PhraseSet.
546
585
  class AdaptationPhraseSet
547
586
  include ::Google::Protobuf::MessageExts
548
587
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -651,9 +690,9 @@ module Google
651
690
  # @!attribute [rw] words
652
691
  # @return [::Array<::Google::Cloud::Speech::V2::WordInfo>]
653
692
  # A list of word-specific information for each recognized word.
654
- # When
655
- # [enable_speaker_diarization][google.cloud.speech.v2.SpeakerDiarizationConfig.enable_speaker_diarization]
656
- # is true, you will see all the words from the beginning of the audio.
693
+ # When the
694
+ # {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig}
695
+ # is set, you will see all the words from the beginning of the audio.
657
696
  class SpeechRecognitionAlternative
658
697
  include ::Google::Protobuf::MessageExts
659
698
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -694,8 +733,8 @@ module Google
694
733
  # A distinct label is assigned for every speaker within the audio. This field
695
734
  # specifies which one of those speakers was detected to have spoken this
696
735
  # word. `speaker_label` is set if
697
- # [enable_speaker_diarization][google.cloud.speech.v2.SpeakerDiarizationConfig.enable_speaker_diarization]
698
- # is `true` and only in the top alternative.
736
+ # {::Google::Cloud::Speech::V2::SpeakerDiarizationConfig SpeakerDiarizationConfig}
737
+ # is given and only in the top alternative.
699
738
  class WordInfo
700
739
  include ::Google::Protobuf::MessageExts
701
740
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -795,9 +834,9 @@ module Google
795
834
  # of the recognizer during this recognition request. If no mask is provided,
796
835
  # all non-default valued fields in
797
836
  # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config} override
798
- # the values in the recognizer for this recognition request. If a mask is
837
+ # the values in the Recognizer for this recognition request. If a mask is
799
838
  # provided, only the fields listed in the mask override the config in the
800
- # recognizer for this recognition request. If a wildcard (`*`) is provided,
839
+ # Recognizer for this recognition request. If a wildcard (`*`) is provided,
801
840
  # {::Google::Cloud::Speech::V2::StreamingRecognitionConfig#config config}
802
841
  # completely overrides and replaces the config in the recognizer for this
803
842
  # recognition request.
@@ -841,6 +880,7 @@ module Google
841
880
  # @!attribute [rw] audio
842
881
  # @return [::String]
843
882
  # Inline audio bytes to be Recognized.
883
+ # Maximum size for this field is 15 KB per request.
844
884
  class StreamingRecognizeRequest
845
885
  include ::Google::Protobuf::MessageExts
846
886
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -878,17 +918,57 @@ module Google
878
918
  # @!attribute [rw] files
879
919
  # @return [::Array<::Google::Cloud::Speech::V2::BatchRecognizeFileMetadata>]
880
920
  # Audio files with file metadata for ASR.
921
+ # The maximum number of files allowed to be specified is 5.
922
+ # @!attribute [rw] recognition_output_config
923
+ # @return [::Google::Cloud::Speech::V2::RecognitionOutputConfig]
924
+ # Configuration options for where to output the transcripts of each file.
881
925
  class BatchRecognizeRequest
882
926
  include ::Google::Protobuf::MessageExts
883
927
  extend ::Google::Protobuf::MessageExts::ClassMethods
884
928
  end
885
929
 
930
+ # Output configurations for Cloud Storage.
931
+ # @!attribute [rw] uri
932
+ # @return [::String]
933
+ # The Cloud Storage URI prefix with which recognition results will be
934
+ # written.
935
+ class GcsOutputConfig
936
+ include ::Google::Protobuf::MessageExts
937
+ extend ::Google::Protobuf::MessageExts::ClassMethods
938
+ end
939
+
940
+ # Output configurations for inline response.
941
+ class InlineOutputConfig
942
+ include ::Google::Protobuf::MessageExts
943
+ extend ::Google::Protobuf::MessageExts::ClassMethods
944
+ end
945
+
946
+ # Configuration options for the output(s) of recognition.
947
+ # @!attribute [rw] gcs_output_config
948
+ # @return [::Google::Cloud::Speech::V2::GcsOutputConfig]
949
+ # If this message is populated, recognition results are written to the
950
+ # provided Google Cloud Storage URI.
951
+ # @!attribute [rw] inline_response_config
952
+ # @return [::Google::Cloud::Speech::V2::InlineOutputConfig]
953
+ # If this message is populated, recognition results are provided in the
954
+ # {::Google::Cloud::Speech::V2::BatchRecognizeResponse BatchRecognizeResponse}
955
+ # message of the Operation when completed. This is only supported when
956
+ # calling {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize}
957
+ # with just one audio file.
958
+ class RecognitionOutputConfig
959
+ include ::Google::Protobuf::MessageExts
960
+ extend ::Google::Protobuf::MessageExts::ClassMethods
961
+ end
962
+
886
963
  # Response message for
887
964
  # {::Google::Cloud::Speech::V2::Speech::Client#batch_recognize BatchRecognize} that is
888
965
  # packaged into a longrunning {::Google::Longrunning::Operation Operation}.
889
966
  # @!attribute [rw] results
890
967
  # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Speech::V2::BatchRecognizeFileResult}]
891
968
  # Map from filename to the final result for that file.
969
+ # @!attribute [rw] total_billed_duration
970
+ # @return [::Google::Protobuf::Duration]
971
+ # When available, billed audio seconds for the corresponding request.
892
972
  class BatchRecognizeResponse
893
973
  include ::Google::Protobuf::MessageExts
894
974
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -903,13 +983,36 @@ module Google
903
983
  end
904
984
  end
905
985
 
986
+ # Output type for Cloud Storage of BatchRecognize transcripts. Though this
987
+ # proto isn't returned in this API anywhere, the Cloud Storage transcripts will
988
+ # be this proto serialized and should be parsed as such.
989
+ # @!attribute [rw] results
990
+ # @return [::Array<::Google::Cloud::Speech::V2::SpeechRecognitionResult>]
991
+ # Sequential list of transcription results corresponding to sequential
992
+ # portions of audio.
993
+ # @!attribute [rw] metadata
994
+ # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata]
995
+ # Metadata about the recognition.
996
+ class BatchRecognizeResults
997
+ include ::Google::Protobuf::MessageExts
998
+ extend ::Google::Protobuf::MessageExts::ClassMethods
999
+ end
1000
+
906
1001
  # Final results for a single file.
907
1002
  # @!attribute [rw] uri
908
1003
  # @return [::String]
909
- # The GCS URI to which recognition results were written.
1004
+ # The Cloud Storage URI to which recognition results were written.
910
1005
  # @!attribute [rw] error
911
1006
  # @return [::Google::Rpc::Status]
912
1007
  # Error if one was encountered.
1008
+ # @!attribute [rw] metadata
1009
+ # @return [::Google::Cloud::Speech::V2::RecognitionResponseMetadata]
1010
+ # @!attribute [rw] transcript
1011
+ # @return [::Google::Cloud::Speech::V2::BatchRecognizeResults]
1012
+ # The transcript for the audio file. This is populated only when
1013
+ # {::Google::Cloud::Speech::V2::InlineOutputConfig InlineOutputConfig} is set in
1014
+ # the
1015
+ # [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig].
913
1016
  class BatchRecognizeFileResult
914
1017
  include ::Google::Protobuf::MessageExts
915
1018
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -925,7 +1028,7 @@ module Google
925
1028
  # Error if one was encountered.
926
1029
  # @!attribute [rw] uri
927
1030
  # @return [::String]
928
- # The GCS URI to which recognition results will be written.
1031
+ # The Cloud Storage URI to which recognition results will be written.
929
1032
  class BatchRecognizeTranscriptionMetadata
930
1033
  include ::Google::Protobuf::MessageExts
931
1034
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -1290,7 +1393,8 @@ module Google
1290
1393
  # phrase will be recognized over other similar sounding phrases. The higher
1291
1394
  # the boost, the higher the chance of false positive recognition as well.
1292
1395
  # 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.
1396
+ # binary search approach to finding the optimal value for your use case as
1397
+ # well as adding phrases both with and without boost to your requests.
1294
1398
  # @!attribute [rw] display_name
1295
1399
  # @return [::String]
1296
1400
  # User-settable, human-readable name for the PhraseSet. Must be 63
@@ -1358,11 +1462,11 @@ module Google
1358
1462
  # be recognized over other similar sounding phrases. The higher the boost,
1359
1463
  # the higher the chance of false positive recognition as well. Negative
1360
1464
  # boost values would correspond to anti-biasing. Anti-biasing is not
1361
- # enabled, so negative boost will simply be ignored. Though `boost` can
1362
- # accept a wide range of positive values, most use cases are best served
1363
- # with values between 0 and 20. We recommend using a binary search approach
1364
- # to finding the optimal value for your use case. Speech recognition
1365
- # will skip PhraseSets with a boost value of 0.
1465
+ # enabled, so negative boost values will return an error. Boost values must
1466
+ # be between 0 and 20. Any values outside that range will return an error.
1467
+ # We recommend using a binary search approach to finding the optimal value
1468
+ # for your use case as well as adding phrases both with and without boost
1469
+ # to your requests.
1366
1470
  class Phrase
1367
1471
  include ::Google::Protobuf::MessageExts
1368
1472
  extend ::Google::Protobuf::MessageExts::ClassMethods
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.2.0
4
+ version: 0.3.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-02-23 00:00:00.000000000 Z
11
+ date: 2023-03-23 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.17.1
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.17.1
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: API Client library for the Cloud Speech-to-Text V2 API
247
+ summary: Converts audio to text by applying powerful neural network models.
227
248
  test_files: []