chromium/components/manta/proto/manta.proto

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

syntax = "proto2";
option optimize_for = LITE_RUNTIME;

import "components/manta/proto/common.proto";
import "components/manta/proto/sparky.proto";

package manta.proto;

enum FeatureName {
  reserved 1 to 299;

  CHROMEOS_VC_BACKGROUNDS = 300;
  CHROMEOS_WALLPAPER = 301;
  TEXT_TEST = 302;
  CHROMEOS_READER_SUMMARY = 303;
  CHROMEOS_READER_TOC = 312;
  CHROMEOS_READER_Q_AND_A = 313;
  CHROMEOS_SPARKY = 314;
  CHROMEOS_LOBSTER = 315;
  reserved 304 to 311;

  ACCESSIBILITY_IMAGE_DESCRIPTION = 700;
}

message ClientInfo {
  enum ClientType {
    reserved 0, 1;
    CHROME = 2;
  }

  optional ClientType client_type = 1;
  optional ChromeClientInfo chrome_client_info = 4;
  reserved 2, 3;
}

message ChromeClientInfo {
  optional string chrome_version = 1;
  optional string locale = 4;

  // The channel of the Chrome client.
  enum Channel {
    UNKNOWN = 0;
    CANARY = 1;
    DEV = 2;
    BETA = 3;
    STABLE = 4;
  }
  optional Channel chrome_channel = 5;
  reserved 2, 3;
}

enum ImageResolution {
  reserved 0, 4, 5, 6, 7, 8, 9, 10, 11;

  RESOLUTION_64 = 1;
  RESOLUTION_256 = 2;
  RESOLUTION_1024 = 3;
  RESOLUTION_LARGE = 12;
}

message ImageDimensions {
  optional uint32 width = 1;
  optional uint32 height = 2;
}

enum AspectRatio {
  ASPECT_RATIO_UNSPECIFIED = 0;  // Defaults to 1:1
  ASPECT_RATIO_16_9 = 1;
  ASPECT_RATIO_16_10 = 2;
  ASPECT_RATIO_4_3 = 3;
}

message RequestConfig {
  reserved 4, 6;

  optional uint32 generation_seed = 1;
  optional ImageResolution image_resolution = 2;
  optional uint32 num_outputs = 3;

  enum Tone {
    UNSPECIFIED = 0;
    SHORTEN = 1;
    ELABORATE = 2;
    REPHRASE = 3;
    FORMALIZE = 4;
    EMOJIFY = 5;
    FREEFORM_REWRITE = 6;
    FREEFORM_WRITE = 7;
    PROOFREAD = 8;
  }

  optional Tone tone = 5;

  optional ImageDimensions image_dimensions = 7;

  optional AspectRatio aspect_ratio = 8;

  optional Proto3Any specific_options = 9;
}

message InputData {

  oneof input_data {
    string text = 1;
    Image image = 2;
    Proto3Any custom = 3;
    SparkyContextData sparky_context_data = 5;
  }
  optional string tag = 4;
}

message Request {
  optional FeatureName feature_name = 1;
  optional ClientInfo client_info = 2;
  optional RequestConfig request_config = 3;
  repeated InputData input_data = 4;
}

message OutputData {
  reserved 4;
  oneof output_data {
    string text = 1;
    Image image = 2;
    Proto3Any custom = 3;
    SparkyResponse sparky_response = 7;
  }

  optional float score = 5;

  optional uint32 generation_seed = 6;
}

enum FilteredReason {
  UNSPECIFIED = 0;
  IMAGE_SAFETY = 1;
  TEXT_SAFETY = 2;
  TEXT_LOW_QUALITY = 3;
  TEXT_BLOCKLIST = 4;

  reserved 5, 6, 7;
}

message FilteredData {
  reserved 1;
  optional bool is_output_data = 2;
  optional FilteredReason reason = 3;
}

message Response {
  reserved 3;

  repeated OutputData output_data = 1;
  repeated FilteredData filtered_data = 2;
}