forked from GoogleCloudPlatform/python-docs-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspeech-discovery_google_rest_v1.json
342 lines (340 loc) · 17.7 KB
/
speech-discovery_google_rest_v1.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
{
"kind": "discovery#restDescription",
"discoveryVersion": "v1",
"id": "speech:v1",
"name": "speech",
"version": "v1",
"revision": "0",
"title": "Google Cloud Speech API",
"description": "Google Cloud Speech API.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"documentationLink": "https://cloud.google.com/speech",
"protocol": "rest",
"rootUrl": "https://speech.googleapis.com/",
"servicePath": "",
"baseUrl": "https://speech.googleapis.com/",
"batchPath": "batch",
"version_module": "True",
"parameters": {
"access_token": {
"type": "string",
"description": "OAuth access token.",
"location": "query"
},
"alt": {
"type": "string",
"description": "Data format for response.",
"default": "json",
"enum": [
"json",
"media",
"proto"
],
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query"
},
"bearer_token": {
"type": "string",
"description": "OAuth bearer token.",
"location": "query"
},
"callback": {
"type": "string",
"description": "JSONP",
"location": "query"
},
"fields": {
"type": "string",
"description": "Selector specifying which fields to include in a partial response.",
"location": "query"
},
"key": {
"type": "string",
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query"
},
"oauth_token": {
"type": "string",
"description": "OAuth 2.0 token for the current user.",
"location": "query"
},
"pp": {
"type": "boolean",
"description": "Pretty-print response.",
"default": "true",
"location": "query"
},
"prettyPrint": {
"type": "boolean",
"description": "Returns response with indentations and line breaks.",
"default": "true",
"location": "query"
},
"quotaUser": {
"type": "string",
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"location": "query"
},
"upload_protocol": {
"type": "string",
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query"
},
"uploadType": {
"type": "string",
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query"
},
"$.xgafv": {
"type": "string",
"description": "V1 error format.",
"enum": [
"1",
"2"
],
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query"
}
},
"schemas": {
"RecognizeRequest": {
"id": "RecognizeRequest",
"description": "`RecognizeRequest` is the only message type sent by the client.\n\n`NonStreamingRecognize` sends only one `RecognizeRequest` message and it\nmust contain both an `initial_request` and an 'audio_request`.\n\nStreaming `Recognize` sends one or more `RecognizeRequest` messages. The\nfirst message must contain an `initial_request` and may contain an\n'audio_request`. Any subsequent messages must not contain an\n`initial_request` and must contain an 'audio_request`.",
"type": "object",
"properties": {
"initialRequest": {
"description": "The `initial_request` message provides information to the recognizer\nthat specifies how to process the request.\n\nThe first `RecognizeRequest` message must contain an `initial_request`.\nAny subsequent `RecognizeRequest` messages must not contain an\n`initial_request`.",
"$ref": "InitialRecognizeRequest"
},
"audioRequest": {
"description": "The audio data to be recognized. For `NonStreamingRecognize`, all the\naudio data must be contained in the first (and only) `RecognizeRequest`\n message. For streaming `Recognize`, sequential chunks of audio data are\nsent in sequential `RecognizeRequest` messages.",
"$ref": "AudioRequest"
}
}
},
"InitialRecognizeRequest": {
"id": "InitialRecognizeRequest",
"description": "The `InitialRecognizeRequest` message provides information to the recognizer\nthat specifies how to process the request.",
"type": "object",
"properties": {
"encoding": {
"description": "[Required] Encoding of audio data sent in all `AudioRequest` messages.",
"enumDescriptions": [
"Not specified. Will return result `INVALID_ARGUMENT`.",
"Uncompressed 16-bit signed little-endian samples.\nThis is the simplest encoding format, useful for getting started.\nHowever, because it is uncompressed, it is not recommended for deployed\nclients.",
"This is the recommended encoding format because it uses lossless\ncompression; therefore recognition accuracy is not compromised by a lossy\ncodec.\n\nThe stream FLAC format is specified at:\nhttp:\/\/flac.sourceforge.net\/documentation.html.\nOnly 16-bit samples are supported.\nNot all fields in STREAMINFO are supported.",
"8-bit samples that compand 14-bit audio samples using PCMU\/mu-law.",
"Adaptive Multi-Rate Narrowband codec. `sample_rate` must be 8000 Hz.",
"Adaptive Multi-Rate Wideband codec. `sample_rate` must be 16000 Hz."
],
"type": "string",
"enum": [
"ENCODING_UNSPECIFIED",
"LINEAR16",
"FLAC",
"MULAW",
"AMR",
"AMR_WB"
]
},
"sampleRate": {
"description": "[Required] Sample rate in Hertz of the audio data sent in all\nAudioRequest messages.\n16000 is optimal. Valid values are: 8000-48000.",
"type": "integer",
"format": "int32"
},
"languageCode": {
"description": "[Optional] The language of the supplied audio as a BCP-47 language tag.\nExample: \"en-GB\" https:\/\/www.rfc-editor.org\/rfc\/bcp\/bcp47.txt\nIf omitted, defaults to \"en-US\".",
"type": "string"
},
"maxAlternatives": {
"description": "[Optional] Maximum number of recognition hypotheses to be returned.\nSpecifically, the maximum number of `SpeechRecognitionAlternative` messages\nwithin each `SpeechRecognitionResult`.\nThe server may return fewer than `max_alternatives`.\nValid values are `0`-`30`. A value of `0` or `1` will return a maximum of\n`1`. If omitted, defaults to `1`.",
"type": "integer",
"format": "int32"
},
"profanityFilter": {
"description": "[Optional] If set to `true`, the server will attempt to filter out\nprofanities, replacing all but the initial character in each filtered word\nwith asterisks, e.g. \"f***\". If set to `false` or omitted, profanities\nwon't be filtered out.\nNote that profanity filtering is not implemented for all languages.\nIf the language is not supported, this setting has no effect.",
"type": "boolean"
},
"continuous": {
"description": "[Optional] If `false` or omitted, the recognizer will detect a single\nspoken utterance, and it will cease recognition when the user stops\nspeaking. If `enable_endpointer_events` is `true`, it will return\n`END_OF_UTTERANCE` when it detects that the user has stopped speaking.\nIn all cases, it will return no more than one `SpeechRecognitionResult`,\nand set the `is_final` flag to `true`.\n\nIf `true`, the recognizer will continue recognition (even if the user\npauses speaking) until the client sends an `end_of_data` message or when\nthe maximum time limit has been reached. Multiple\n`SpeechRecognitionResult`s with the `is_final` flag set to `true` may be\nreturned to indicate that the recognizer will not return any further\nhypotheses for this portion of the transcript.",
"type": "boolean"
},
"interimResults": {
"description": "[Optional] If this parameter is `true`, interim results may be returned as\nthey become available.\nIf `false` or omitted, only `is_final=true` result(s) are returned.",
"type": "boolean"
},
"enableEndpointerEvents": {
"description": "[Optional] If this parameter is `true`, `EndpointerEvents` may be returned\nas they become available.\nIf `false` or omitted, no `EndpointerEvents` are returned.",
"type": "boolean"
}
}
},
"AudioRequest": {
"id": "AudioRequest",
"description": "Contains audio data in the format specified in the `InitialRecognizeRequest`.",
"type": "object",
"properties": {
"content": {
"description": "[Required] The audio data bytes encoded as specified in\n`InitialRecognizeRequest`.",
"type": "string",
"format": "byte"
}
}
},
"NonStreamingRecognizeResponse": {
"id": "NonStreamingRecognizeResponse",
"description": "`NonStreamingRecognizeResponse` is the only message returned to the client by\n`NonStreamingRecognize`. It contains the result as zero or more sequential\n`RecognizeResponse` messages.\n\nNote that streaming `Recognize` will also return multiple `RecognizeResponse`\nmessages, but each message is individually streamed.",
"type": "object",
"properties": {
"responses": {
"description": "[Output-only] Sequential list of messages returned by the recognizer.",
"type": "array",
"items": {
"$ref": "RecognizeResponse"
}
}
}
},
"RecognizeResponse": {
"id": "RecognizeResponse",
"description": "`RecognizeResponse` is the only message type returned to the client.",
"type": "object",
"properties": {
"error": {
"description": "[Output-only] If set, returns a google.rpc.Status message that\nspecifies the error for the operation.",
"$ref": "Status"
},
"results": {
"description": "[Output-only] May contain zero or one `is_final=true` result (the newly\nsettled portion). May also contain zero or more `is_final=false` results.",
"type": "array",
"items": {
"$ref": "SpeechRecognitionResult"
}
},
"resultIndex": {
"description": "[Output-only] Indicates the lowest index in the `results` array that has\nchanged. The repeated `SpeechRecognitionResult` results overwrite past\nresults at this index and higher.",
"type": "integer",
"format": "int32"
},
"endpoint": {
"description": "[Output-only] Indicates the type of endpointer event.",
"enumDescriptions": [
"No endpointer event specified.",
"Speech has been detected in the audio stream.",
"Speech has ceased to be detected in the audio stream.",
"The end of the audio stream has been reached. and it is being processed.",
"This event is only sent when continuous is `false`. It indicates that the\nserver has detected the end of the user's speech utterance and expects no\nadditional speech. Therefore, the server will not process additional\naudio. The client should stop sending additional audio data."
],
"type": "string",
"enum": [
"ENDPOINTER_EVENT_UNSPECIFIED",
"START_OF_SPEECH",
"END_OF_SPEECH",
"END_OF_AUDIO",
"END_OF_UTTERANCE"
]
}
}
},
"Status": {
"id": "Status",
"description": "The `Status` type defines a logical error model that is suitable for different\nprogramming environments, including REST APIs and RPC APIs. It is used by\n[gRPC](https:\/\/github.com\/grpc). The error model is designed to be:\n\n- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error message,\nand error details. The error code should be an enum value of\ngoogle.rpc.Code, but it may accept additional error codes if needed. The\nerror message should be a developer-facing English message that helps\ndevelopers *understand* and *resolve* the error. If a localized user-facing\nerror message is needed, put the localized message in the error details or\nlocalize it in the client. The optional error details may contain arbitrary\ninformation about the error. There is a predefined set of error detail types\nin the package `google.rpc` which can be used for common error conditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting purpose.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security\/privacy reasons.",
"type": "object",
"properties": {
"code": {
"description": "The status code, which should be an enum value of google.rpc.Code.",
"type": "integer",
"format": "int32"
},
"message": {
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\ngoogle.rpc.Status.details field, or localized by the client.",
"type": "string"
},
"details": {
"description": "A list of messages that carry the error details. There will be a\ncommon set of message types for APIs to use.",
"type": "array",
"items": {
"type": "object",
"additionalProperties": {
"type": "any",
"description": "Properties of the object. Contains field @ype with type URL."
}
}
}
}
},
"SpeechRecognitionResult": {
"id": "SpeechRecognitionResult",
"type": "object",
"properties": {
"alternatives": {
"type": "array",
"items": {
"$ref": "SpeechRecognitionAlternative"
}
},
"isFinal": {
"description": "[Output-only] Set `true` if this is the final time the speech service will\nreturn this particular `SpeechRecognitionResult`. If `false`, this\nrepresents an interim result that may change.",
"type": "boolean"
},
"stability": {
"description": "[Output-only] An estimate of the probability that the recognizer will not\nchange its guess about this interim result. Values range from 0.0\n(completely unstable) to 1.0 (completely stable). Note that this is not the\nsame as `confidence`, which estimates the probability that a recognition\nresult is correct.\nThis field is only provided for interim results (`is_final=false`).\nThe default of 0.0 is a sentinel value indicating stability was not set.",
"type": "number",
"format": "float"
}
}
},
"SpeechRecognitionAlternative": {
"id": "SpeechRecognitionAlternative",
"description": "Alternative hypotheses (a.k.a. n-best list).",
"type": "object",
"properties": {
"transcript": {
"description": "[Output-only] Transcript text representing the words that the user spoke.",
"type": "string"
},
"confidence": {
"description": "[Output-only] The confidence estimate between 0.0 and 1.0. A higher number\nmeans the system is more confident that the recognition is correct.\nThis field is typically provided only for the top hypothesis. and only for\n`is_final=true` results.\nThe default of 0.0 is a sentinel value indicating confidence was not set.",
"type": "number",
"format": "float"
}
}
}
},
"resources": {
"speech": {
"methods": {
"recognize": {
"id": "speech.speech.recognize",
"path": "v1/speech:recognize",
"flatPath": "v1/speech:recognize",
"httpMethod": "POST",
"description": "Perform non-streaming speech recognition on audio using HTTPS.",
"parameters": {
},
"parameterOrder": [
],
"request": {
"$ref": "RecognizeRequest"
},
"response": {
"$ref": "NonStreamingRecognizeResponse"
}
}
}
}
},
"basePath": ""
}