Skip to content

Commit 58cd55f

Browse files
Google APIscopybara-github
authored andcommitted
feat: add locations metadata proto file
docs: update the list of automatically detected encodings docs: update the maximum number of files that may be included in a BatchRecognizeRequest PiperOrigin-RevId: 653986958
1 parent 7613f7d commit 58cd55f

4 files changed

Lines changed: 105 additions & 3 deletions

File tree

google/cloud/speech/v2/BUILD.bazel

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,29 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# buildifier: disable=load-on-top
13+
1214
# This is an API workspace, having public visibility by default makes perfect sense.
1315
package(default_visibility = ["//visibility:public"])
1416

1517
##############################################################################
1618
# Common
1719
##############################################################################
18-
load("@rules_proto//proto:defs.bzl", "proto_library")
20+
# buildifier: disable=same-origin-load
1921
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
22+
load("@rules_proto//proto:defs.bzl", "proto_library")
2023

2124
proto_library(
2225
name = "speech_proto",
2326
srcs = [
2427
"cloud_speech.proto",
28+
"locations_metadata.proto",
2529
],
2630
deps = [
2731
"//google/api:annotations_proto",
2832
"//google/api:client_proto",
2933
"//google/api:field_behavior_proto",
34+
"//google/api:field_info_proto",
3035
"//google/api:resource_proto",
3136
"//google/longrunning:operations_proto",
3237
"//google/rpc:status_proto",
@@ -48,6 +53,7 @@ proto_library_with_info(
4853
##############################################################################
4954
# Java
5055
##############################################################################
56+
# buildifier: disable=same-origin-load
5157
load(
5258
"@com_google_googleapis_imports//:imports.bzl",
5359
"java_gapic_assembly_gradle_pkg",
@@ -112,6 +118,7 @@ java_gapic_assembly_gradle_pkg(
112118
##############################################################################
113119
# Go
114120
##############################################################################
121+
# buildifier: disable=same-origin-load
115122
load(
116123
"@com_google_googleapis_imports//:imports.bzl",
117124
"go_gapic_assembly_pkg",
@@ -166,6 +173,7 @@ go_gapic_assembly_pkg(
166173
##############################################################################
167174
# Python
168175
##############################################################################
176+
# buildifier: disable=same-origin-load
169177
load(
170178
"@com_google_googleapis_imports//:imports.bzl",
171179
"py_gapic_assembly_pkg",
@@ -205,6 +213,7 @@ py_gapic_assembly_pkg(
205213
##############################################################################
206214
# PHP
207215
##############################################################################
216+
# buildifier: disable=same-origin-load
208217
load(
209218
"@com_google_googleapis_imports//:imports.bzl",
210219
"php_gapic_assembly_pkg",
@@ -242,6 +251,7 @@ php_gapic_assembly_pkg(
242251
##############################################################################
243252
# Node.js
244253
##############################################################################
254+
# buildifier: disable=same-origin-load
245255
load(
246256
"@com_google_googleapis_imports//:imports.bzl",
247257
"nodejs_gapic_assembly_pkg",
@@ -272,6 +282,7 @@ nodejs_gapic_assembly_pkg(
272282
##############################################################################
273283
# Ruby
274284
##############################################################################
285+
# buildifier: disable=same-origin-load
275286
load(
276287
"@com_google_googleapis_imports//:imports.bzl",
277288
"ruby_cloud_gapic_library",
@@ -326,6 +337,7 @@ ruby_gapic_assembly_pkg(
326337
##############################################################################
327338
# C#
328339
##############################################################################
340+
# buildifier: disable=same-origin-load
329341
load(
330342
"@com_google_googleapis_imports//:imports.bzl",
331343
"csharp_gapic_assembly_pkg",
@@ -373,6 +385,7 @@ csharp_gapic_assembly_pkg(
373385
##############################################################################
374386
# C++
375387
##############################################################################
388+
# buildifier: disable=same-origin-load
376389
load(
377390
"@com_google_googleapis_imports//:imports.bzl",
378391
"cc_grpc_library",

google/cloud/speech/v2/cloud_speech.proto

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package google.cloud.speech.v2;
1919
import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
22+
import "google/api/field_info.proto";
2223
import "google/api/resource.proto";
2324
import "google/longrunning/operations.proto";
2425
import "google/protobuf/duration.proto";
@@ -706,7 +707,11 @@ message Recognizer {
706707
//
707708
// * WEBM_OPUS: Opus audio frames in a WebM container.
708709
//
709-
// * M4A: M4A audio format.
710+
// * MP4_AAC: AAC audio frames in an MP4 container.
711+
//
712+
// * M4A_AAC: AAC audio frames in an M4A container.
713+
//
714+
// * MOV_AAC: AAC audio frames in an MOV container.
710715
message AutoDetectDecodingConfig {}
711716

712717
// Explicitly specified decoding parameters.
@@ -1020,6 +1025,9 @@ message RecognizeRequest {
10201025

10211026
// Metadata about the recognition request and response.
10221027
message RecognitionResponseMetadata {
1028+
// Global request identifier auto-generated by the API.
1029+
string request_id = 9 [(google.api.field_info).format = UUID4];
1030+
10231031
// When available, billed audio seconds for the corresponding request.
10241032
google.protobuf.Duration total_billed_duration = 6;
10251033
}
@@ -1273,7 +1281,7 @@ message BatchRecognizeRequest {
12731281
google.protobuf.FieldMask config_mask = 5;
12741282

12751283
// Audio files with file metadata for ASR.
1276-
// The maximum number of files allowed to be specified is 5.
1284+
// The maximum number of files allowed to be specified is 15.
12771285
repeated BatchRecognizeFileMetadata files = 3;
12781286

12791287
// Configuration options for where to output the transcripts of each file.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// Copyright 2024 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+
// http://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+
syntax = "proto3";
16+
17+
package google.cloud.speech.v2;
18+
19+
option go_package = "cloud.google.com/go/speech/apiv2/speechpb;speechpb";
20+
option java_multiple_files = true;
21+
option java_outer_classname = "LocationsMetadataProto";
22+
option java_package = "com.google.cloud.speech.v2";
23+
24+
// Representes a singular feature of a model. If the feature is `recognizer`,
25+
// the release_state of the feature represents the release_state of the model
26+
message ModelFeature {
27+
// The name of the feature (Note: the feature can be `recognizer`)
28+
string feature = 1;
29+
30+
// The release state of the feature
31+
string release_state = 2;
32+
}
33+
34+
// Represents the collection of features belonging to a model
35+
message ModelFeatures {
36+
// Repeated field that contains all features of the model
37+
repeated ModelFeature model_feature = 1;
38+
}
39+
40+
// The metadata about the models in a given region for a specific locale.
41+
// Currently this is just the features of the model
42+
message ModelMetadata {
43+
// Map of the model name -> features of that model
44+
map<string, ModelFeatures> model_features = 1;
45+
}
46+
47+
// The metadata about locales available in a given region. Currently this is
48+
// just the models that are available for each locale
49+
message LanguageMetadata {
50+
// Map of locale (language code) -> models
51+
map<string, ModelMetadata> models = 1;
52+
}
53+
54+
// The access metadata for a particular region. This can be applied if the org
55+
// policy for the given project disallows a particular region.
56+
message AccessMetadata {
57+
// Describes the different types of constraints that can be applied on a
58+
// region.
59+
enum ConstraintType {
60+
// Unspecified constraint applied.
61+
CONSTRAINT_TYPE_UNSPECIFIED = 0;
62+
63+
// The project's org policy disallows the given region.
64+
RESOURCE_LOCATIONS_ORG_POLICY_CREATE_CONSTRAINT = 1;
65+
}
66+
67+
// Describes the different types of constraints that are applied.
68+
ConstraintType constraint_type = 1;
69+
}
70+
71+
// Main metadata for the Locations API for STT V2. Currently this is just the
72+
// metadata about locales, models, and features
73+
message LocationsMetadata {
74+
// Information about available locales, models, and features represented in
75+
// the hierarchical structure of locales -> models -> features
76+
LanguageMetadata languages = 1;
77+
78+
// Information about access metadata for the region and given project.
79+
AccessMetadata access_metadata = 2;
80+
}

google/cloud/speech/v2/speech_v2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ types:
1414
- name: google.cloud.speech.v2.Config
1515
- name: google.cloud.speech.v2.CustomClass
1616
- name: google.cloud.speech.v2.ExplicitDecodingConfig
17+
- name: google.cloud.speech.v2.LocationsMetadata
1718
- name: google.cloud.speech.v2.OperationMetadata
1819
- name: google.cloud.speech.v2.PhraseSet
1920
- name: google.cloud.speech.v2.Recognizer

0 commit comments

Comments
 (0)