// 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. module on_device_translation.mojom; // The abstraction that does the real translation work. interface OnDeviceTranslator { // Translates the input from the source language to the target language. // The source/target languages are specified when the `Translator` is // initialized. `output` is nullopt if the translation fails. Translate(string input) => (string? output); // Splits the translation source language input into sentences // for chunk-by-chunk streaming of translation outputs. SplitSentences(string input) => (array sentences); };