Skip to content

Commit fb10089

Browse files
feat: expose google.cloud.location.Locations API (#6243)
* feat: expose google.cloud.location.Locations API feat: add new fields to CustomClass and PhraseSet.Phrase messages feat: add ALAW support to RecognitionConfig feat: make transcript_normalization field optional feat: deprecating speaker_tag (int) for speaker_label (string) docs: miscellaneous clarifications PiperOrigin-RevId: 743615436 Source-Link: googleapis/googleapis@3891337 Source-Link: googleapis/googleapis-gen@a36bdfd Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNwZWVjaC8uT3dsQm90LnlhbWwiLCJoIjoiYTM2YmRmZGNjZTFiMTZkNGU3ZTc4OWJhNTkyYzM3MzA0ZGFhMTZjMCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 3438a5f commit fb10089

6 files changed

Lines changed: 1219 additions & 36 deletions

File tree

packages/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/cloud_speech.proto

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import "google/protobuf/timestamp.proto";
2626
import "google/protobuf/wrappers.proto";
2727
import "google/rpc/status.proto";
2828

29-
option cc_enable_arenas = true;
3029
option go_package = "cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb";
3130
option java_multiple_files = true;
3231
option java_outer_classname = "SpeechProto";
@@ -163,8 +162,9 @@ message StreamingRecognitionConfig {
163162
// `true`.
164163
//
165164
// The `single_utterance` field can only be used with specified models,
166-
// otherwise an error is thrown. The `model` field in [`RecognitionConfig`][]
167-
// must be set to:
165+
// otherwise an error is thrown. The `model` field in
166+
// [RecognitionConfig][google.cloud.speech.v1p1beta1.RecognitionConfig] must
167+
// be set to:
168168
//
169169
// * `command_and_search`
170170
// * `phone_call` AND additional field `useEnhanced`=`true`
@@ -267,9 +267,12 @@ message RecognitionConfig {
267267
MP3 = 8;
268268

269269
// Opus encoded audio frames in WebM container
270-
// ([OggOpus](https://wiki.xiph.org/OggOpus)). `sample_rate_hertz` must be
271-
// one of 8000, 12000, 16000, 24000, or 48000.
270+
// ([WebM](https://www.webmproject.org/docs/container/)).
271+
// `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000.
272272
WEBM_OPUS = 9;
273+
274+
// 8-bit samples that compand 13-bit audio samples using G.711 PCMU/a-law.
275+
ALAW = 10;
273276
}
274277

275278
// Encoding of audio data sent in all `RecognitionAudio` messages.
@@ -349,11 +352,12 @@ message RecognitionConfig {
349352
// When speech adaptation is set it supersedes the `speech_contexts` field.
350353
SpeechAdaptation adaptation = 20;
351354

352-
// Use transcription normalization to automatically replace parts of the
353-
// transcript with phrases of your choosing. For StreamingRecognize, this
355+
// Optional. Use transcription normalization to automatically replace parts of
356+
// the transcript with phrases of your choosing. For StreamingRecognize, this
354357
// normalization only applies to stable partial transcripts (stability > 0.8)
355358
// and final transcripts.
356-
TranscriptNormalization transcript_normalization = 24;
359+
TranscriptNormalization transcript_normalization = 24
360+
[(google.api.field_behavior) = OPTIONAL];
357361

358362
// Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext].
359363
// A means to provide context to assist the speech recognition. For more
@@ -396,8 +400,8 @@ message RecognitionConfig {
396400
google.protobuf.BoolValue enable_spoken_emojis = 23;
397401

398402
// If 'true', enables speaker detection for each recognized word in
399-
// the top alternative of the recognition result using a speaker_tag provided
400-
// in the WordInfo.
403+
// the top alternative of the recognition result using a speaker_label
404+
// provided in the WordInfo.
401405
// Note: Use diarization_config instead.
402406
bool enable_speaker_diarization = 16 [deprecated = true];
403407

@@ -486,8 +490,8 @@ message RecognitionConfig {
486490
// Config to enable speaker diarization.
487491
message SpeakerDiarizationConfig {
488492
// If 'true', enables speaker detection for each recognized word in
489-
// the top alternative of the recognition result using a speaker_tag provided
490-
// in the WordInfo.
493+
// the top alternative of the recognition result using a speaker_label
494+
// provided in the WordInfo.
491495
bool enable_speaker_diarization = 1;
492496

493497
// Minimum number of speakers in the conversation. This range gives you more
@@ -708,6 +712,10 @@ message RecognizeResponse {
708712
// The ID associated with the request. This is a unique ID specific only to
709713
// the given request.
710714
int64 request_id = 8;
715+
716+
// Whether request used legacy asr models (was not automatically migrated to
717+
// use conformer models).
718+
bool using_legacy_models = 9;
711719
}
712720

713721
// The only message returned to the client by the `LongRunningRecognize` method.
@@ -988,9 +996,19 @@ message WordInfo {
988996
// Output only. A distinct integer value is assigned for every speaker within
989997
// the audio. This field specifies which one of those speakers was detected to
990998
// have spoken this word. Value ranges from '1' to diarization_speaker_count.
991-
// speaker_tag is set if enable_speaker_diarization = 'true' and only in the
999+
// speaker_tag is set if enable_speaker_diarization = 'true' and only for the
9921000
// top alternative.
993-
int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
1001+
// Note: Use speaker_label instead.
1002+
int32 speaker_tag = 5
1003+
[deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY];
1004+
1005+
// Output only. A label value assigned for every unique speaker within the
1006+
// audio. This field specifies which speaker was detected to have spoken this
1007+
// word. For some models, like medical_conversation this can be actual speaker
1008+
// role, for example "patient" or "provider", but generally this would be a
1009+
// number identifying a speaker. This field is only set if
1010+
// enable_speaker_diarization = 'true' and only for the top alternative.
1011+
string speaker_label = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
9941012
}
9951013

9961014
// Information on speech adaptation use in results

packages/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import "google/cloud/speech/v1p1beta1/resource.proto";
2424
import "google/protobuf/empty.proto";
2525
import "google/protobuf/field_mask.proto";
2626

27-
option cc_enable_arenas = true;
2827
option go_package = "cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb";
2928
option java_multiple_files = true;
3029
option java_outer_classname = "SpeechAdaptationProto";

packages/google-cloud-speech/protos/google/cloud/speech/v1p1beta1/resource.proto

Lines changed: 158 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,23 @@ syntax = "proto3";
1616

1717
package google.cloud.speech.v1p1beta1;
1818

19+
import "google/api/field_behavior.proto";
1920
import "google/api/resource.proto";
21+
import "google/protobuf/timestamp.proto";
2022

21-
option cc_enable_arenas = true;
2223
option go_package = "cloud.google.com/go/speech/apiv1p1beta1/speechpb;speechpb";
2324
option java_multiple_files = true;
2425
option java_outer_classname = "SpeechResourceProto";
2526
option java_package = "com.google.cloud.speech.v1p1beta1";
2627
option objc_class_prefix = "GCS";
28+
option (google.api.resource_definition) = {
29+
type: "cloudkms.googleapis.com/CryptoKey"
30+
pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"
31+
};
32+
option (google.api.resource_definition) = {
33+
type: "cloudkms.googleapis.com/CryptoKeyVersion"
34+
pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"
35+
};
2736

2837
// A set of words or phrases that represents a common concept likely to appear
2938
// in your audio, for example a list of passenger ship names. CustomClass items
@@ -40,6 +49,19 @@ message CustomClass {
4049
string value = 1;
4150
}
4251

52+
// Set of states that define the lifecycle of a CustomClass.
53+
enum State {
54+
// Unspecified state. This is only used/useful for distinguishing
55+
// unset values.
56+
STATE_UNSPECIFIED = 0;
57+
58+
// The normal and active state.
59+
ACTIVE = 2;
60+
61+
// This CustomClass has been deleted.
62+
DELETED = 4;
63+
}
64+
4365
// The resource name of the custom class.
4466
string name = 1;
4567

@@ -49,6 +71,67 @@ message CustomClass {
4971

5072
// A collection of class items.
5173
repeated ClassItem items = 3;
74+
75+
// Output only. The [KMS key
76+
// name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which
77+
// the content of the ClassItem is encrypted. The expected format is
78+
// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
79+
string kms_key_name = 6 [
80+
(google.api.field_behavior) = OUTPUT_ONLY,
81+
(google.api.resource_reference) = {
82+
type: "cloudkms.googleapis.com/CryptoKey"
83+
}
84+
];
85+
86+
// Output only. The [KMS key version
87+
// name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions)
88+
// with which content of the ClassItem is encrypted. The expected format is
89+
// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`.
90+
string kms_key_version_name = 7 [
91+
(google.api.field_behavior) = OUTPUT_ONLY,
92+
(google.api.resource_reference) = {
93+
type: "cloudkms.googleapis.com/CryptoKeyVersion"
94+
}
95+
];
96+
97+
// Output only. System-assigned unique identifier for the CustomClass.
98+
// This field is not used.
99+
string uid = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
100+
101+
// Output only. User-settable, human-readable name for the CustomClass. Must
102+
// be 63 characters or less. This field is not used.
103+
string display_name = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
104+
105+
// Output only. The CustomClass lifecycle state.
106+
// This field is not used.
107+
State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
108+
109+
// Output only. The time at which this resource was requested for deletion.
110+
// This field is not used.
111+
google.protobuf.Timestamp delete_time = 11
112+
[(google.api.field_behavior) = OUTPUT_ONLY];
113+
114+
// Output only. The time at which this resource will be purged.
115+
// This field is not used.
116+
google.protobuf.Timestamp expire_time = 12
117+
[(google.api.field_behavior) = OUTPUT_ONLY];
118+
119+
// Output only. Allows users to store small amounts of arbitrary data.
120+
// Both the key and the value must be 63 characters or less each.
121+
// At most 100 annotations.
122+
// This field is not used.
123+
map<string, string> annotations = 13
124+
[(google.api.field_behavior) = OUTPUT_ONLY];
125+
126+
// Output only. This checksum is computed by the server based on the value of
127+
// other fields. This may be sent on update, undelete, and delete requests to
128+
// ensure the client has an up-to-date value before proceeding. This field is
129+
// not used.
130+
string etag = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
131+
132+
// Output only. Whether or not this CustomClass is in the process of being
133+
// updated. This field is not used.
134+
bool reconciling = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
52135
}
53136

54137
// Provides "hints" to the speech recognizer to favor specific words and phrases
@@ -100,6 +183,19 @@ message PhraseSet {
100183
float boost = 2;
101184
}
102185

186+
// Set of states that define the lifecycle of a CustomClass.
187+
enum State {
188+
// Unspecified state. This is only used/useful for distinguishing
189+
// unset values.
190+
STATE_UNSPECIFIED = 0;
191+
192+
// The normal and active state.
193+
ACTIVE = 2;
194+
195+
// This CustomClass has been deleted.
196+
DELETED = 4;
197+
}
198+
103199
// The resource name of the phrase set.
104200
string name = 1;
105201

@@ -116,6 +212,67 @@ message PhraseSet {
116212
// approach to finding the optimal value for your use case as well as adding
117213
// phrases both with and without boost to your requests.
118214
float boost = 4;
215+
216+
// Output only. The [KMS key
217+
// name](https://cloud.google.com/kms/docs/resource-hierarchy#keys) with which
218+
// the content of the PhraseSet is encrypted. The expected format is
219+
// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
220+
string kms_key_name = 7 [
221+
(google.api.field_behavior) = OUTPUT_ONLY,
222+
(google.api.resource_reference) = {
223+
type: "cloudkms.googleapis.com/CryptoKey"
224+
}
225+
];
226+
227+
// Output only. The [KMS key version
228+
// name](https://cloud.google.com/kms/docs/resource-hierarchy#key_versions)
229+
// with which content of the PhraseSet is encrypted. The expected format is
230+
// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`.
231+
string kms_key_version_name = 8 [
232+
(google.api.field_behavior) = OUTPUT_ONLY,
233+
(google.api.resource_reference) = {
234+
type: "cloudkms.googleapis.com/CryptoKeyVersion"
235+
}
236+
];
237+
238+
// Output only. System-assigned unique identifier for the PhraseSet.
239+
// This field is not used.
240+
string uid = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
241+
242+
// Output only. User-settable, human-readable name for the PhraseSet. Must be
243+
// 63 characters or less. This field is not used.
244+
string display_name = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
245+
246+
// Output only. The CustomClass lifecycle state.
247+
// This field is not used.
248+
State state = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
249+
250+
// Output only. The time at which this resource was requested for deletion.
251+
// This field is not used.
252+
google.protobuf.Timestamp delete_time = 12
253+
[(google.api.field_behavior) = OUTPUT_ONLY];
254+
255+
// Output only. The time at which this resource will be purged.
256+
// This field is not used.
257+
google.protobuf.Timestamp expire_time = 13
258+
[(google.api.field_behavior) = OUTPUT_ONLY];
259+
260+
// Output only. Allows users to store small amounts of arbitrary data.
261+
// Both the key and the value must be 63 characters or less each.
262+
// At most 100 annotations.
263+
// This field is not used.
264+
map<string, string> annotations = 14
265+
[(google.api.field_behavior) = OUTPUT_ONLY];
266+
267+
// Output only. This checksum is computed by the server based on the value of
268+
// other fields. This may be sent on update, undelete, and delete requests to
269+
// ensure the client has an up-to-date value before proceeding. This field is
270+
// not used.
271+
string etag = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
272+
273+
// Output only. Whether or not this PhraseSet is in the process of being
274+
// updated. This field is not used.
275+
bool reconciling = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
119276
}
120277

121278
// Speech adaptation configuration.

0 commit comments

Comments
 (0)