chromium/third_party/blink/public/mojom/ai/ai_writer.mojom

// 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 blink.mojom;

import "third_party/blink/public/mojom/ai/model_streaming_responder.mojom";

// Interface for AIWriter that can stream the output string.
interface AIWriter {
  // Generates a text using the input string. The shared context string can be
  // set when creating the AIWriter.
  // `input` is a string that is set when the JS API `writer.write()` is called.
  // `context` is a optional string that is set in the AIWriterWriteOptions when
  // the JS API `writer.write()` is called.
  Write(
    string input,
    string? context,
    pending_remote<ModelStreamingResponder> pending_responder);
};