google-cloud-speech 0.21.1 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a35a3d6fd09318b755221c8c3f95ef781ebe897f
4
- data.tar.gz: 15079061caf8289b64f42f39f5d110d3500d1250
3
+ metadata.gz: 16673527ad42cfa4189e55667391e481342b85f4
4
+ data.tar.gz: 72ace03f374517dfac194b5516066131a97524b5
5
5
  SHA512:
6
- metadata.gz: f55af213c9e770573b0c32f1993dfef05e1566de1b6a0e2643240a2a872319430f218e5f45243750d6bda7d00a46aad1d91bc88473290c6984ba07ca9381c3f1
7
- data.tar.gz: ae663be1584beadca2eaeb04090fe313de27ce523099bb770c10fec85f6c8f6861a43bbc6310e19e74958b79a273f10da2033c7b0f8ace09d934f1adec304131
6
+ metadata.gz: e138dc4b6c099e48cb98b41989a43857aa4614eac646068517f8e98f4e7b9e70c2900f447c810ccd5c556a02f658c8a4d87eb1a205fb766993e94fac4c606424
7
+ data.tar.gz: e82cd683713f0d3330dc4715e61a8ad38f7d24e7cdaecf19ff2b69ed80b296cce0a1fa0a8ccd1d0293dbf9305cbae8f5a22ceae3175438fa81affaba2978f70c
@@ -102,9 +102,9 @@ module Google
102
102
 
103
103
  ##
104
104
  # The language of the supplied audio as a
105
- # [https://www.rfc-editor.org/rfc/bcp/bcp47.txt](BCP-47) language code.
105
+ # [BCP-47](https://tools.ietf.org/html/bcp47) language code.
106
106
  # If not specified, the language defaults to "en-US". See [Language
107
- # Support](https://cloud.google.com/speech/docs/best-practices#language_support)
107
+ # Support](https://cloud.google.com/speech/docs/languages)
108
108
  # for a list of the currently supported language codes.
109
109
  #
110
110
  # @return [String,Symbol]
@@ -127,10 +127,10 @@ module Google
127
127
  # Hz. If that's not possible, use the native sample rate of the audio
128
128
  # source (instead of re-sampling). Optional.
129
129
  # @param [String] language The language of the supplied audio as a
130
- # [https://www.rfc-editor.org/rfc/bcp/bcp47.txt](BCP-47) language
130
+ # [BCP-47](https://tools.ietf.org/html/bcp47) language
131
131
  # code. If not specified, the language defaults to "en-US". See
132
132
  # [Language
133
- # Support](https://cloud.google.com/speech/docs/best-practices#language_support)
133
+ # Support](https://cloud.google.com/speech/docs/languages)
134
134
  # for a list of the currently supported language codes. Optional.
135
135
  #
136
136
  # @return [Audio] The audio file to be recognized.
@@ -223,10 +223,10 @@ module Google
223
223
  # Hz. If that's not possible, use the native sample rate of the audio
224
224
  # source (instead of re-sampling). Optional.
225
225
  # @param [String] language The language of the supplied audio as a
226
- # [https://www.rfc-editor.org/rfc/bcp/bcp47.txt](BCP-47) language
226
+ # [BCP-47](https://tools.ietf.org/html/bcp47) language
227
227
  # code. If not specified, the language defaults to "en-US". See
228
228
  # [Language
229
- # Support](https://cloud.google.com/speech/docs/best-practices#language_support)
229
+ # Support](https://cloud.google.com/speech/docs/languages)
230
230
  # for a list of the currently supported language codes. Optional.
231
231
  # @param [String] max_alternatives The Maximum number of recognition
232
232
  # hypotheses to be returned. Default is 1. The service may return
@@ -320,10 +320,10 @@ module Google
320
320
  # Hz. If that's not possible, use the native sample rate of the audio
321
321
  # source (instead of re-sampling). Optional.
322
322
  # @param [String] language The language of the supplied audio as a
323
- # [https://www.rfc-editor.org/rfc/bcp/bcp47.txt](BCP-47) language
323
+ # [BCP-47](https://tools.ietf.org/html/bcp47) language
324
324
  # code. If not specified, the language defaults to "en-US". See
325
325
  # [Language
326
- # Support](https://cloud.google.com/speech/docs/best-practices#language_support)
326
+ # Support](https://cloud.google.com/speech/docs/languages)
327
327
  # for a list of the currently supported language codes. Optional.
328
328
  # @param [String] max_alternatives The Maximum number of recognition
329
329
  # hypotheses to be returned. Default is 1. The service may return
@@ -429,10 +429,10 @@ module Google
429
429
  # Hz. If that's not possible, use the native sample rate of the audio
430
430
  # source (instead of re-sampling). Optional.
431
431
  # @param [String] language The language of the supplied audio as a
432
- # [https://www.rfc-editor.org/rfc/bcp/bcp47.txt](BCP-47) language
432
+ # [BCP-47](https://tools.ietf.org/html/bcp47) language
433
433
  # code. If not specified, the language defaults to "en-US". See
434
434
  # [Language
435
- # Support](https://cloud.google.com/speech/docs/best-practices#language_support)
435
+ # Support](https://cloud.google.com/speech/docs/languages)
436
436
  # for a list of the currently supported language codes. Optional.
437
437
  # @param [String] max_alternatives The Maximum number of recognition
438
438
  # hypotheses to be returned. Default is 1. The service may return
@@ -66,7 +66,7 @@ module Google
66
66
  def ops
67
67
  return mocked_ops if mocked_ops
68
68
  @ops ||= \
69
- Google::Longrunning::OperationsApi.new(
69
+ Google::Longrunning::OperationsClient.new(
70
70
  service_path: host,
71
71
  channel: channel,
72
72
  timeout: timeout,
@@ -93,7 +93,8 @@ module Google
93
93
  end
94
94
 
95
95
  def recognize_stream request_enum
96
- service.speech_stub.streaming_recognize request_enum
96
+ # No need to handle errors here, they are handled in the enum
97
+ service.streaming_recognize request_enum, options: default_options
97
98
  end
98
99
 
99
100
  def get_op name
@@ -13,7 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  require "google/cloud/speech/v1beta1/speech_api"
16
- require "google/longrunning/operations_api"
16
+ require "google/longrunning/operations_client"
17
17
  # Load the protobufs so code can see these classes
18
18
  require "google/cloud/speech/v1beta1/cloud_speech_pb"
19
19
  require "google/longrunning/operations_pb"
@@ -105,7 +105,7 @@ module Google
105
105
  # [Optional] The language of the supplied audio as a BCP-47 language tag.
106
106
  # Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt
107
107
  # If omitted, defaults to "en-US". See
108
- # {Language Support}[https://cloud.google.com/speech/docs/best-practices#language_support]
108
+ # {Language Support}[https://cloud.google.com/speech/docs/languages]
109
109
  # for a list of the currently supported language codes.
110
110
  # @!attribute [rw] max_alternatives
111
111
  # @return [Integer]
@@ -125,6 +125,10 @@ module Google
125
125
  @speech_stub.method(:async_recognize),
126
126
  defaults["async_recognize"]
127
127
  )
128
+ @streaming_recognize = Google::Gax.create_api_call(
129
+ @speech_stub.method(:streaming_recognize),
130
+ defaults["streaming_recognize"]
131
+ )
128
132
  end
129
133
 
130
134
  # Service calls
@@ -202,6 +206,41 @@ module Google
202
206
  }.delete_if { |_, v| v.nil? })
203
207
  @async_recognize.call(req, options)
204
208
  end
209
+
210
+ # Perform bidirectional streaming speech-recognition: receive results while
211
+ # sending audio. This method is only available via the gRPC API (not REST).
212
+ #
213
+ # @param reqs [Enumerable<Google::Cloud::Speech::V1beta1::StreamingRecognizeRequest>]
214
+ # The input requests.
215
+ # @param options [Google::Gax::CallOptions]
216
+ # Overrides the default settings for this call, e.g, timeout,
217
+ # retries, etc.
218
+ # @return [Enumerable<Google::Cloud::Speech::V1beta1::StreamingRecognizeResponse>]
219
+ # An enumerable of Google::Cloud::Speech::V1beta1::StreamingRecognizeResponse instances.
220
+ #
221
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
222
+ #
223
+ # @note
224
+ # EXPERIMENTAL:
225
+ # Streaming requests are still undergoing review.
226
+ # This method interface might change in the future.
227
+ #
228
+ # @example
229
+ # require "google/cloud/speech/v1beta1/speech_api"
230
+ #
231
+ # SpeechApi = Google::Cloud::Speech::V1beta1::SpeechApi
232
+ # StreamingRecognizeRequest = Google::Cloud::Speech::V1beta1::StreamingRecognizeRequest
233
+ #
234
+ # speech_api = SpeechApi.new
235
+ # request = StreamingRecognizeRequest.new
236
+ # requests = [request]
237
+ # speech_api.streaming_recognize(requests).each do |element|
238
+ # # Process element.
239
+ # end
240
+
241
+ def streaming_recognize reqs, options: nil
242
+ @streaming_recognize.call(reqs, options)
243
+ end
205
244
  end
206
245
  end
207
246
  end
@@ -2,13 +2,11 @@
2
2
  "interfaces": {
3
3
  "google.cloud.speech.v1beta1.Speech": {
4
4
  "retry_codes": {
5
- "retry_codes_def": {
6
5
  "idempotent": [
7
6
  "DEADLINE_EXCEEDED",
8
7
  "UNAVAILABLE"
9
8
  ],
10
9
  "non_idempotent": []
11
- }
12
10
  },
13
11
  "retry_params": {
14
12
  "default": {
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Speech
19
- VERSION = "0.21.1"
19
+ VERSION = "0.22.0"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-speech
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-19 00:00:00.000000000 Z
12
+ date: 2017-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -25,76 +25,34 @@ dependencies:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: 0.21.0
28
- - !ruby/object:Gem::Dependency
29
- name: grpc
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - "~>"
33
- - !ruby/object:Gem::Version
34
- version: '1.0'
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - "~>"
40
- - !ruby/object:Gem::Version
41
- version: '1.0'
42
28
  - !ruby/object:Gem::Dependency
43
29
  name: google-gax
44
30
  requirement: !ruby/object:Gem::Requirement
45
31
  requirements:
46
32
  - - "~>"
47
33
  - !ruby/object:Gem::Version
48
- version: 0.6.0
34
+ version: 0.8.0
49
35
  type: :runtime
50
36
  prerelease: false
51
37
  version_requirements: !ruby/object:Gem::Requirement
52
38
  requirements:
53
39
  - - "~>"
54
40
  - !ruby/object:Gem::Version
55
- version: 0.6.0
56
- - !ruby/object:Gem::Dependency
57
- name: google-protobuf
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: '3.0'
63
- type: :runtime
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '3.0'
70
- - !ruby/object:Gem::Dependency
71
- name: googleapis-common-protos
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '1.3'
77
- type: :runtime
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '1.3'
41
+ version: 0.8.0
84
42
  - !ruby/object:Gem::Dependency
85
43
  name: minitest
86
44
  requirement: !ruby/object:Gem::Requirement
87
45
  requirements:
88
46
  - - "~>"
89
47
  - !ruby/object:Gem::Version
90
- version: '5.9'
48
+ version: '5.10'
91
49
  type: :development
92
50
  prerelease: false
93
51
  version_requirements: !ruby/object:Gem::Requirement
94
52
  requirements:
95
53
  - - "~>"
96
54
  - !ruby/object:Gem::Version
97
- version: '5.9'
55
+ version: '5.10'
98
56
  - !ruby/object:Gem::Dependency
99
57
  name: minitest-autotest
100
58
  requirement: !ruby/object:Gem::Requirement
@@ -197,14 +155,14 @@ dependencies:
197
155
  name: yard-doctest
198
156
  requirement: !ruby/object:Gem::Requirement
199
157
  requirements:
200
- - - "~>"
158
+ - - "<="
201
159
  - !ruby/object:Gem::Version
202
160
  version: 0.1.8
203
161
  type: :development
204
162
  prerelease: false
205
163
  version_requirements: !ruby/object:Gem::Requirement
206
164
  requirements:
207
- - - "~>"
165
+ - - "<="
208
166
  - !ruby/object:Gem::Version
209
167
  version: 0.1.8
210
168
  description: google-cloud-speech is the official library for Google Cloud Speech API.
@@ -254,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
254
212
  version: '0'
255
213
  requirements: []
256
214
  rubyforge_project:
257
- rubygems_version: 2.4.5.1
215
+ rubygems_version: 2.6.10
258
216
  signing_key:
259
217
  specification_version: 4
260
218
  summary: API Client library for Google Cloud Speech API