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

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

option java_outer_classname = "SkillsProto";

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

// Top-level message required by MES.
// Next ID: 4
message SkillsLoggingData {
  SkillsRequest request = 1 [features = { field_presence: EXPLICIT }];

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

  ModelExecutionInfo model_execution_info = 3 [features = { field_presence: EXPLICIT }];
}

// The request for the Skills feature.
// Next ID: 3
message SkillsRequest {
  TaskType task_type = 1 [features = { field_presence: EXPLICIT }];

  SkillDraft skill_draft = 2 [features = { field_presence: EXPLICIT }];

  // The current state of the skill, used as input for refinement.
  // Next ID: 5
  message SkillDraft {
    string prompt = 1 [features = { field_presence: EXPLICIT }];

    string name = 2 [features = { field_presence: EXPLICIT }];

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

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

  // Enum to determine the goal of this request.
  // Next ID: 4
  enum TaskType {
    TASK_TYPE_UNSPECIFIED = 0;

    // Generates name, icon, and description based on context or prompt.
    GENERATE_METADATA = 1;

    // Improves the user's draft prompt.
    REFINE_PROMPT = 2;

    // Generates description based on name, icon, and prompt.
    GENERATE_DESCRIPTION = 3;
  }
}

// The response for the Skills feature.
// Next ID: 4
message SkillsResponse {
  // List of suggestions for the client to display.
  repeated Suggestion suggestions = 1;

  // The type of error that occurred:
  // "unclear_intent" | "inappropriate_content" | null
  string error_type = 2 [features = { field_presence: EXPLICIT }];

  // The error message from the model, if any.
  string error_message = 3 [features = { field_presence: EXPLICIT }];

  // A single suggestion returned by the model.
  // Next ID: 5
  message Suggestion {
    // The refined or generated prompt text.
    string prompt = 1 [features = { field_presence: EXPLICIT }];

    // Suggested title for the skill.
    string name = 2 [features = { field_presence: EXPLICIT }];

    // Suggested icon for the skill.
    string icon = 3 [features = { field_presence: EXPLICIT }];

    // Suggested description for the skill.
    string description = 4 [features = { field_presence: EXPLICIT }];
  }
}
