Skip to content

Commit d14537e

Browse files
feat: [speech] add model and language_codes fields in RecognitionConfig message + enable default _ recognizer (#9613)
* feat: add `model` and `language_codes` fields in `RecognitionConfig` message + enable default `_` recognizer Enables specifying `model` and `language_codes` in requests without having to specify them in the Recognizer (they can still be specified in the Recognizer in the `default_recognition_config` field). Also enables using the recognizer ID `_` to perform recognition without explicitly creating a Recognizer resource. The top-level `model` and `language_codes` fields are deprecated in favor of the new fields added in the `RecognitionConfig` message. The old fields continue to work. PiperOrigin-RevId: 545698919 Source-Link: googleapis/googleapis@e73fc8f Source-Link: https://github.com/googleapis/googleapis-gen/commit/b77dfdfe3927e409875b2d8913f2574fa00a05a5 Copy-Tag: eyJwIjoiamF2YS1zcGVlY2gvLk93bEJvdC55YW1sIiwiaCI6ImI3N2RmZGZlMzkyN2U0MDk4NzViMmQ4OTEzZjI1NzRmYTAwYTA1YTUifQ== * 🦉 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 cc2e2ff commit d14537e

14 files changed

Lines changed: 1557 additions & 596 deletions

File tree

java-speech/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>26.16.0</version>
23+
<version>26.18.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>
@@ -231,7 +231,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
231231
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
232232
[stability-image]: https://img.shields.io/badge/stability-stable-green
233233
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-speech.svg
234-
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-speech/4.14.0
234+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-speech/4.15.0
235235
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
236236
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
237237
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles

java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v2/SpeechClient.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,8 @@ public final UnaryCallable<UndeleteRecognizerRequest, Operation> undeleteRecogni
11101110
* }</pre>
11111111
*
11121112
* @param recognizer Required. The name of the Recognizer to use during recognition. The expected
1113-
* format is `projects/{project}/locations/{location}/recognizers/{recognizer}`.
1113+
* format is `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1114+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
11141115
* @param config Features and audio metadata to use for the Automatic Speech Recognition. This
11151116
* field in combination with the
11161117
* [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field can be used to
@@ -1170,7 +1171,8 @@ public final RecognizeResponse recognize(
11701171
* }</pre>
11711172
*
11721173
* @param recognizer Required. The name of the Recognizer to use during recognition. The expected
1173-
* format is `projects/{project}/locations/{location}/recognizers/{recognizer}`.
1174+
* format is `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1175+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
11741176
* @param config Features and audio metadata to use for the Automatic Speech Recognition. This
11751177
* field in combination with the
11761178
* [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field can be used to
@@ -1230,7 +1232,8 @@ public final RecognizeResponse recognize(
12301232
* }</pre>
12311233
*
12321234
* @param recognizer Required. The name of the Recognizer to use during recognition. The expected
1233-
* format is `projects/{project}/locations/{location}/recognizers/{recognizer}`.
1235+
* format is `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1236+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
12341237
* @param config Features and audio metadata to use for the Automatic Speech Recognition. This
12351238
* field in combination with the
12361239
* [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field can be used to
@@ -1287,7 +1290,8 @@ public final RecognizeResponse recognize(
12871290
* }</pre>
12881291
*
12891292
* @param recognizer Required. The name of the Recognizer to use during recognition. The expected
1290-
* format is `projects/{project}/locations/{location}/recognizers/{recognizer}`.
1293+
* format is `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1294+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
12911295
* @param config Features and audio metadata to use for the Automatic Speech Recognition. This
12921296
* field in combination with the
12931297
* [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field can be used to
@@ -1443,7 +1447,9 @@ public final UnaryCallable<RecognizeRequest, RecognizeResponse> recognizeCallabl
14431447
* }
14441448
* }</pre>
14451449
*
1446-
* @param recognizer Required. Resource name of the recognizer to be used for ASR.
1450+
* @param recognizer Required. The name of the Recognizer to use during recognition. The expected
1451+
* format is `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1452+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
14471453
* @param config Features and audio metadata to use for the Automatic Speech Recognition. This
14481454
* field in combination with the
14491455
* [config_mask][google.cloud.speech.v2.BatchRecognizeRequest.config_mask] field can be used
@@ -1503,7 +1509,9 @@ public final OperationFuture<BatchRecognizeResponse, OperationMetadata> batchRec
15031509
* }
15041510
* }</pre>
15051511
*
1506-
* @param recognizer Required. Resource name of the recognizer to be used for ASR.
1512+
* @param recognizer Required. The name of the Recognizer to use during recognition. The expected
1513+
* format is `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1514+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
15071515
* @param config Features and audio metadata to use for the Automatic Speech Recognition. This
15081516
* field in combination with the
15091517
* [config_mask][google.cloud.speech.v2.BatchRecognizeRequest.config_mask] field can be used

java-speech/proto-google-cloud-speech-v2/src/main/java/com/google/cloud/speech/v2/BatchRecognizeRequest.java

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ private ProcessingStrategy(int value) {
216216
*
217217
*
218218
* <pre>
219-
* Required. Resource name of the recognizer to be used for ASR.
219+
* Required. The name of the Recognizer to use during recognition. The
220+
* expected format is
221+
* `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
222+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
220223
* </pre>
221224
*
222225
* <code>
@@ -241,7 +244,10 @@ public java.lang.String getRecognizer() {
241244
*
242245
*
243246
* <pre>
244-
* Required. Resource name of the recognizer to be used for ASR.
247+
* Required. The name of the Recognizer to use during recognition. The
248+
* expected format is
249+
* `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
250+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
245251
* </pre>
246252
*
247253
* <code>
@@ -1127,7 +1133,10 @@ public Builder mergeFrom(
11271133
*
11281134
*
11291135
* <pre>
1130-
* Required. Resource name of the recognizer to be used for ASR.
1136+
* Required. The name of the Recognizer to use during recognition. The
1137+
* expected format is
1138+
* `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1139+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
11311140
* </pre>
11321141
*
11331142
* <code>
@@ -1151,7 +1160,10 @@ public java.lang.String getRecognizer() {
11511160
*
11521161
*
11531162
* <pre>
1154-
* Required. Resource name of the recognizer to be used for ASR.
1163+
* Required. The name of the Recognizer to use during recognition. The
1164+
* expected format is
1165+
* `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1166+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
11551167
* </pre>
11561168
*
11571169
* <code>
@@ -1175,7 +1187,10 @@ public com.google.protobuf.ByteString getRecognizerBytes() {
11751187
*
11761188
*
11771189
* <pre>
1178-
* Required. Resource name of the recognizer to be used for ASR.
1190+
* Required. The name of the Recognizer to use during recognition. The
1191+
* expected format is
1192+
* `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1193+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
11791194
* </pre>
11801195
*
11811196
* <code>
@@ -1198,7 +1213,10 @@ public Builder setRecognizer(java.lang.String value) {
11981213
*
11991214
*
12001215
* <pre>
1201-
* Required. Resource name of the recognizer to be used for ASR.
1216+
* Required. The name of the Recognizer to use during recognition. The
1217+
* expected format is
1218+
* `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1219+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
12021220
* </pre>
12031221
*
12041222
* <code>
@@ -1217,7 +1235,10 @@ public Builder clearRecognizer() {
12171235
*
12181236
*
12191237
* <pre>
1220-
* Required. Resource name of the recognizer to be used for ASR.
1238+
* Required. The name of the Recognizer to use during recognition. The
1239+
* expected format is
1240+
* `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
1241+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
12211242
* </pre>
12221243
*
12231244
* <code>

java-speech/proto-google-cloud-speech-v2/src/main/java/com/google/cloud/speech/v2/BatchRecognizeRequestOrBuilder.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ public interface BatchRecognizeRequestOrBuilder
2727
*
2828
*
2929
* <pre>
30-
* Required. Resource name of the recognizer to be used for ASR.
30+
* Required. The name of the Recognizer to use during recognition. The
31+
* expected format is
32+
* `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
33+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
3134
* </pre>
3235
*
3336
* <code>
@@ -41,7 +44,10 @@ public interface BatchRecognizeRequestOrBuilder
4144
*
4245
*
4346
* <pre>
44-
* Required. Resource name of the recognizer to be used for ASR.
47+
* Required. The name of the Recognizer to use during recognition. The
48+
* expected format is
49+
* `projects/{project}/locations/{location}/recognizers/{recognizer}`. The
50+
* {recognizer} segment may be set to `_` to use an empty implicit Recognizer.
4551
* </pre>
4652
*
4753
* <code>

0 commit comments

Comments
 (0)