Skip to content

Commit c9b244b

Browse files
Google APIscopybara-github
authored andcommitted
feat: Added new fields to facilitate debugging
* Added new field to Speech response proto, to give more information to indicate whether, or not, Biasing was applied (eg. did Biasing application timed out). * Added request_id to Speech response protos. PiperOrigin-RevId: 493311906
1 parent fea4387 commit c9b244b

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

google/cloud/speech/v1/cloud_speech.proto

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ message RecognitionConfig {
260260

261261
// The number of channels in the input audio data.
262262
// ONLY set this for MULTI-CHANNEL recognition.
263-
// Valid values for LINEAR16 and FLAC are `1`-`8`.
264-
// Valid values for OGG_OPUS are '1'-'254'.
263+
// Valid values for LINEAR16, OGG_OPUS and FLAC are `1`-`8`.
265264
// Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`.
266265
// If `0` or omitted, defaults to one channel (mono).
267266
// Note: We only recognize the first channel by default.
@@ -652,6 +651,13 @@ message RecognizeResponse {
652651

653652
// When available, billed audio seconds for the corresponding request.
654653
google.protobuf.Duration total_billed_time = 3;
654+
655+
// Provides information on adaptation behavior in response
656+
SpeechAdaptationInfo speech_adaptation_info = 7;
657+
658+
// The ID associated with the request. This is a unique ID specific only to
659+
// the given request.
660+
int64 request_id = 8;
655661
}
656662

657663
// The only message returned to the client by the `LongRunningRecognize` method.
@@ -672,6 +678,13 @@ message LongRunningRecognizeResponse {
672678

673679
// If the transcript output fails this field contains the relevant error.
674680
google.rpc.Status output_error = 7;
681+
682+
// Provides information on speech adaptation behavior in response
683+
SpeechAdaptationInfo speech_adaptation_info = 8;
684+
685+
// The ID associated with the request. This is a unique ID specific only to
686+
// the given request.
687+
int64 request_id = 9;
675688
}
676689

677690
// Describes the progress of a long-running `LongRunningRecognize` call. It is
@@ -774,6 +787,13 @@ message StreamingRecognizeResponse {
774787
// When available, billed audio seconds for the stream.
775788
// Set only if this is the last response in the stream.
776789
google.protobuf.Duration total_billed_time = 5;
790+
791+
// Provides information on adaptation behavior in response
792+
SpeechAdaptationInfo speech_adaptation_info = 9;
793+
794+
// The ID associated with the request. This is a unique ID specific only to
795+
// the given request.
796+
int64 request_id = 10;
777797
}
778798

779799
// A streaming speech recognition result corresponding to a portion of the audio
@@ -897,3 +917,14 @@ message WordInfo {
897917
// top alternative.
898918
int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
899919
}
920+
921+
// Information on speech adaptation use in results
922+
message SpeechAdaptationInfo {
923+
// Whether there was a timeout when applying speech adaptation. If true,
924+
// adaptation had no effect in the response transcript.
925+
bool adaptation_timeout = 1;
926+
927+
// If set, returns a message specifying which part of the speech adaptation
928+
// request timed out.
929+
string timeout_message = 4;
930+
}

google/cloud/speech/v1/speech_v1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ title: Cloud Speech-to-Text API
66
apis:
77
- name: google.cloud.speech.v1.Adaptation
88
- name: google.cloud.speech.v1.Speech
9+
- name: google.longrunning.Operations
910

1011
types:
1112
- name: google.cloud.speech.v1.LongRunningRecognizeMetadata

0 commit comments

Comments
 (0)