google-cloud-speech 0.32.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +4 -1
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +201 -0
  5. data/MIGRATING.md +367 -0
  6. data/README.md +97 -52
  7. data/lib/google/cloud/speech/version.rb +22 -0
  8. data/lib/google/cloud/speech.rb +88 -139
  9. data/lib/google-cloud-speech.rb +19 -0
  10. metadata +111 -49
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/speech/v1/cloud_speech_pb.rb +0 -129
  13. data/lib/google/cloud/speech/v1/cloud_speech_services_pb.rb +0 -56
  14. data/lib/google/cloud/speech/v1/credentials.rb +0 -41
  15. data/lib/google/cloud/speech/v1/doc/google/cloud/speech/v1/cloud_speech.rb +0 -482
  16. data/lib/google/cloud/speech/v1/doc/google/longrunning/operations.rb +0 -93
  17. data/lib/google/cloud/speech/v1/doc/google/protobuf/any.rb +0 -130
  18. data/lib/google/cloud/speech/v1/doc/google/protobuf/duration.rb +0 -91
  19. data/lib/google/cloud/speech/v1/doc/google/rpc/status.rb +0 -84
  20. data/lib/google/cloud/speech/v1/helpers.rb +0 -136
  21. data/lib/google/cloud/speech/v1/speech_client.rb +0 -331
  22. data/lib/google/cloud/speech/v1/speech_client_config.json +0 -41
  23. data/lib/google/cloud/speech/v1/stream.rb +0 -614
  24. data/lib/google/cloud/speech/v1.rb +0 -157
  25. data/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb +0 -190
  26. data/lib/google/cloud/speech/v1p1beta1/cloud_speech_services_pb.rb +0 -56
  27. data/lib/google/cloud/speech/v1p1beta1/credentials.rb +0 -41
  28. data/lib/google/cloud/speech/v1p1beta1/doc/google/cloud/speech/v1p1beta1/cloud_speech.rb +0 -719
  29. data/lib/google/cloud/speech/v1p1beta1/doc/google/longrunning/operations.rb +0 -93
  30. data/lib/google/cloud/speech/v1p1beta1/doc/google/protobuf/any.rb +0 -130
  31. data/lib/google/cloud/speech/v1p1beta1/doc/google/protobuf/duration.rb +0 -91
  32. data/lib/google/cloud/speech/v1p1beta1/doc/google/rpc/status.rb +0 -84
  33. data/lib/google/cloud/speech/v1p1beta1/helpers.rb +0 -136
  34. data/lib/google/cloud/speech/v1p1beta1/speech_client.rb +0 -331
  35. data/lib/google/cloud/speech/v1p1beta1/speech_client_config.json +0 -41
  36. data/lib/google/cloud/speech/v1p1beta1/stream.rb +0 -614
  37. data/lib/google/cloud/speech/v1p1beta1.rb +0 -157
@@ -1,157 +0,0 @@
1
- # Copyright 2018 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "google/cloud/speech/v1/speech_client"
17
- require "google/cloud/speech/v1/helpers"
18
-
19
- module Google
20
- module Cloud
21
- module Speech
22
- # rubocop:disable LineLength
23
-
24
- ##
25
- # # Ruby Client for Cloud Speech API ([Alpha](https://github.com/googleapis/google-cloud-ruby#versioning))
26
- #
27
- # [Cloud Speech API][Product Documentation]:
28
- # Converts audio to text by applying powerful neural network models.
29
- # - [Product Documentation][]
30
- #
31
- # ## Quick Start
32
- # In order to use this library, you first need to go through the following
33
- # steps:
34
- #
35
- # 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
36
- # 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
37
- # 3. [Enable the Cloud Speech API.](https://console.cloud.google.com/apis/library/speech.googleapis.com)
38
- # 4. [Setup Authentication.](https://googleapis.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
39
- #
40
- # ### Installation
41
- # ```
42
- # $ gem install google-cloud-speech
43
- # ```
44
- #
45
- # ### Preview
46
- # #### SpeechClient
47
- # ```rb
48
- # require "google/cloud/speech"
49
- #
50
- # speech_client = Google::Cloud::Speech.new(version: :v1)
51
- # language_code = "en-US"
52
- # sample_rate_hertz = 44100
53
- # encoding = :FLAC
54
- # config = {
55
- # language_code: language_code,
56
- # sample_rate_hertz: sample_rate_hertz,
57
- # encoding: encoding
58
- # }
59
- # uri = "gs://bucket-name/hello.flac"
60
- # audio = { uri: uri }
61
- # response = speech_client.recognize(config, audio)
62
- # ```
63
- #
64
- # ### Next Steps
65
- # - Read the [Cloud Speech API Product documentation][Product Documentation]
66
- # to learn more about the product and see How-to Guides.
67
- # - View this [repository's main README](https://github.com/googleapis/google-cloud-ruby/blob/master/README.md)
68
- # to see the full list of Cloud APIs that we cover.
69
- #
70
- # [Product Documentation]: https://cloud.google.com/speech
71
- #
72
- # ## Enabling Logging
73
- #
74
- # To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
75
- # The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as shown below,
76
- # or a [`Google::Cloud::Logging::Logger`](https://googleapis.github.io/google-cloud-ruby/#/docs/google-cloud-logging/latest/google/cloud/logging/logger)
77
- # that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
78
- # and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
79
- #
80
- # Configuring a Ruby stdlib logger:
81
- #
82
- # ```ruby
83
- # require "logger"
84
- #
85
- # module MyLogger
86
- # LOGGER = Logger.new $stderr, level: Logger::WARN
87
- # def logger
88
- # LOGGER
89
- # end
90
- # end
91
- #
92
- # # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
93
- # module GRPC
94
- # extend MyLogger
95
- # end
96
- # ```
97
- #
98
- module V1
99
- # rubocop:enable LineLength
100
-
101
- ##
102
- # Service that implements Google Cloud Speech API.
103
- #
104
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
105
- # Provides the means for authenticating requests made by the client. This parameter can
106
- # be many types.
107
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
108
- # authenticating requests made by this client.
109
- # A `String` will be treated as the path to the keyfile to be used for the construction of
110
- # credentials for this client.
111
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
112
- # credentials for this client.
113
- # A `GRPC::Core::Channel` will be used to make calls through.
114
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
115
- # should already be composed with a `GRPC::Core::CallCredentials` object.
116
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
117
- # metadata for requests, generally, to give OAuth credentials.
118
- # @param scopes [Array<String>]
119
- # The OAuth scopes for this service. This parameter is ignored if
120
- # an updater_proc is supplied.
121
- # @param client_config [Hash]
122
- # A Hash for call options for each method. See
123
- # Google::Gax#construct_settings for the structure of
124
- # this data. Falls back to the default config if not specified
125
- # or the specified config is missing data points.
126
- # @param timeout [Numeric]
127
- # The default timeout, in seconds, for calls made through this client.
128
- # @param metadata [Hash]
129
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
130
- # @param exception_transformer [Proc]
131
- # An optional proc that intercepts any exceptions raised during an API call to inject
132
- # custom error handling.
133
- def self.new \
134
- credentials: nil,
135
- scopes: nil,
136
- client_config: nil,
137
- timeout: nil,
138
- metadata: nil,
139
- exception_transformer: nil,
140
- lib_name: nil,
141
- lib_version: nil
142
- kwargs = {
143
- credentials: credentials,
144
- scopes: scopes,
145
- client_config: client_config,
146
- timeout: timeout,
147
- metadata: metadata,
148
- exception_transformer: exception_transformer,
149
- lib_name: lib_name,
150
- lib_version: lib_version
151
- }.select { |_, v| v != nil }
152
- Google::Cloud::Speech::V1::SpeechClient.new(**kwargs)
153
- end
154
- end
155
- end
156
- end
157
- end
@@ -1,190 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/speech/v1p1beta1/cloud_speech.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/longrunning/operations_pb'
9
- require 'google/protobuf/any_pb'
10
- require 'google/protobuf/duration_pb'
11
- require 'google/protobuf/empty_pb'
12
- require 'google/protobuf/timestamp_pb'
13
- require 'google/rpc/status_pb'
14
- Google::Protobuf::DescriptorPool.generated_pool.build do
15
- add_message "google.cloud.speech.v1p1beta1.RecognizeRequest" do
16
- optional :config, :message, 1, "google.cloud.speech.v1p1beta1.RecognitionConfig"
17
- optional :audio, :message, 2, "google.cloud.speech.v1p1beta1.RecognitionAudio"
18
- end
19
- add_message "google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" do
20
- optional :config, :message, 1, "google.cloud.speech.v1p1beta1.RecognitionConfig"
21
- optional :audio, :message, 2, "google.cloud.speech.v1p1beta1.RecognitionAudio"
22
- end
23
- add_message "google.cloud.speech.v1p1beta1.StreamingRecognizeRequest" do
24
- oneof :streaming_request do
25
- optional :streaming_config, :message, 1, "google.cloud.speech.v1p1beta1.StreamingRecognitionConfig"
26
- optional :audio_content, :bytes, 2
27
- end
28
- end
29
- add_message "google.cloud.speech.v1p1beta1.StreamingRecognitionConfig" do
30
- optional :config, :message, 1, "google.cloud.speech.v1p1beta1.RecognitionConfig"
31
- optional :single_utterance, :bool, 2
32
- optional :interim_results, :bool, 3
33
- end
34
- add_message "google.cloud.speech.v1p1beta1.RecognitionConfig" do
35
- optional :encoding, :enum, 1, "google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding"
36
- optional :sample_rate_hertz, :int32, 2
37
- optional :audio_channel_count, :int32, 7
38
- optional :enable_separate_recognition_per_channel, :bool, 12
39
- optional :language_code, :string, 3
40
- repeated :alternative_language_codes, :string, 18
41
- optional :max_alternatives, :int32, 4
42
- optional :profanity_filter, :bool, 5
43
- repeated :speech_contexts, :message, 6, "google.cloud.speech.v1p1beta1.SpeechContext"
44
- optional :enable_word_time_offsets, :bool, 8
45
- optional :enable_word_confidence, :bool, 15
46
- optional :enable_automatic_punctuation, :bool, 11
47
- optional :enable_speaker_diarization, :bool, 16
48
- optional :diarization_speaker_count, :int32, 17
49
- optional :metadata, :message, 9, "google.cloud.speech.v1p1beta1.RecognitionMetadata"
50
- optional :model, :string, 13
51
- optional :use_enhanced, :bool, 14
52
- end
53
- add_enum "google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding" do
54
- value :ENCODING_UNSPECIFIED, 0
55
- value :LINEAR16, 1
56
- value :FLAC, 2
57
- value :MULAW, 3
58
- value :AMR, 4
59
- value :AMR_WB, 5
60
- value :OGG_OPUS, 6
61
- value :SPEEX_WITH_HEADER_BYTE, 7
62
- end
63
- add_message "google.cloud.speech.v1p1beta1.RecognitionMetadata" do
64
- optional :interaction_type, :enum, 1, "google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType"
65
- optional :industry_naics_code_of_audio, :uint32, 3
66
- optional :microphone_distance, :enum, 4, "google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance"
67
- optional :original_media_type, :enum, 5, "google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType"
68
- optional :recording_device_type, :enum, 6, "google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType"
69
- optional :recording_device_name, :string, 7
70
- optional :original_mime_type, :string, 8
71
- optional :obfuscated_id, :int64, 9
72
- optional :audio_topic, :string, 10
73
- end
74
- add_enum "google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType" do
75
- value :INTERACTION_TYPE_UNSPECIFIED, 0
76
- value :DISCUSSION, 1
77
- value :PRESENTATION, 2
78
- value :PHONE_CALL, 3
79
- value :VOICEMAIL, 4
80
- value :PROFESSIONALLY_PRODUCED, 5
81
- value :VOICE_SEARCH, 6
82
- value :VOICE_COMMAND, 7
83
- value :DICTATION, 8
84
- end
85
- add_enum "google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance" do
86
- value :MICROPHONE_DISTANCE_UNSPECIFIED, 0
87
- value :NEARFIELD, 1
88
- value :MIDFIELD, 2
89
- value :FARFIELD, 3
90
- end
91
- add_enum "google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType" do
92
- value :ORIGINAL_MEDIA_TYPE_UNSPECIFIED, 0
93
- value :AUDIO, 1
94
- value :VIDEO, 2
95
- end
96
- add_enum "google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType" do
97
- value :RECORDING_DEVICE_TYPE_UNSPECIFIED, 0
98
- value :SMARTPHONE, 1
99
- value :PC, 2
100
- value :PHONE_LINE, 3
101
- value :VEHICLE, 4
102
- value :OTHER_OUTDOOR_DEVICE, 5
103
- value :OTHER_INDOOR_DEVICE, 6
104
- end
105
- add_message "google.cloud.speech.v1p1beta1.SpeechContext" do
106
- repeated :phrases, :string, 1
107
- end
108
- add_message "google.cloud.speech.v1p1beta1.RecognitionAudio" do
109
- oneof :audio_source do
110
- optional :content, :bytes, 1
111
- optional :uri, :string, 2
112
- end
113
- end
114
- add_message "google.cloud.speech.v1p1beta1.RecognizeResponse" do
115
- repeated :results, :message, 2, "google.cloud.speech.v1p1beta1.SpeechRecognitionResult"
116
- end
117
- add_message "google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse" do
118
- repeated :results, :message, 2, "google.cloud.speech.v1p1beta1.SpeechRecognitionResult"
119
- end
120
- add_message "google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" do
121
- optional :progress_percent, :int32, 1
122
- optional :start_time, :message, 2, "google.protobuf.Timestamp"
123
- optional :last_update_time, :message, 3, "google.protobuf.Timestamp"
124
- end
125
- add_message "google.cloud.speech.v1p1beta1.StreamingRecognizeResponse" do
126
- optional :error, :message, 1, "google.rpc.Status"
127
- repeated :results, :message, 2, "google.cloud.speech.v1p1beta1.StreamingRecognitionResult"
128
- optional :speech_event_type, :enum, 4, "google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType"
129
- end
130
- add_enum "google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType" do
131
- value :SPEECH_EVENT_UNSPECIFIED, 0
132
- value :END_OF_SINGLE_UTTERANCE, 1
133
- end
134
- add_message "google.cloud.speech.v1p1beta1.StreamingRecognitionResult" do
135
- repeated :alternatives, :message, 1, "google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative"
136
- optional :is_final, :bool, 2
137
- optional :stability, :float, 3
138
- optional :result_end_time, :message, 4, "google.protobuf.Duration"
139
- optional :channel_tag, :int32, 5
140
- optional :language_code, :string, 6
141
- end
142
- add_message "google.cloud.speech.v1p1beta1.SpeechRecognitionResult" do
143
- repeated :alternatives, :message, 1, "google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative"
144
- optional :channel_tag, :int32, 2
145
- optional :language_code, :string, 5
146
- end
147
- add_message "google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative" do
148
- optional :transcript, :string, 1
149
- optional :confidence, :float, 2
150
- repeated :words, :message, 3, "google.cloud.speech.v1p1beta1.WordInfo"
151
- end
152
- add_message "google.cloud.speech.v1p1beta1.WordInfo" do
153
- optional :start_time, :message, 1, "google.protobuf.Duration"
154
- optional :end_time, :message, 2, "google.protobuf.Duration"
155
- optional :word, :string, 3
156
- optional :confidence, :float, 4
157
- optional :speaker_tag, :int32, 5
158
- end
159
- end
160
-
161
- module Google
162
- module Cloud
163
- module Speech
164
- module V1p1beta1
165
- RecognizeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognizeRequest").msgclass
166
- LongRunningRecognizeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest").msgclass
167
- StreamingRecognizeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeRequest").msgclass
168
- StreamingRecognitionConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionConfig").msgclass
169
- RecognitionConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionConfig").msgclass
170
- RecognitionConfig::AudioEncoding = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding").enummodule
171
- RecognitionMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata").msgclass
172
- RecognitionMetadata::InteractionType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType").enummodule
173
- RecognitionMetadata::MicrophoneDistance = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance").enummodule
174
- RecognitionMetadata::OriginalMediaType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType").enummodule
175
- RecognitionMetadata::RecordingDeviceType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType").enummodule
176
- SpeechContext = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechContext").msgclass
177
- RecognitionAudio = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionAudio").msgclass
178
- RecognizeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognizeResponse").msgclass
179
- LongRunningRecognizeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse").msgclass
180
- LongRunningRecognizeMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata").msgclass
181
- StreamingRecognizeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeResponse").msgclass
182
- StreamingRecognizeResponse::SpeechEventType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType").enummodule
183
- StreamingRecognitionResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionResult").msgclass
184
- SpeechRecognitionResult = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechRecognitionResult").msgclass
185
- SpeechRecognitionAlternative = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative").msgclass
186
- WordInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.WordInfo").msgclass
187
- end
188
- end
189
- end
190
- end
@@ -1,56 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/cloud/speech/v1p1beta1/cloud_speech.proto for package 'google.cloud.speech.v1p1beta1'
3
- # Original file comments:
4
- # Copyright 2018 Google LLC.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
- #
19
-
20
-
21
- require 'grpc'
22
- require 'google/cloud/speech/v1p1beta1/cloud_speech_pb'
23
-
24
- module Google
25
- module Cloud
26
- module Speech
27
- module V1p1beta1
28
- module Speech
29
- # Service that implements Google Cloud Speech API.
30
- class Service
31
-
32
- include GRPC::GenericService
33
-
34
- self.marshal_class_method = :encode
35
- self.unmarshal_class_method = :decode
36
- self.service_name = 'google.cloud.speech.v1p1beta1.Speech'
37
-
38
- # Performs synchronous speech recognition: receive results after all audio
39
- # has been sent and processed.
40
- rpc :Recognize, RecognizeRequest, RecognizeResponse
41
- # Performs asynchronous speech recognition: receive results via the
42
- # google.longrunning.Operations interface. Returns either an
43
- # `Operation.error` or an `Operation.response` which contains
44
- # a `LongRunningRecognizeResponse` message.
45
- rpc :LongRunningRecognize, LongRunningRecognizeRequest, Google::Longrunning::Operation
46
- # Performs bidirectional streaming speech recognition: receive results while
47
- # sending audio. This method is only available via the gRPC API (not REST).
48
- rpc :StreamingRecognize, stream(StreamingRecognizeRequest), stream(StreamingRecognizeResponse)
49
- end
50
-
51
- Stub = Service.rpc_stub_class
52
- end
53
- end
54
- end
55
- end
56
- end
@@ -1,41 +0,0 @@
1
- # Copyright 2018 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "googleauth"
17
-
18
- module Google
19
- module Cloud
20
- module Speech
21
- module V1p1beta1
22
- class Credentials < Google::Auth::Credentials
23
- SCOPE = [
24
- "https://www.googleapis.com/auth/cloud-platform"
25
- ].freeze
26
- PATH_ENV_VARS = %w(SPEECH_CREDENTIALS
27
- SPEECH_KEYFILE
28
- GOOGLE_CLOUD_CREDENTIALS
29
- GOOGLE_CLOUD_KEYFILE
30
- GCLOUD_KEYFILE)
31
- JSON_ENV_VARS = %w(SPEECH_CREDENTIALS_JSON
32
- SPEECH_KEYFILE_JSON
33
- GOOGLE_CLOUD_CREDENTIALS_JSON
34
- GOOGLE_CLOUD_KEYFILE_JSON
35
- GCLOUD_KEYFILE_JSON)
36
- DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
37
- end
38
- end
39
- end
40
- end
41
- end