// Copyright 2026 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/model_quality_metadata.proto";

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

option java_outer_classname = "UpdaterChatProto";

// 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.

// Holds the AI data for the updater chat feature.
// Next ID: 4
message UpdaterChatLoggingData {
  // The feature request.
  UpdaterChatRequest request = 1 [features = { field_presence: EXPLICIT }];

  // The feature response.
  UpdaterChatResponse response = 2 [features = { field_presence: EXPLICIT }];

  // The model execution info for the feature.
  ModelExecutionInfo model_execution_info = 3 [features = { field_presence: EXPLICIT }];
}

// Holds the input data for the updater chat feature.
// Next ID: 5
message UpdaterChatRequest {
  Mode mode = 1 [features = { field_presence: IMPLICIT }];

  // The log snippet to be used as context for this particular query.
  string log_snippet = 2 [features = { field_presence: IMPLICIT }];

  // The conversation history context.
  repeated string conversation_history = 3;

  string current_time = 4 [features = { field_presence: IMPLICIT }];

  enum Mode {
    MODE_UNSPECIFIED = 0;

    MODE_CHAT = 1;

    MODE_SNIPPET_SUMMARIZE = 2;
  }
}

// Holds the output data for the updater chat feature.
// Next ID: 4
message UpdaterChatResponse {
  // The overall status derived from the log snippet.
  SnippetStatus status = 1 [features = { field_presence: EXPLICIT }];

  // The textual response generated by the LLM.
  string text_response = 2 [features = { field_presence: IMPLICIT }];

  // Suggested prompts to prompt the LLM further.
  repeated string suggested_prompts = 3;
}

// The overall status derived from the log snippet.
enum SnippetStatus {
  SNIPPET_STATUS_UNSPECIFIED = 0;

  SNIPPET_STATUS_SELF_PROMOTED = 1;

  SNIPPET_STATUS_SELF_PROMOTING = 2;

  SNIPPET_STATUS_ON_DEMAND_UPDATE_SUCCEEDED = 3;

  SNIPPET_STATUS_ON_DEMAND_UPDATE_FAILED = 4;

  SNIPPET_STATUS_INSTALL_SUCCEEDED = 5;

  SNIPPET_STATUS_INSTALL_FAILED = 6;

  SNIPPET_STATUS_UPDATE_SUCCEEDED = 7;

  SNIPPET_STATUS_UPDATE_FAILED = 8;

  SNIPPET_STATUS_CRASHED = 9;

  SNIPPET_STATUS_TRANSIENT_ERROR = 10;

  SNIPPET_STATUS_FATAL_ERROR = 11;

  SNIPPET_STATUS_NO_UPDATE = 12;

  SNIPPET_STATUS_UPDATE_DISABLED = 13;

  SNIPPET_STATUS_UPDATE_SUPPRESSED = 14;

  SNIPPET_STATUS_CHECK_SKIPPED = 15;

  SNIPPET_STATUS_BACKGROUND_EXECUTION = 16;
}
