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

edition = "2023";

package optimization_guide.proto;

import "components/optimization_guide/proto/on_device_model_execution_config.proto";

option optimize_for = LITE_RUNTIME;
option java_package = "org.chromium.components.optimization_guide.features.proto";

option java_outer_classname = "ProofreaderApiProto";

// DO NOT EDIT THIS FILE DIRECTLY!
//
// This file is generated in g3 and then synced to Chrome. Instead, please refer to
// http://go/chrome-mqls-onboarding (Google-internal link), and then changes will
// be synced with Chrome automatically.

message ProofreaderApiLoggingData {
  ProofreaderApiRequest request = 1 [features = { field_presence: EXPLICIT }];

  ProofreaderApiResponse response = 2 [features = { field_presence: EXPLICIT }];
}

message ProofreaderApiRequest {
  string text = 1 [features = { field_presence: EXPLICIT }];

  string corrected_text = 3 [features = { field_presence: EXPLICIT }];

  string correction = 4 [features = { field_presence: EXPLICIT }];

  ProofreadOptions options = 2 [features = { field_presence: EXPLICIT }];
}

message ProofreadOptions {
  bool include_correction_types = 1 [features = { field_presence: EXPLICIT }];

  bool include_correction_explanation = 2 [features = { field_presence: EXPLICIT }];
}

message ProofreaderApiResponse {
  // Response from Proofreader API for proofread execution call. The output will
  // be the fully corrected version of the input text sent in the request.
  string output = 1 [features = { field_presence: EXPLICIT }];
}

// Type for OnDeviceModelExecutionFeatureConfig::feature_metadata.
message ProofreaderApiMetadata {
  // A version for config changes that require implementor updates.
  int32 version = 1 [features = { field_presence: EXPLICIT }];

  // Supported localizations for the prompt.
  repeated string available_prompt_languages = 2;

  // Grouped constraints to keep the top-level metadata clean.
  ProofreaderApiConstraints constraints = 3 [features = { field_presence: EXPLICIT }];
}

// Container for all mode-specific constraints.
message ProofreaderApiConstraints {
  ResponseConstraint label_mode_constraint = 1 [features = { field_presence: EXPLICIT }];
}
