chromium/chromeos/ash/components/boca/babelorca/proto/babel_orca_message.proto

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto3";

option optimize_for = LITE_RUNTIME;

package ash.babelorca;

// Transcription part.
message TranscriptPart {
  // Id to identify which transcript the part belongs to.
  int64 transcript_id = 1;
  // Index of the text in the transcript.
  int64 text_index = 2;
  // Transcription part text.
  string text = 3;
  // Whether this is the final part of the transcript.
  bool is_final = 4;
  // Transcript language.
  string language = 5;
}

// Message from sender to receiver.
message BabelOrcaMessage {
  // Sender generated UUID. Should be the same for all messages unless there is
  // a device restart.
  string sender_uuid = 1;
  // Order of the message with respect to the previously sent messages with the
  // same `sender_uuid``.
  int64 order = 2;
  // Transcription part of the previous transcript. Will not be set if there is
  // no previous transcript or if the max allowed overall text size is reached.
  TranscriptPart previous_transcript = 3;
  // Transcription part of the current transcript.
  TranscriptPart current_transcript = 4;
}