Defining transcription feedback API

Bug: 68712148
Test: none
PiperOrigin-RevId: 174535170
Change-Id: I436335d142f369f8e7c3249463117ffd5c00d6b4
diff --git a/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto b/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto
index b060170..1790881 100644
--- a/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto
+++ b/java/com/android/voicemail/impl/transcribe/grpc/voicemail_transcription.proto
@@ -68,6 +68,18 @@
   DONATE = 2;
 }
 
+// Enum that specifies the user's rating for a voicemail transcription.
+enum TranscriptionRatingValue {
+  // Default but invalid value.
+  UNSPECIFIED = 0;
+
+  // User indicated that the transcription was good.
+  GOOD_TRANSCRIPTION = 1;
+
+  // User indicated that the transcription was bad.
+  BAD_TRANSCRIPTION = 2;
+}
+
 // Request for synchronous voicemail transcription.
 message TranscribeVoicemailRequest {
   // Voicemail audio file containing the raw bytes we receive from the carrier.
@@ -133,6 +145,26 @@
   optional string transcript = 2;
 }
 
+// The rating for a single voicemail transcription.
+message TranscriptionRating {
+  // The id of the voicemail transcription.
+  optional string transcription_id = 1;
+
+  // The user's rating of the voicemail transcription.
+  optional TranscriptionRatingValue rating_value = 2;
+}
+
+// Request for uploading transcription ratings.
+message TranscriptionFeedbackRequest {
+  // User feedback indicating the transcription quality for one or more
+  // voicemails
+  repeated TranscriptionRating ratings = 1;
+}
+
+// Response for uploading transcription ratings
+message TranscriptionFeedbackResponse {
+}
+
 // RPC service for transcribing voicemails.
 service VoicemailTranscriptionService {
   // Returns a transcript of the given voicemail.
@@ -149,6 +181,12 @@
   // by TranscribeVoicemailAsync.
   rpc GetTranscript(GetTranscriptRequest) returns (GetTranscriptResponse) {
   }
+
+  // Uploads user's transcription feedback. Feedback will only be collected from
+  // user's who have consented to donate their voicemails.
+  rpc SendTranscriptionFeedback(TranscriptionFeedbackRequest)
+      returns (TranscriptionFeedbackResponse) {
+  }
 }