File: compose.proto

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (261 lines) | stat: -rw-r--r-- 7,995 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
// 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;
}