-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
cloud_speech.proto
2036 lines (1755 loc) · 80.2 KB
/
cloud_speech.proto
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.speech.v2;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";
option go_package = "cloud.google.com/go/speech/apiv2/speechpb;speechpb";
option java_multiple_files = true;
option java_outer_classname = "CloudSpeechProto";
option java_package = "com.google.cloud.speech.v2";
option (google.api.resource_definition) = {
type: "cloudkms.googleapis.com/CryptoKey"
pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
};
option (google.api.resource_definition) = {
type: "cloudkms.googleapis.com/CryptoKeyVersion"
pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"
};
// Enables speech transcription and resource management.
service Speech {
option (google.api.default_host) = "speech.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Creates a [Recognizer][google.cloud.speech.v2.Recognizer].
rpc CreateRecognizer(CreateRecognizerRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/locations/*}/recognizers"
body: "recognizer"
};
option (google.api.method_signature) = "parent,recognizer,recognizer_id";
option (google.longrunning.operation_info) = {
response_type: "Recognizer"
metadata_type: "OperationMetadata"
};
}
// Lists Recognizers.
rpc ListRecognizers(ListRecognizersRequest)
returns (ListRecognizersResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/locations/*}/recognizers"
};
option (google.api.method_signature) = "parent";
}
// Returns the requested
// [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
// exist.
rpc GetRecognizer(GetRecognizerRequest) returns (Recognizer) {
option (google.api.http) = {
get: "/v2/{name=projects/*/locations/*/recognizers/*}"
};
option (google.api.method_signature) = "name";
}
// Updates the [Recognizer][google.cloud.speech.v2.Recognizer].
rpc UpdateRecognizer(UpdateRecognizerRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v2/{recognizer.name=projects/*/locations/*/recognizers/*}"
body: "recognizer"
};
option (google.api.method_signature) = "recognizer,update_mask";
option (google.longrunning.operation_info) = {
response_type: "Recognizer"
metadata_type: "OperationMetadata"
};
}
// Deletes the [Recognizer][google.cloud.speech.v2.Recognizer].
rpc DeleteRecognizer(DeleteRecognizerRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/locations/*/recognizers/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "Recognizer"
metadata_type: "OperationMetadata"
};
}
// Undeletes the [Recognizer][google.cloud.speech.v2.Recognizer].
rpc UndeleteRecognizer(UndeleteRecognizerRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{name=projects/*/locations/*/recognizers/*}:undelete"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "Recognizer"
metadata_type: "OperationMetadata"
};
}
// Performs synchronous Speech recognition: receive results after all audio
// has been sent and processed.
rpc Recognize(RecognizeRequest) returns (RecognizeResponse) {
option (google.api.http) = {
post: "/v2/{recognizer=projects/*/locations/*/recognizers/*}:recognize"
body: "*"
};
option (google.api.method_signature) =
"recognizer,config,config_mask,content";
option (google.api.method_signature) = "recognizer,config,config_mask,uri";
}
// Performs bidirectional streaming speech recognition: receive results while
// sending audio. This method is only available via the gRPC API (not REST).
rpc StreamingRecognize(stream StreamingRecognizeRequest)
returns (stream StreamingRecognizeResponse) {}
// Performs batch asynchronous speech recognition: send a request with N
// audio files and receive a long running operation that can be polled to see
// when the transcriptions are finished.
rpc BatchRecognize(BatchRecognizeRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{recognizer=projects/*/locations/*/recognizers/*}:batchRecognize"
body: "*"
};
option (google.api.method_signature) =
"recognizer,config,config_mask,files";
option (google.longrunning.operation_info) = {
response_type: "BatchRecognizeResponse"
metadata_type: "OperationMetadata"
};
}
// Returns the requested [Config][google.cloud.speech.v2.Config].
rpc GetConfig(GetConfigRequest) returns (Config) {
option (google.api.http) = {
get: "/v2/{name=projects/*/locations/*/config}"
};
option (google.api.method_signature) = "name";
}
// Updates the [Config][google.cloud.speech.v2.Config].
rpc UpdateConfig(UpdateConfigRequest) returns (Config) {
option (google.api.http) = {
patch: "/v2/{config.name=projects/*/locations/*/config}"
body: "config"
};
option (google.api.method_signature) = "config,update_mask";
}
// Creates a [CustomClass][google.cloud.speech.v2.CustomClass].
rpc CreateCustomClass(CreateCustomClassRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/locations/*}/customClasses"
body: "custom_class"
};
option (google.api.method_signature) =
"parent,custom_class,custom_class_id";
option (google.longrunning.operation_info) = {
response_type: "CustomClass"
metadata_type: "OperationMetadata"
};
}
// Lists CustomClasses.
rpc ListCustomClasses(ListCustomClassesRequest)
returns (ListCustomClassesResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/locations/*}/customClasses"
};
option (google.api.method_signature) = "parent";
}
// Returns the requested
// [CustomClass][google.cloud.speech.v2.CustomClass].
rpc GetCustomClass(GetCustomClassRequest) returns (CustomClass) {
option (google.api.http) = {
get: "/v2/{name=projects/*/locations/*/customClasses/*}"
};
option (google.api.method_signature) = "name";
}
// Updates the [CustomClass][google.cloud.speech.v2.CustomClass].
rpc UpdateCustomClass(UpdateCustomClassRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v2/{custom_class.name=projects/*/locations/*/customClasses/*}"
body: "custom_class"
};
option (google.api.method_signature) = "custom_class,update_mask";
option (google.longrunning.operation_info) = {
response_type: "CustomClass"
metadata_type: "OperationMetadata"
};
}
// Deletes the [CustomClass][google.cloud.speech.v2.CustomClass].
rpc DeleteCustomClass(DeleteCustomClassRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/locations/*/customClasses/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "CustomClass"
metadata_type: "OperationMetadata"
};
}
// Undeletes the [CustomClass][google.cloud.speech.v2.CustomClass].
rpc UndeleteCustomClass(UndeleteCustomClassRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{name=projects/*/locations/*/customClasses/*}:undelete"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "CustomClass"
metadata_type: "OperationMetadata"
};
}
// Creates a [PhraseSet][google.cloud.speech.v2.PhraseSet].
rpc CreatePhraseSet(CreatePhraseSetRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{parent=projects/*/locations/*}/phraseSets"
body: "phrase_set"
};
option (google.api.method_signature) = "parent,phrase_set,phrase_set_id";
option (google.longrunning.operation_info) = {
response_type: "PhraseSet"
metadata_type: "OperationMetadata"
};
}
// Lists PhraseSets.
rpc ListPhraseSets(ListPhraseSetsRequest) returns (ListPhraseSetsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/locations/*}/phraseSets"
};
option (google.api.method_signature) = "parent";
}
// Returns the requested
// [PhraseSet][google.cloud.speech.v2.PhraseSet].
rpc GetPhraseSet(GetPhraseSetRequest) returns (PhraseSet) {
option (google.api.http) = {
get: "/v2/{name=projects/*/locations/*/phraseSets/*}"
};
option (google.api.method_signature) = "name";
}
// Updates the [PhraseSet][google.cloud.speech.v2.PhraseSet].
rpc UpdatePhraseSet(UpdatePhraseSetRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v2/{phrase_set.name=projects/*/locations/*/phraseSets/*}"
body: "phrase_set"
};
option (google.api.method_signature) = "phrase_set,update_mask";
option (google.longrunning.operation_info) = {
response_type: "PhraseSet"
metadata_type: "OperationMetadata"
};
}
// Deletes the [PhraseSet][google.cloud.speech.v2.PhraseSet].
rpc DeletePhraseSet(DeletePhraseSetRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v2/{name=projects/*/locations/*/phraseSets/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "PhraseSet"
metadata_type: "OperationMetadata"
};
}
// Undeletes the [PhraseSet][google.cloud.speech.v2.PhraseSet].
rpc UndeletePhraseSet(UndeletePhraseSetRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{name=projects/*/locations/*/phraseSets/*}:undelete"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "PhraseSet"
metadata_type: "OperationMetadata"
};
}
}
// Request message for the
// [CreateRecognizer][google.cloud.speech.v2.Speech.CreateRecognizer] method.
message CreateRecognizerRequest {
// Required. The Recognizer to create.
Recognizer recognizer = 1 [(google.api.field_behavior) = REQUIRED];
// If set, validate the request and preview the Recognizer, but do not
// actually create it.
bool validate_only = 2;
// The ID to use for the Recognizer, which will become the final component of
// the Recognizer's resource name.
//
// This value should be 4-63 characters, and valid characters
// are /[a-z][0-9]-/.
string recognizer_id = 3;
// Required. The project and location where this Recognizer will be created.
// The expected format is `projects/{project}/locations/{location}`.
string parent = 4 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "speech.googleapis.com/Recognizer"
}
];
}
// Represents the metadata of a long-running operation.
message OperationMetadata {
// The time the operation was created.
google.protobuf.Timestamp create_time = 1;
// The time the operation was last updated.
google.protobuf.Timestamp update_time = 2;
// The resource path for the target of the operation.
string resource = 3;
// The method that triggered the operation.
string method = 4;
// The [KMS key
// name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which
// the content of the Operation is encrypted. The expected format is
// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
string kms_key_name = 6 [(google.api.resource_reference) = {
type: "cloudkms.googleapis.com/CryptoKey"
}];
// The [KMS key version
// name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions)
// with which content of the Operation is encrypted. The expected format is
// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`.
string kms_key_version_name = 7 [(google.api.resource_reference) = {
type: "cloudkms.googleapis.com/CryptoKeyVersion"
}];
// The request that spawned the Operation.
oneof request {
// The BatchRecognizeRequest that spawned the Operation.
BatchRecognizeRequest batch_recognize_request = 8;
// The CreateRecognizerRequest that spawned the Operation.
CreateRecognizerRequest create_recognizer_request = 9;
// The UpdateRecognizerRequest that spawned the Operation.
UpdateRecognizerRequest update_recognizer_request = 10;
// The DeleteRecognizerRequest that spawned the Operation.
DeleteRecognizerRequest delete_recognizer_request = 11;
// The UndeleteRecognizerRequest that spawned the Operation.
UndeleteRecognizerRequest undelete_recognizer_request = 12;
// The CreateCustomClassRequest that spawned the Operation.
CreateCustomClassRequest create_custom_class_request = 13;
// The UpdateCustomClassRequest that spawned the Operation.
UpdateCustomClassRequest update_custom_class_request = 14;
// The DeleteCustomClassRequest that spawned the Operation.
DeleteCustomClassRequest delete_custom_class_request = 15;
// The UndeleteCustomClassRequest that spawned the Operation.
UndeleteCustomClassRequest undelete_custom_class_request = 16;
// The CreatePhraseSetRequest that spawned the Operation.
CreatePhraseSetRequest create_phrase_set_request = 17;
// The UpdatePhraseSetRequest that spawned the Operation.
UpdatePhraseSetRequest update_phrase_set_request = 18;
// The DeletePhraseSetRequest that spawned the Operation.
DeletePhraseSetRequest delete_phrase_set_request = 19;
// The UndeletePhraseSetRequest that spawned the Operation.
UndeletePhraseSetRequest undelete_phrase_set_request = 20;
// The UpdateConfigRequest that spawned the Operation.
UpdateConfigRequest update_config_request = 21 [deprecated = true];
}
// The percent progress of the Operation. Values can range from 0-100. If the
// value is 100, then the operation is finished.
int32 progress_percent = 22;
// Specific metadata per RPC.
oneof metadata {
// Metadata specific to the BatchRecognize method.
BatchRecognizeMetadata batch_recognize_metadata = 23;
}
}
// Request message for the
// [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] method.
message ListRecognizersRequest {
// Required. The project and location of Recognizers to list. The expected
// format is `projects/{project}/locations/{location}`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// The maximum number of Recognizers to return. The service may return fewer
// than this value. If unspecified, at most 5 Recognizers will be returned.
// The maximum value is 100; values above 100 will be coerced to 100.
int32 page_size = 2;
// A page token, received from a previous
// [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] call.
// Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to
// [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] must match
// the call that provided the page token.
string page_token = 3;
// Whether, or not, to show resources that have been deleted.
bool show_deleted = 4;
}
// Response message for the
// [ListRecognizers][google.cloud.speech.v2.Speech.ListRecognizers] method.
message ListRecognizersResponse {
// The list of requested Recognizers.
repeated Recognizer recognizers = 1;
// A token, which can be sent as
// [page_token][google.cloud.speech.v2.ListRecognizersRequest.page_token] to
// retrieve the next page. If this field is omitted, there are no subsequent
// pages. This token expires after 72 hours.
string next_page_token = 2;
}
// Request message for the
// [GetRecognizer][google.cloud.speech.v2.Speech.GetRecognizer] method.
message GetRecognizerRequest {
// Required. The name of the Recognizer to retrieve. The expected format is
// `projects/{project}/locations/{location}/recognizers/{recognizer}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "speech.googleapis.com/Recognizer"
}
];
}
// Request message for the
// [UpdateRecognizer][google.cloud.speech.v2.Speech.UpdateRecognizer] method.
message UpdateRecognizerRequest {
// Required. The Recognizer to update.
//
// The Recognizer's `name` field is used to identify the Recognizer to update.
// Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`.
Recognizer recognizer = 1 [(google.api.field_behavior) = REQUIRED];
// The list of fields to update. If empty, all non-default valued fields are
// considered for update. Use `*` to update the entire Recognizer resource.
google.protobuf.FieldMask update_mask = 2;
// If set, validate the request and preview the updated Recognizer, but do not
// actually update it.
bool validate_only = 4;
}
// Request message for the
// [DeleteRecognizer][google.cloud.speech.v2.Speech.DeleteRecognizer] method.
message DeleteRecognizerRequest {
// Required. The name of the Recognizer to delete.
// Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "speech.googleapis.com/Recognizer"
}
];
// If set, validate the request and preview the deleted Recognizer, but do not
// actually delete it.
bool validate_only = 2;
// If set to true, and the Recognizer is not found, the request will succeed
// and be a no-op (no Operation is recorded in this case).
bool allow_missing = 4;
// This checksum is computed by the server based on the value of other
// fields. This may be sent on update, undelete, and delete requests to ensure
// the client has an up-to-date value before proceeding.
string etag = 3;
}
// Request message for the
// [UndeleteRecognizer][google.cloud.speech.v2.Speech.UndeleteRecognizer]
// method.
message UndeleteRecognizerRequest {
// Required. The name of the Recognizer to undelete.
// Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "speech.googleapis.com/Recognizer"
}
];
// If set, validate the request and preview the undeleted Recognizer, but do
// not actually undelete it.
bool validate_only = 3;
// This checksum is computed by the server based on the value of other
// fields. This may be sent on update, undelete, and delete requests to ensure
// the client has an up-to-date value before proceeding.
string etag = 4;
}
// A Recognizer message. Stores recognition configuration and metadata.
message Recognizer {
option (google.api.resource) = {
type: "speech.googleapis.com/Recognizer"
pattern: "projects/{project}/locations/{location}/recognizers/{recognizer}"
style: DECLARATIVE_FRIENDLY
};
// Set of states that define the lifecycle of a Recognizer.
enum State {
// The default value. This value is used if the state is omitted.
STATE_UNSPECIFIED = 0;
// The Recognizer is active and ready for use.
ACTIVE = 2;
// This Recognizer has been deleted.
DELETED = 4;
}
// Output only. The resource name of the Recognizer.
// Format: `projects/{project}/locations/{location}/recognizers/{recognizer}`.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. System-assigned unique identifier for the Recognizer.
string uid = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// User-settable, human-readable name for the Recognizer. Must be 63
// characters or less.
string display_name = 3;
// Required. Which model to use for recognition requests. Select the model
// best suited to your domain to get best results.
//
// Guidance for choosing which model to use can be found in the [Transcription
// Models
// Documentation](https://cloud.google.com/speech-to-text/v2/docs/transcription-model)
// and the models supported in each region can be found in the [Table Of
// Supported
// Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
string model = 4 [(google.api.field_behavior) = REQUIRED];
// Required. The language of the supplied audio as a
// [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag.
//
// Supported languages for each model are listed in the [Table of Supported
// Models](https://cloud.google.com/speech-to-text/v2/docs/speech-to-text-supported-languages).
//
// If additional languages are provided, recognition result will contain
// recognition in the most likely language detected. The recognition result
// will include the language tag of the language detected in the audio.
// When you create or update a Recognizer, these values are
// stored in normalized BCP-47 form. For example, "en-us" is stored as
// "en-US".
repeated string language_codes = 17 [(google.api.field_behavior) = REQUIRED];
// Default configuration to use for requests with this Recognizer.
// This can be overwritten by inline configuration in the
// [RecognizeRequest.config][google.cloud.speech.v2.RecognizeRequest.config]
// field.
RecognitionConfig default_recognition_config = 6;
// Allows users to store small amounts of arbitrary data.
// Both the key and the value must be 63 characters or less each.
// At most 100 annotations.
map<string, string> annotations = 7;
// Output only. The Recognizer lifecycle state.
State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Creation time.
google.protobuf.Timestamp create_time = 9
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The most recent time this Recognizer was modified.
google.protobuf.Timestamp update_time = 10
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time at which this Recognizer was requested for deletion.
google.protobuf.Timestamp delete_time = 11
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time at which this Recognizer will be purged.
google.protobuf.Timestamp expire_time = 14
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. This checksum is computed by the server based on the value of
// other fields. This may be sent on update, undelete, and delete requests to
// ensure the client has an up-to-date value before proceeding.
string etag = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Whether or not this Recognizer is in the process of being
// updated.
bool reconciling = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The [KMS key
// name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which
// the Recognizer is encrypted. The expected format is
// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
string kms_key_name = 15 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
type: "cloudkms.googleapis.com/CryptoKey"
}
];
// Output only. The [KMS key version
// name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions)
// with which the Recognizer is encrypted. The expected format is
// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`.
string kms_key_version_name = 16 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
type: "cloudkms.googleapis.com/CryptoKeyVersion"
}
];
}
// Automatically detected decoding parameters.
// Supported for the following encodings:
//
// * WAV_LINEAR16: 16-bit signed little-endian PCM samples in a WAV container.
//
// * WAV_MULAW: 8-bit companded mulaw samples in a WAV container.
//
// * WAV_ALAW: 8-bit companded alaw samples in a WAV container.
//
// * RFC4867_5_AMR: AMR frames with an rfc4867.5 header.
//
// * RFC4867_5_AMRWB: AMR-WB frames with an rfc4867.5 header.
//
// * FLAC: FLAC frames in the "native FLAC" container format.
//
// * MP3: MPEG audio frames with optional (ignored) ID3 metadata.
//
// * OGG_OPUS: Opus audio frames in an Ogg container.
//
// * WEBM_OPUS: Opus audio frames in a WebM container.
message AutoDetectDecodingConfig {}
// Explicitly specified decoding parameters.
message ExplicitDecodingConfig {
// Supported audio data encodings.
enum AudioEncoding {
// Default value. This value is unused.
AUDIO_ENCODING_UNSPECIFIED = 0;
// Headerless 16-bit signed little-endian PCM samples.
LINEAR16 = 1;
// Headerless 8-bit companded mulaw samples.
MULAW = 2;
// Headerless 8-bit companded alaw samples.
ALAW = 3;
}
// Required. Encoding of the audio data sent for recognition.
AudioEncoding encoding = 1 [(google.api.field_behavior) = REQUIRED];
// Sample rate in Hertz of the audio data sent for recognition. Valid
// values are: 8000-48000. 16000 is optimal. For best results, set the
// sampling rate of the audio source to 16000 Hz. If that's not possible, use
// the native sample rate of the audio source (instead of re-sampling).
// Supported for the following encodings:
//
// * LINEAR16: Headerless 16-bit signed little-endian PCM samples.
//
// * MULAW: Headerless 8-bit companded mulaw samples.
//
// * ALAW: Headerless 8-bit companded alaw samples.
int32 sample_rate_hertz = 2;
// Number of channels present in the audio data sent for recognition.
// Supported for the following encodings:
//
// * LINEAR16: Headerless 16-bit signed little-endian PCM samples.
//
// * MULAW: Headerless 8-bit companded mulaw samples.
//
// * ALAW: Headerless 8-bit companded alaw samples.
//
// The maximum allowed value is 8.
int32 audio_channel_count = 3;
}
// Configuration to enable speaker diarization.
message SpeakerDiarizationConfig {
// Required. Minimum number of speakers in the conversation. This range gives
// you more flexibility by allowing the system to automatically determine the
// correct number of speakers.
//
// To fix the number of speakers detected in the audio, set
// `min_speaker_count` = `max_speaker_count`.
int32 min_speaker_count = 2 [(google.api.field_behavior) = REQUIRED];
// Required. Maximum number of speakers in the conversation. Valid values are:
// 1-6. Must be >= `min_speaker_count`. This range gives you more flexibility
// by allowing the system to automatically determine the correct number of
// speakers.
int32 max_speaker_count = 3 [(google.api.field_behavior) = REQUIRED];
}
// Available recognition features.
message RecognitionFeatures {
// Options for how to recognize multi-channel audio.
enum MultiChannelMode {
// Default value for the multi-channel mode. If the audio contains
// multiple channels, only the first channel will be transcribed; other
// channels will be ignored.
MULTI_CHANNEL_MODE_UNSPECIFIED = 0;
// If selected, each channel in the provided audio is transcribed
// independently. This cannot be selected if the selected
// [model][google.cloud.speech.v2.Recognizer.model] is `latest_short`.
SEPARATE_RECOGNITION_PER_CHANNEL = 1;
}
// If set to `true`, the server will attempt to filter out profanities,
// replacing all but the initial character in each filtered word with
// asterisks, for instance, "f***". If set to `false` or omitted, profanities
// won't be filtered out.
bool profanity_filter = 1;
// If `true`, the top result includes a list of words and the start and end
// time offsets (timestamps) for those words. If `false`, no word-level time
// offset information is returned. The default is `false`.
bool enable_word_time_offsets = 2;
// If `true`, the top result includes a list of words and the confidence for
// those words. If `false`, no word-level confidence information is returned.
// The default is `false`.
bool enable_word_confidence = 3;
// If `true`, adds punctuation to recognition result hypotheses. This feature
// is only available in select languages. The default `false` value does not
// add punctuation to result hypotheses.
bool enable_automatic_punctuation = 4;
// The spoken punctuation behavior for the call. If `true`, replaces spoken
// punctuation with the corresponding symbols in the request. For example,
// "how are you question mark" becomes "how are you?". See
// https://cloud.google.com/speech-to-text/docs/spoken-punctuation for
// support. If `false`, spoken punctuation is not replaced.
bool enable_spoken_punctuation = 14;
// The spoken emoji behavior for the call. If `true`, adds spoken emoji
// formatting for the request. This will replace spoken emojis with the
// corresponding Unicode symbols in the final transcript. If `false`, spoken
// emojis are not replaced.
bool enable_spoken_emojis = 15;
// Mode for recognizing multi-channel audio.
MultiChannelMode multi_channel_mode = 17;
// Configuration to enable speaker diarization and set additional
// parameters to make diarization better suited for your application.
// When this is enabled, we send all the words from the beginning of the
// audio for the top alternative in every consecutive STREAMING responses.
// This is done in order to improve our speaker tags as our models learn to
// identify the speakers in the conversation over time.
// For non-streaming requests, the diarization results will be provided only
// in the top alternative of the FINAL SpeechRecognitionResult.
SpeakerDiarizationConfig diarization_config = 9;
// Maximum number of recognition hypotheses to be returned.
// The server may return fewer than `max_alternatives`.
// Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of
// one. If omitted, will return a maximum of one.
int32 max_alternatives = 16;
}
// Provides "hints" to the speech recognizer to favor specific words and phrases
// in the results. PhraseSets can be specified as an inline resource, or a
// reference to an existing PhraseSet resource.
message SpeechAdaptation {
// A biasing PhraseSet, which can be either a string referencing the name of
// an existing PhraseSets resource, or an inline definition of a PhraseSet.
message AdaptationPhraseSet {
oneof value {
// The name of an existing PhraseSet resource. The user must have read
// access to the resource and it must not be deleted.
string phrase_set = 1 [(google.api.resource_reference) = {
type: "speech.googleapis.com/PhraseSet"
}];
// An inline defined PhraseSet.
PhraseSet inline_phrase_set = 2;
}
}
// A list of inline or referenced PhraseSets.
repeated AdaptationPhraseSet phrase_sets = 1;
// A list of inline CustomClasses. Existing CustomClass resources can be
// referenced directly in a PhraseSet.
repeated CustomClass custom_classes = 2;
}
// Provides information to the Recognizer that specifies how to process the
// recognition request.
message RecognitionConfig {
// Decoding parameters for audio being sent for recognition.
oneof decoding_config {
// Automatically detect decoding parameters.
// Preferred for supported formats.
AutoDetectDecodingConfig auto_decoding_config = 7;
// Explicitly specified decoding parameters.
// Required if using headerless PCM audio (linear16, mulaw, alaw).
ExplicitDecodingConfig explicit_decoding_config = 8;
}
// Speech recognition features to enable.
RecognitionFeatures features = 2;
// Speech adaptation context that weights recognizer predictions for specific
// words and phrases.
SpeechAdaptation adaptation = 6;
}
// Request message for the
// [Recognize][google.cloud.speech.v2.Speech.Recognize] method. Either
// `content` or `uri` must be supplied. Supplying both or neither returns
// [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See [content
// limits](https://cloud.google.com/speech-to-text/quotas#content).
message RecognizeRequest {
// Required. The name of the Recognizer to use during recognition. The
// expected format is
// `projects/{project}/locations/{location}/recognizers/{recognizer}`.
string recognizer = 3 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "speech.googleapis.com/Recognizer"
}
];
// Features and audio metadata to use for the Automatic Speech Recognition.
// This field in combination with the
// [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field
// can be used to override parts of the
// [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
// of the Recognizer resource.
RecognitionConfig config = 1;
// The list of fields in
// [config][google.cloud.speech.v2.RecognizeRequest.config] that override the
// values in the
// [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
// of the recognizer during this recognition request. If no mask is provided,
// all non-default valued fields in
// [config][google.cloud.speech.v2.RecognizeRequest.config] override the
// values in the recognizer for this recognition request. If a mask is
// provided, only the fields listed in the mask override the config in the
// recognizer for this recognition request. If a wildcard (`*`) is provided,
// [config][google.cloud.speech.v2.RecognizeRequest.config] completely
// overrides and replaces the config in the recognizer for this recognition
// request.
google.protobuf.FieldMask config_mask = 8;
// The audio source, which is either inline content or a Google Cloud
// Storage URI.
oneof audio_source {
// The audio data bytes encoded as specified in
// [RecognitionConfig][google.cloud.speech.v2.RecognitionConfig]. As
// with all bytes fields, proto buffers use a pure binary representation,
// whereas JSON representations use base64.
bytes content = 5;
// URI that points to a file that contains audio data bytes as specified in
// [RecognitionConfig][google.cloud.speech.v2.RecognitionConfig]. The file
// must not be compressed (for example, gzip). Currently, only Google Cloud
// Storage URIs are supported, which must be specified in the following
// format: `gs://bucket_name/object_name` (other URI formats return
// [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more
// information, see [Request
// URIs](https://cloud.google.com/storage/docs/reference-uris).
string uri = 6;
}
}
// Metadata about the recognition request and response.
message RecognitionResponseMetadata {
// When available, billed audio seconds for the corresponding request.
google.protobuf.Duration total_billed_duration = 6;
}
// Alternative hypotheses (a.k.a. n-best list).
message SpeechRecognitionAlternative {
// Transcript text representing the words that the user spoke.
string transcript = 1;
// The confidence estimate between 0.0 and 1.0. A higher number
// indicates an estimated greater likelihood that the recognized words are
// correct. This field is set only for the top alternative of a non-streaming
// result or, of a streaming result where
// [is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final] is
// set to `true`. This field is not guaranteed to be accurate and users should
// not rely on it to be always provided. The default of 0.0 is a sentinel
// value indicating `confidence` was not set.
float confidence = 2;
// A list of word-specific information for each recognized word.
// When the
// [SpeakerDiarizationConfig][google.cloud.speech.v2.SpeakerDiarizationConfig]
// is set, you will see all the words from the beginning of the audio.
repeated WordInfo words = 3;
}
// Word-specific information for recognized words.
message WordInfo {
// Time offset relative to the beginning of the audio,
// and corresponding to the start of the spoken word.
// This field is only set if
// [enable_word_time_offsets][google.cloud.speech.v2.RecognitionFeatures.enable_word_time_offsets]
// is `true` and only in the top hypothesis. This is an experimental feature
// and the accuracy of the time offset can vary.
google.protobuf.Duration start_offset = 1;
// Time offset relative to the beginning of the audio,
// and corresponding to the end of the spoken word.
// This field is only set if
// [enable_word_time_offsets][google.cloud.speech.v2.RecognitionFeatures.enable_word_time_offsets]
// is `true` and only in the top hypothesis. This is an experimental feature
// and the accuracy of the time offset can vary.
google.protobuf.Duration end_offset = 2;
// The word corresponding to this set of information.
string word = 3;
// The confidence estimate between 0.0 and 1.0. A higher number
// indicates an estimated greater likelihood that the recognized words are
// correct. This field is set only for the top alternative of a non-streaming
// result or, of a streaming result where
// [is_final][google.cloud.speech.v2.StreamingRecognitionResult.is_final] is
// set to `true`. This field is not guaranteed to be accurate and users should
// not rely on it to be always provided. The default of 0.0 is a sentinel
// value indicating `confidence` was not set.
float confidence = 4;
// A distinct label is assigned for every speaker within the audio. This field
// specifies which one of those speakers was detected to have spoken this
// word. `speaker_label` is set if
// [SpeakerDiarizationConfig][google.cloud.speech.v2.SpeakerDiarizationConfig]