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,482 +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
- module Google
17
- module Cloud
18
- module Speech
19
- module V1
20
- # The top-level message sent by the client for the `Recognize` method.
21
- # @!attribute [rw] config
22
- # @return [Google::Cloud::Speech::V1::RecognitionConfig]
23
- # *Required* Provides information to the recognizer that specifies how to
24
- # process the request.
25
- # @!attribute [rw] audio
26
- # @return [Google::Cloud::Speech::V1::RecognitionAudio]
27
- # *Required* The audio data to be recognized.
28
- class RecognizeRequest; end
29
-
30
- # The top-level message sent by the client for the `LongRunningRecognize`
31
- # method.
32
- # @!attribute [rw] config
33
- # @return [Google::Cloud::Speech::V1::RecognitionConfig]
34
- # *Required* Provides information to the recognizer that specifies how to
35
- # process the request.
36
- # @!attribute [rw] audio
37
- # @return [Google::Cloud::Speech::V1::RecognitionAudio]
38
- # *Required* The audio data to be recognized.
39
- class LongRunningRecognizeRequest; end
40
-
41
- # The top-level message sent by the client for the `StreamingRecognize` method.
42
- # Multiple `StreamingRecognizeRequest` messages are sent. The first message
43
- # must contain a `streaming_config` message and must not contain `audio` data.
44
- # All subsequent messages must contain `audio` data and must not contain a
45
- # `streaming_config` message.
46
- # @!attribute [rw] streaming_config
47
- # @return [Google::Cloud::Speech::V1::StreamingRecognitionConfig]
48
- # Provides information to the recognizer that specifies how to process the
49
- # request. The first `StreamingRecognizeRequest` message must contain a
50
- # `streaming_config` message.
51
- # @!attribute [rw] audio_content
52
- # @return [String]
53
- # The audio data to be recognized. Sequential chunks of audio data are sent
54
- # in sequential `StreamingRecognizeRequest` messages. The first
55
- # `StreamingRecognizeRequest` message must not contain `audio_content` data
56
- # and all subsequent `StreamingRecognizeRequest` messages must contain
57
- # `audio_content` data. The audio bytes must be encoded as specified in
58
- # `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
59
- # pure binary representation (not base64). See
60
- # [content limits](https://cloud.google.com/speech-to-text/quotas#content).
61
- class StreamingRecognizeRequest; end
62
-
63
- # Provides information to the recognizer that specifies how to process the
64
- # request.
65
- # @!attribute [rw] config
66
- # @return [Google::Cloud::Speech::V1::RecognitionConfig]
67
- # *Required* Provides information to the recognizer that specifies how to
68
- # process the request.
69
- # @!attribute [rw] single_utterance
70
- # @return [true, false]
71
- # *Optional* If `false` or omitted, the recognizer will perform continuous
72
- # recognition (continuing to wait for and process audio even if the user
73
- # pauses speaking) until the client closes the input stream (gRPC API) or
74
- # until the maximum time limit has been reached. May return multiple
75
- # `StreamingRecognitionResult`s with the `is_final` flag set to `true`.
76
- #
77
- # If `true`, the recognizer will detect a single spoken utterance. When it
78
- # detects that the user has paused or stopped speaking, it will return an
79
- # `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no
80
- # more than one `StreamingRecognitionResult` with the `is_final` flag set to
81
- # `true`.
82
- # @!attribute [rw] interim_results
83
- # @return [true, false]
84
- # *Optional* If `true`, interim results (tentative hypotheses) may be
85
- # returned as they become available (these interim results are indicated with
86
- # the `is_final=false` flag).
87
- # If `false` or omitted, only `is_final=true` result(s) are returned.
88
- class StreamingRecognitionConfig; end
89
-
90
- # Provides information to the recognizer that specifies how to process the
91
- # request.
92
- # @!attribute [rw] encoding
93
- # @return [Google::Cloud::Speech::V1::RecognitionConfig::AudioEncoding]
94
- # Encoding of audio data sent in all `RecognitionAudio` messages.
95
- # This field is optional for `FLAC` and `WAV` audio files and required
96
- # for all other audio formats. For details, see {Google::Cloud::Speech::V1::RecognitionConfig::AudioEncoding AudioEncoding}.
97
- # @!attribute [rw] sample_rate_hertz
98
- # @return [Integer]
99
- # Sample rate in Hertz of the audio data sent in all
100
- # `RecognitionAudio` messages. Valid values are: 8000-48000.
101
- # 16000 is optimal. For best results, set the sampling rate of the audio
102
- # source to 16000 Hz. If that's not possible, use the native sample rate of
103
- # the audio source (instead of re-sampling).
104
- # This field is optional for `FLAC` and `WAV` audio files and required
105
- # for all other audio formats. For details, see {Google::Cloud::Speech::V1::RecognitionConfig::AudioEncoding AudioEncoding}.
106
- # @!attribute [rw] language_code
107
- # @return [String]
108
- # *Required* The language of the supplied audio as a
109
- # [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
110
- # Example: "en-US".
111
- # See [Language Support](https://cloud.google.com/speech-to-text/docs/languages)
112
- # for a list of the currently supported language codes.
113
- # @!attribute [rw] max_alternatives
114
- # @return [Integer]
115
- # *Optional* Maximum number of recognition hypotheses to be returned.
116
- # Specifically, the maximum number of `SpeechRecognitionAlternative` messages
117
- # within each `SpeechRecognitionResult`.
118
- # The server may return fewer than `max_alternatives`.
119
- # Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
120
- # one. If omitted, will return a maximum of one.
121
- # @!attribute [rw] profanity_filter
122
- # @return [true, false]
123
- # *Optional* If set to `true`, the server will attempt to filter out
124
- # profanities, replacing all but the initial character in each filtered word
125
- # with asterisks, e.g. "f***". If set to `false` or omitted, profanities
126
- # won't be filtered out.
127
- # @!attribute [rw] speech_contexts
128
- # @return [Array<Google::Cloud::Speech::V1::SpeechContext>]
129
- # *Optional* array of {Google::Cloud::Speech::V1::SpeechContext SpeechContext}.
130
- # A means to provide context to assist the speech recognition. For more
131
- # information, see [Phrase Hints](https://cloud.google.com/speech-to-text/docs/basics#phrase-hints).
132
- # @!attribute [rw] enable_word_time_offsets
133
- # @return [true, false]
134
- # *Optional* If `true`, the top result includes a list of words and
135
- # the start and end time offsets (timestamps) for those words. If
136
- # `false`, no word-level time offset information is returned. The default is
137
- # `false`.
138
- # @!attribute [rw] enable_automatic_punctuation
139
- # @return [true, false]
140
- # *Optional* If 'true', adds punctuation to recognition result hypotheses.
141
- # This feature is only available in select languages. Setting this for
142
- # requests in other languages has no effect at all.
143
- # The default 'false' value does not add punctuation to result hypotheses.
144
- # Note: This is currently offered as an experimental service, complimentary
145
- # to all users. In the future this may be exclusively available as a
146
- # premium feature.
147
- # @!attribute [rw] model
148
- # @return [String]
149
- # *Optional* Which model to select for the given request. Select the model
150
- # best suited to your domain to get best results. If a model is not
151
- # explicitly specified, then we auto-select a model based on the parameters
152
- # in the RecognitionConfig.
153
- # <table>
154
- # <tr>
155
- # <td><b>Model</b></td>
156
- # <td><b>Description</b></td>
157
- # </tr>
158
- # <tr>
159
- # <td><code>command_and_search</code></td>
160
- # <td>Best for short queries such as voice commands or voice search.</td>
161
- # </tr>
162
- # <tr>
163
- # <td><code>phone_call</code></td>
164
- # <td>Best for audio that originated from a phone call (typically
165
- # recorded at an 8khz sampling rate).</td>
166
- # </tr>
167
- # <tr>
168
- # <td><code>video</code></td>
169
- # <td>Best for audio that originated from from video or includes multiple
170
- # speakers. Ideally the audio is recorded at a 16khz or greater
171
- # sampling rate. This is a premium model that costs more than the
172
- # standard rate.</td>
173
- # </tr>
174
- # <tr>
175
- # <td><code>default</code></td>
176
- # <td>Best for audio that is not one of the specific audio models.
177
- # For example, long-form audio. Ideally the audio is high-fidelity,
178
- # recorded at a 16khz or greater sampling rate.</td>
179
- # </tr>
180
- # </table>
181
- # @!attribute [rw] use_enhanced
182
- # @return [true, false]
183
- # *Optional* Set to true to use an enhanced model for speech recognition.
184
- # You must also set the `model` field to a valid, enhanced model. If
185
- # `use_enhanced` is set to true and the `model` field is not set, then
186
- # `use_enhanced` is ignored. If `use_enhanced` is true and an enhanced
187
- # version of the specified model does not exist, then the speech is
188
- # recognized using the standard version of the specified model.
189
- #
190
- # Enhanced speech models require that you opt-in to data logging using
191
- # instructions in the [documentation](https://cloud.google.com/speech-to-text/enable-data-logging).
192
- # If you set `use_enhanced` to true and you have not enabled audio logging,
193
- # then you will receive an error.
194
- class RecognitionConfig
195
- # The encoding of the audio data sent in the request.
196
- #
197
- # All encodings support only 1 channel (mono) audio.
198
- #
199
- # For best results, the audio source should be captured and transmitted using
200
- # a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech
201
- # recognition can be reduced if lossy codecs are used to capture or transmit
202
- # audio, particularly if background noise is present. Lossy codecs include
203
- # `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, and `SPEEX_WITH_HEADER_BYTE`.
204
- #
205
- # The `FLAC` and `WAV` audio file formats include a header that describes the
206
- # included audio content. You can request recognition for `WAV` files that
207
- # contain either `LINEAR16` or `MULAW` encoded audio.
208
- # If you send `FLAC` or `WAV` audio file format in
209
- # your request, you do not need to specify an `AudioEncoding`; the audio
210
- # encoding format is determined from the file header. If you specify
211
- # an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the
212
- # encoding configuration must match the encoding described in the audio
213
- # header; otherwise the request returns an
214
- # {Google::Rpc::Code::INVALID_ARGUMENT} error code.
215
- module AudioEncoding
216
- # Not specified.
217
- ENCODING_UNSPECIFIED = 0
218
-
219
- # Uncompressed 16-bit signed little-endian samples (Linear PCM).
220
- LINEAR16 = 1
221
-
222
- # `FLAC` (Free Lossless Audio
223
- # Codec) is the recommended encoding because it is
224
- # lossless--therefore recognition is not compromised--and
225
- # requires only about half the bandwidth of `LINEAR16`. `FLAC` stream
226
- # encoding supports 16-bit and 24-bit samples, however, not all fields in
227
- # `STREAMINFO` are supported.
228
- FLAC = 2
229
-
230
- # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
231
- MULAW = 3
232
-
233
- # Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.
234
- AMR = 4
235
-
236
- # Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.
237
- AMR_WB = 5
238
-
239
- # Opus encoded audio frames in Ogg container
240
- # ([OggOpus](https://wiki.xiph.org/OggOpus)).
241
- # `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
242
- OGG_OPUS = 6
243
-
244
- # Although the use of lossy encodings is not recommended, if a very low
245
- # bitrate encoding is required, `OGG_OPUS` is highly preferred over
246
- # Speex encoding. The [Speex](https://speex.org/) encoding supported by
247
- # Cloud Speech API has a header byte in each block, as in MIME type
248
- # `audio/x-speex-with-header-byte`.
249
- # It is a variant of the RTP Speex encoding defined in
250
- # [RFC 5574](https://tools.ietf.org/html/rfc5574).
251
- # The stream is a sequence of blocks, one block per RTP packet. Each block
252
- # starts with a byte containing the length of the block, in bytes, followed
253
- # by one or more frames of Speex data, padded to an integral number of
254
- # bytes (octets) as specified in RFC 5574. In other words, each RTP header
255
- # is replaced with a single byte containing the block length. Only Speex
256
- # wideband is supported. `sample_rate_hertz` must be 16000.
257
- SPEEX_WITH_HEADER_BYTE = 7
258
- end
259
- end
260
-
261
- # Provides "hints" to the speech recognizer to favor specific words and phrases
262
- # in the results.
263
- # @!attribute [rw] phrases
264
- # @return [Array<String>]
265
- # *Optional* A list of strings containing words and phrases "hints" so that
266
- # the speech recognition is more likely to recognize them. This can be used
267
- # to improve the accuracy for specific words and phrases, for example, if
268
- # specific commands are typically spoken by the user. This can also be used
269
- # to add additional words to the vocabulary of the recognizer. See
270
- # [usage limits](https://cloud.google.com/speech-to-text/quotas#content).
271
- class SpeechContext; end
272
-
273
- # Contains audio data in the encoding specified in the `RecognitionConfig`.
274
- # Either `content` or `uri` must be supplied. Supplying both or neither
275
- # returns {Google::Rpc::Code::INVALID_ARGUMENT}. See
276
- # [content limits](https://cloud.google.com/speech-to-text/quotas#content).
277
- # @!attribute [rw] content
278
- # @return [String]
279
- # The audio data bytes encoded as specified in
280
- # `RecognitionConfig`. Note: as with all bytes fields, protobuffers use a
281
- # pure binary representation, whereas JSON representations use base64.
282
- # @!attribute [rw] uri
283
- # @return [String]
284
- # URI that points to a file that contains audio data bytes as specified in
285
- # `RecognitionConfig`. The file must not be compressed (for example, gzip).
286
- # Currently, only Google Cloud Storage URIs are
287
- # supported, which must be specified in the following format:
288
- # `gs://bucket_name/object_name` (other URI formats return
289
- # {Google::Rpc::Code::INVALID_ARGUMENT}). For more information, see
290
- # [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
291
- class RecognitionAudio; end
292
-
293
- # The only message returned to the client by the `Recognize` method. It
294
- # contains the result as zero or more sequential `SpeechRecognitionResult`
295
- # messages.
296
- # @!attribute [rw] results
297
- # @return [Array<Google::Cloud::Speech::V1::SpeechRecognitionResult>]
298
- # Output only. Sequential list of transcription results corresponding to
299
- # sequential portions of audio.
300
- class RecognizeResponse; end
301
-
302
- # The only message returned to the client by the `LongRunningRecognize` method.
303
- # It contains the result as zero or more sequential `SpeechRecognitionResult`
304
- # messages. It is included in the `result.response` field of the `Operation`
305
- # returned by the `GetOperation` call of the `google::longrunning::Operations`
306
- # service.
307
- # @!attribute [rw] results
308
- # @return [Array<Google::Cloud::Speech::V1::SpeechRecognitionResult>]
309
- # Output only. Sequential list of transcription results corresponding to
310
- # sequential portions of audio.
311
- class LongRunningRecognizeResponse; end
312
-
313
- # Describes the progress of a long-running `LongRunningRecognize` call. It is
314
- # included in the `metadata` field of the `Operation` returned by the
315
- # `GetOperation` call of the `google::longrunning::Operations` service.
316
- # @!attribute [rw] progress_percent
317
- # @return [Integer]
318
- # Approximate percentage of audio processed thus far. Guaranteed to be 100
319
- # when the audio is fully processed and the results are available.
320
- # @!attribute [rw] start_time
321
- # @return [Google::Protobuf::Timestamp]
322
- # Time when the request was received.
323
- # @!attribute [rw] last_update_time
324
- # @return [Google::Protobuf::Timestamp]
325
- # Time of the most recent processing update.
326
- class LongRunningRecognizeMetadata; end
327
-
328
- # `StreamingRecognizeResponse` is the only message returned to the client by
329
- # `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse`
330
- # messages are streamed back to the client. If there is no recognizable
331
- # audio, and `single_utterance` is set to false, then no messages are streamed
332
- # back to the client.
333
- #
334
- # Here's an example of a series of ten `StreamingRecognizeResponse`s that might
335
- # be returned while processing audio:
336
- #
337
- # 1. results { alternatives { transcript: "tube" } stability: 0.01 }
338
- #
339
- # 2. results { alternatives { transcript: "to be a" } stability: 0.01 }
340
- #
341
- # 3. results { alternatives { transcript: "to be" } stability: 0.9 }
342
- # results { alternatives { transcript: " or not to be" } stability: 0.01 }
343
- #
344
- # 4. results { alternatives { transcript: "to be or not to be"
345
- # confidence: 0.92 }
346
- # alternatives { transcript: "to bee or not to bee" }
347
- # is_final: true }
348
- #
349
- # 5. results { alternatives { transcript: " that's" } stability: 0.01 }
350
- #
351
- # 6. results { alternatives { transcript: " that is" } stability: 0.9 }
352
- # results { alternatives { transcript: " the question" } stability: 0.01 }
353
- #
354
- # 7. results { alternatives { transcript: " that is the question"
355
- # confidence: 0.98 }
356
- # alternatives { transcript: " that was the question" }
357
- # is_final: true }
358
- #
359
- # Notes:
360
- #
361
- # * Only two of the above responses #4 and #7 contain final results; they are
362
- # indicated by `is_final: true`. Concatenating these together generates the
363
- # full transcript: "to be or not to be that is the question".
364
- #
365
- # * The others contain interim `results`. #3 and #6 contain two interim
366
- # `results`: the first portion has a high stability and is less likely to
367
- # change; the second portion has a low stability and is very likely to
368
- # change. A UI designer might choose to show only high stability `results`.
369
- #
370
- # * The specific `stability` and `confidence` values shown above are only for
371
- # illustrative purposes. Actual values may vary.
372
- #
373
- # * In each response, only one of these fields will be set:
374
- # `error`,
375
- # `speech_event_type`, or
376
- # one or more (repeated) `results`.
377
- # @!attribute [rw] error
378
- # @return [Google::Rpc::Status]
379
- # Output only. If set, returns a {Google::Rpc::Status} message that
380
- # specifies the error for the operation.
381
- # @!attribute [rw] results
382
- # @return [Array<Google::Cloud::Speech::V1::StreamingRecognitionResult>]
383
- # Output only. This repeated list contains zero or more results that
384
- # correspond to consecutive portions of the audio currently being processed.
385
- # It contains zero or one `is_final=true` result (the newly settled portion),
386
- # followed by zero or more `is_final=false` results (the interim results).
387
- # @!attribute [rw] speech_event_type
388
- # @return [Google::Cloud::Speech::V1::StreamingRecognizeResponse::SpeechEventType]
389
- # Output only. Indicates the type of speech event.
390
- class StreamingRecognizeResponse
391
- # Indicates the type of speech event.
392
- module SpeechEventType
393
- # No speech event specified.
394
- SPEECH_EVENT_UNSPECIFIED = 0
395
-
396
- # This event indicates that the server has detected the end of the user's
397
- # speech utterance and expects no additional speech. Therefore, the server
398
- # will not process additional audio (although it may subsequently return
399
- # additional results). The client should stop sending additional audio
400
- # data, half-close the gRPC connection, and wait for any additional results
401
- # until the server closes the gRPC connection. This event is only sent if
402
- # `single_utterance` was set to `true`, and is not used otherwise.
403
- END_OF_SINGLE_UTTERANCE = 1
404
- end
405
- end
406
-
407
- # A streaming speech recognition result corresponding to a portion of the audio
408
- # that is currently being processed.
409
- # @!attribute [rw] alternatives
410
- # @return [Array<Google::Cloud::Speech::V1::SpeechRecognitionAlternative>]
411
- # Output only. May contain one or more recognition hypotheses (up to the
412
- # maximum specified in `max_alternatives`).
413
- # These alternatives are ordered in terms of accuracy, with the top (first)
414
- # alternative being the most probable, as ranked by the recognizer.
415
- # @!attribute [rw] is_final
416
- # @return [true, false]
417
- # Output only. If `false`, this `StreamingRecognitionResult` represents an
418
- # interim result that may change. If `true`, this is the final time the
419
- # speech service will return this particular `StreamingRecognitionResult`,
420
- # the recognizer will not return any further hypotheses for this portion of
421
- # the transcript and corresponding audio.
422
- # @!attribute [rw] stability
423
- # @return [Float]
424
- # Output only. An estimate of the likelihood that the recognizer will not
425
- # change its guess about this interim result. Values range from 0.0
426
- # (completely unstable) to 1.0 (completely stable).
427
- # This field is only provided for interim results (`is_final=false`).
428
- # The default of 0.0 is a sentinel value indicating `stability` was not set.
429
- class StreamingRecognitionResult; end
430
-
431
- # A speech recognition result corresponding to a portion of the audio.
432
- # @!attribute [rw] alternatives
433
- # @return [Array<Google::Cloud::Speech::V1::SpeechRecognitionAlternative>]
434
- # Output only. May contain one or more recognition hypotheses (up to the
435
- # maximum specified in `max_alternatives`).
436
- # These alternatives are ordered in terms of accuracy, with the top (first)
437
- # alternative being the most probable, as ranked by the recognizer.
438
- class SpeechRecognitionResult; end
439
-
440
- # Alternative hypotheses (a.k.a. n-best list).
441
- # @!attribute [rw] transcript
442
- # @return [String]
443
- # Output only. Transcript text representing the words that the user spoke.
444
- # @!attribute [rw] confidence
445
- # @return [Float]
446
- # Output only. The confidence estimate between 0.0 and 1.0. A higher number
447
- # indicates an estimated greater likelihood that the recognized words are
448
- # correct. This field is set only for the top alternative of a non-streaming
449
- # result or, of a streaming result where `is_final=true`.
450
- # This field is not guaranteed to be accurate and users should not rely on it
451
- # to be always provided.
452
- # The default of 0.0 is a sentinel value indicating `confidence` was not set.
453
- # @!attribute [rw] words
454
- # @return [Array<Google::Cloud::Speech::V1::WordInfo>]
455
- # Output only. A list of word-specific information for each recognized word.
456
- class SpeechRecognitionAlternative; end
457
-
458
- # Word-specific information for recognized words.
459
- # @!attribute [rw] start_time
460
- # @return [Google::Protobuf::Duration]
461
- # Output only. Time offset relative to the beginning of the audio,
462
- # and corresponding to the start of the spoken word.
463
- # This field is only set if `enable_word_time_offsets=true` and only
464
- # in the top hypothesis.
465
- # This is an experimental feature and the accuracy of the time offset can
466
- # vary.
467
- # @!attribute [rw] end_time
468
- # @return [Google::Protobuf::Duration]
469
- # Output only. Time offset relative to the beginning of the audio,
470
- # and corresponding to the end of the spoken word.
471
- # This field is only set if `enable_word_time_offsets=true` and only
472
- # in the top hypothesis.
473
- # This is an experimental feature and the accuracy of the time offset can
474
- # vary.
475
- # @!attribute [rw] word
476
- # @return [String]
477
- # Output only. The word corresponding to this set of information.
478
- class WordInfo; end
479
- end
480
- end
481
- end
482
- end
@@ -1,93 +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
- module Google
17
- module Longrunning
18
- # This resource represents a long-running operation that is the result of a
19
- # network API call.
20
- # @!attribute [rw] name
21
- # @return [String]
22
- # The server-assigned name, which is only unique within the same service that
23
- # originally returns it. If you use the default HTTP mapping, the
24
- # `name` should have the format of `operations/some/unique/name`.
25
- # @!attribute [rw] metadata
26
- # @return [Google::Protobuf::Any]
27
- # Service-specific metadata associated with the operation. It typically
28
- # contains progress information and common metadata such as create time.
29
- # Some services might not provide such metadata. Any method that returns a
30
- # long-running operation should document the metadata type, if any.
31
- # @!attribute [rw] done
32
- # @return [true, false]
33
- # If the value is `false`, it means the operation is still in progress.
34
- # If true, the operation is completed, and either `error` or `response` is
35
- # available.
36
- # @!attribute [rw] error
37
- # @return [Google::Rpc::Status]
38
- # The error result of the operation in case of failure or cancellation.
39
- # @!attribute [rw] response
40
- # @return [Google::Protobuf::Any]
41
- # The normal response of the operation in case of success. If the original
42
- # method returns no data on success, such as `Delete`, the response is
43
- # `google.protobuf.Empty`. If the original method is standard
44
- # `Get`/`Create`/`Update`, the response should be the resource. For other
45
- # methods, the response should have the type `XxxResponse`, where `Xxx`
46
- # is the original method name. For example, if the original method name
47
- # is `TakeSnapshot()`, the inferred response type is
48
- # `TakeSnapshotResponse`.
49
- class Operation; end
50
-
51
- # The request message for {Google::Longrunning::Operations::GetOperation Operations::GetOperation}.
52
- # @!attribute [rw] name
53
- # @return [String]
54
- # The name of the operation resource.
55
- class GetOperationRequest; end
56
-
57
- # The request message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
58
- # @!attribute [rw] name
59
- # @return [String]
60
- # The name of the operation collection.
61
- # @!attribute [rw] filter
62
- # @return [String]
63
- # The standard list filter.
64
- # @!attribute [rw] page_size
65
- # @return [Integer]
66
- # The standard list page size.
67
- # @!attribute [rw] page_token
68
- # @return [String]
69
- # The standard list page token.
70
- class ListOperationsRequest; end
71
-
72
- # The response message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
73
- # @!attribute [rw] operations
74
- # @return [Array<Google::Longrunning::Operation>]
75
- # A list of operations that matches the specified filter in the request.
76
- # @!attribute [rw] next_page_token
77
- # @return [String]
78
- # The standard List next-page token.
79
- class ListOperationsResponse; end
80
-
81
- # The request message for {Google::Longrunning::Operations::CancelOperation Operations::CancelOperation}.
82
- # @!attribute [rw] name
83
- # @return [String]
84
- # The name of the operation resource to be cancelled.
85
- class CancelOperationRequest; end
86
-
87
- # The request message for {Google::Longrunning::Operations::DeleteOperation Operations::DeleteOperation}.
88
- # @!attribute [rw] name
89
- # @return [String]
90
- # The name of the operation resource to be deleted.
91
- class DeleteOperationRequest; end
92
- end
93
- end