blob: e64899525488c50257113ba66859e573bcad01b2 [file] [log] [blame]
// 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.
edition = "2023";
package optimization_guide.proto;
import "components/optimization_guide/proto/features/common_quality_data.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 = "ComposeProto";
// 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.
// Next ID: 7
message ComposeLoggingData {
ComposeRequest request = 1 [features = { field_presence: EXPLICIT }];
ComposeResponse response = 2 [features = { field_presence: EXPLICIT }];
ComposeQuality quality = 3 [features = { field_presence: EXPLICIT }];
ModelExecutionInfo model_execution_info = 6 [features = { field_presence: EXPLICIT }];
reserved 4, 5;
}
// Stores all data associated with a single call to the model execution run for
// compose.
//
// Next ID: 9
message ComposeRequest {
oneof request_params {
GenerateParams generate_params = 7;
RewriteParams rewrite_params = 8;
}
// Contains information scraped from the page.
ComposePageMetadata page_metadata = 3 [features = { field_presence: EXPLICIT }];
// Next ID: 3
message GenerateParams {
// User written input text.
string user_input = 1 [features = { field_presence: IMPLICIT }];
// Generate using the user selected mode.
ComposeUpfrontInputMode upfront_input_mode = 2 [features = { field_presence: IMPLICIT }];
}
// Next ID: 5
message RewriteParams {
// Rewrite with one of the below modifiers.
oneof modifier {
ComposeTone tone = 2;
ComposeLength length = 3;
bool regenerate = 4;
}
// A previously received ComposeResponse response_text, which will be
// rewritten.
string previous_response = 1 [features = { field_presence: IMPLICIT }];
}
reserved 1, 2, 4, 5, 6;
}
// Stores the metadata associated with a single call to the model execution.
// This excludes any explicit user input.
// Next Id: 7
message ComposePageMetadata {
// URL of the page the input field is on.
string page_url = 1 [features = { field_presence: IMPLICIT }];
// The title of the page the input field is on.
string page_title = 2 [features = { field_presence: IMPLICIT }];
// The innerText of the page the input field is on. This is temporary. We do
// not intend to send inner text in the long run.
string page_inner_text = 3 [features = { field_presence: IMPLICIT }];
// The offset into the inner text of the selected input field.
uint64 page_inner_text_offset = 4 [features = { field_presence: IMPLICIT }];
// A trimmed innerText of the page the input field is on, to be used by
// on device models.
string trimmed_page_inner_text = 5 [features = { field_presence: IMPLICIT }];
// An accessibility tree snapshot of the page.
AXTreeUpdate ax_tree_update = 6 [features = { field_presence: EXPLICIT }];
}
// Stores the response text from the model execution run.
// Next Id: 2
message ComposeResponse {
string output = 1 [features = { field_presence: IMPLICIT }];
}
// Any data collected on the client outside of the model request and response.
// This includes user feedback, and metrics about feature usage.
// Next Id: 12
message ComposeQuality {
FinalStatus final_status = 1 [features = { field_presence: IMPLICIT }];
UserFeedback user_feedback = 2 [features = { field_presence: IMPLICIT }];
// How long the user had to wait before seeing the model response.
int64 request_latency_ms = 4 [features = { field_presence: IMPLICIT }];
// How much was the text modified before commit only valid iff
// final_status = INSERTED
int64 edit_distance = 5 [features = { field_presence: EXPLICIT }];
// A unique ID for each compose session.
Int128 session_id = 6 [features = { field_presence: EXPLICIT }];
// Was this request generated via an edit action.
bool was_generated_via_edit = 7 [features = { field_presence: IMPLICIT }];
// The status of this request.
ClientRequestStatus client_request_status = 8 [features = { field_presence: IMPLICIT }];
// Was this session started with a proactive nudge UI.
bool started_with_proactive_nudge = 9 [features = { field_presence: IMPLICIT }];
// Was this session a successful session.
FinalModelStatus final_model_status = 10 [features = { field_presence: IMPLICIT }];
reserved 3, 11;
}
// A helper message to store the int64 high and uint64 low bits of an int128
// since protos do not natively handle int128. The underlying value is split
// into a `low` uint64 holding the low bits, and `high` int64 holding the bits
// beyond what an int64 can hold. Can easily create an int128 via
// absl::MakeInt128(high, low) and be created from an int128 using
// absl::Int128Low64() and absl::Int128High64().
// Next ID: 3
message Int128 {
uint64 high = 1 [features = { field_presence: IMPLICIT }];
uint64 low = 2 [features = { field_presence: IMPLICIT }];
}
// User selected mode. The UNSPECIFIED entry is used to specify the mode is
// unaltered or 'default'.
// Next ID: 4
enum ComposeUpfrontInputMode {
COMPOSE_UNSPECIFIED_MODE = 0;
COMPOSE_POLISH_MODE = 1;
COMPOSE_ELABORATE_MODE = 2;
COMPOSE_FORMALIZE_MODE = 3;
}
// User selected tone. Here the UNSPECIFIED entry is used to specify the tone is
// unaltered or 'default'.
// Next ID: 3
enum ComposeTone {
COMPOSE_UNSPECIFIED_TONE = 0;
COMPOSE_FORMAL = 1;
COMPOSE_INFORMAL = 2;
}
// User selected length. Here the UNSPECIFIED entry is used to specify the
// tone is unaltered or 'default'.
// Next ID: 3
enum ComposeLength {
COMPOSE_UNSPECIFIED_LENGTH = 0;
COMPOSE_SHORTER = 1;
COMPOSE_LONGER = 2;
}
// The final status of the feature.
// Next ID: 4
enum FinalStatus {
// The dialog was not closed, and a subsequent model request should be
// logged.
STATUS_UNSPECIFIED = 0;
// The user inserted this response into the page.
STATUS_INSERTED = 1;
// User pressed 'X' or started a new session with a selection.
STATUS_ABANDONED = 2;
// This case includes: close tab, navigation, session expired etc.
// Used after M124.
STATUS_FINISHED_WITHOUT_INSERT = 3;
}
// Status code used in compose responses.
// Next ID: 17
enum ClientRequestStatus {
CLIENT_REQUEST_STATUS_UNSPECIFIED = 0;
CLIENT_REQUEST_STATUS_OK = 1;
// Generic client error, not specified.
CLIENT_REQUEST_STATUS_CLIENT_ERROR = 2;
// If the feature is somehow disabled.
CLIENT_REQUEST_STATUS_MISCONFIGURATION = 3;
// If permission is denied (e.g. user is not logged in.)
CLIENT_REQUEST_STATUS_PERMISSION_DENIED = 4;
// Generic server error, not specified.
CLIENT_REQUEST_STATUS_SERVER_ERROR = 5;
// Invalid request sent, likely a client issue where ComposeRequest is
// incorrect.
CLIENT_REQUEST_STATUS_INVALID_REQUEST = 6;
// Request was throttled.
CLIENT_REQUEST_STATUS_REQUEST_THROTTLED = 7;
// Retryable error occurred in the server.
CLIENT_REQUEST_STATUS_RETRYABLE_ERROR = 8;
// Non-retryable error occurred in the server (eg. server down).
CLIENT_REQUEST_STATUS_NON_RETRYABLE_ERROR = 9;
// Unsupported language used.
CLIENT_REQUEST_STATUS_UNSUPPORTED_LANGUAGE = 10;
// Request was filtered (eg. due to T&S).
CLIENT_REQUEST_STATUS_FILTERED = 11;
// Compose service was disabled.
CLIENT_REQUEST_STATUS_DISABLED = 12;
// Request was cancelled.
CLIENT_REQUEST_STATUS_CANCELLED = 13;
// No response received from the server.
CLIENT_REQUEST_STATUS_NO_RESPONSE = 14;
// If the user is offline.
CLIENT_REQUEST_STATUS_OFFLINE = 15;
// The request timed out.
CLIENT_REQUEST_STATUS_REQUEST_TIMED_OUT = 16;
}