File: forms_classifications.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 (229 lines) | stat: -rw-r--r-- 9,647 bytes parent folder | download | duplicates (3)
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
// 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/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 = "FormsClassificationsProto";

// 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: 6
message FormsClassificationsLoggingData {
  AutofillAiTypeRequest request = 1 [features = { field_presence: EXPLICIT }];

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

  FormTypeQuality quality = 3 [features = { field_presence: EXPLICIT }];

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

// Next ID: 7
message AutofillAiTypeRequest {
  // The context of the page that the form is on.
  PageContext page_context = 1 [features = { field_presence: EXPLICIT }];

  // The form to predict values for. It is expected that the values for each
  // field are empty.
  FormData form_data = 2 [features = { field_presence: EXPLICIT }];

  // A screenshot of the form.
  // This is optional and may be used by the model to improve predictions.
  FormMedia media = 3 [features = { field_presence: EXPLICIT }];

  // The annotated page content of the page that the form is on.
  AnnotatedPageContent annotated_page_content = 5 [features = { field_presence: EXPLICIT }];

  // Should include reasoning for debugging purposes.
  bool include_reasoning = 6 [features = { field_presence: IMPLICIT }];

  reserved 4;
}

message FormMedia {
  // Screenshots in base64-encoded PNG format
  repeated bytes screenshots = 1;
}

message AutofillAiTypeResponse {
  // A list of field-level type predictions for the form.
  repeated FieldTypeResponse field_responses = 1;
}

// Next ID: 7
message FieldTypeResponse {
  // The (zero-based) index of the field among those passed in the request that
  // this prediction refers to.
  int32 field_index = 5 [features = { field_presence: EXPLICIT }];

  // The predicted type for the field.
  int32 field_type = 2 [features = { field_presence: EXPLICIT }];

  // Optional formatting metadata for downstream use.
  // Example formats: "dd/mm/yyyy" for dates, "NAME_FIRST_LAST" for names.
  string formatting_meta = 3 [features = { field_presence: EXPLICIT }];

  // The confidence score for the prediction, ranging from 0.0 to 1.0.
  // Higher values indicate greater confidence in the predicted type.
  float confidence = 4 [features = { field_presence: IMPLICIT }];

  reserved 1, 6;
}

message FormTypeQuality {
  // User-provided feedback on the predictions.
  UserFeedback user_feedback = 1 [features = { field_presence: IMPLICIT }];

  AutofillAiFieldEvent field_event = 2 [features = { field_presence: EXPLICIT }];

  AutofillAiKeyMetrics key_metrics = 3 [features = { field_presence: EXPLICIT }];
}

// See `AutofillAiUkmLogger::FieldEvent`.
message AutofillAiFieldEvent {
  // The server AI type of the field as classified by autofill's ML model.
  int32 ai_field_type = 1 [features = { field_presence: EXPLICIT }];

  // Type of the event being recorded.
  AutofillAiFieldEventType event_type = 2 [features = { field_presence: IMPLICIT }];

  // A random variable assigned to a specific instance of a form control (e.g.
  // a HTML input element). This should be globally unique and suitable for
  // distinguishing fields. Two different users would have different values.
  // For the same user, the same field in the same form in two different tabs
  // would have two different values.
  uint64 field_session_identifier = 3 [features = { field_presence: IMPLICIT }];

  // The signature of the field (mod 1021). This is the hash identifier used to
  // denote this field for query and voting purposes. See
  // components/autofill/core/common/signatures.cc for more details.
  uint64 field_signature = 4 [features = { field_presence: IMPLICIT }];

  // The type of the field as classified by autofill.
  int32 field_type = 5 [features = { field_presence: EXPLICIT }];

  // The source of the format string of the field, see `FormatStringSource` in
  // components/autofill/core/browser/autofill_field.h for more info.
  FormatStringSource format_string_source = 6 [features = { field_presence: IMPLICIT }];

  // The order of the event in the sequence of events sharing the same
  // FormSessionIdentifier.
  int32 form_session_event_order = 7 [features = { field_presence: IMPLICIT }];

  // A random variable assigned to a specific instance of a HTML form in a
  // specific renderer. This should be globally unique and suitable for
  // counting distinct forms. Two different users would have different values.
  // A single user loading the same form in two different tabs would have two
  // different values. This is used to link the fields to a form in
  // AutofillAi.KeyMetrics.
  uint64 form_session_identifier = 8 [features = { field_presence: IMPLICIT }];

  // The signature of the form (mod 1021). This is the hash identifier used to
  // denote this form for query and voting purposes. See
  // components/autofill/core/common/signatures.cc for more details.
  uint64 form_signature = 9 [features = { field_presence: IMPLICIT }];

  // The index of the field in the list of fields of the form built by Autofill.
  uint32 field_rank = 10 [features = { field_presence: IMPLICIT }];

  // The index of the field in the list of fields of the form having the same
  // FieldSignature.
  uint32 field_rank_in_signature_group = 11 [features = { field_presence: IMPLICIT }];

  // The type of the underlying HTML element representing the field (e.g.,
  // input text, select one, etc.)
  FormControlType form_control_type = 12 [features = { field_presence: IMPLICIT }];

  // The registered domain of the page that the form is on.
  string domain = 13 [features = { field_presence: IMPLICIT }];
}

message AutofillAiKeyMetrics {
  // True if user accepted the suggestion to fill values on a submitted form,
  // and false otherwise. This is counted as true if the user accepted such a
  // suggestion at any time, regardless whether other suggestions were ignored
  // or whether the accepted suggestion was reverted afterwards.
  // Only recorded if suggestions were shown to the user.
  bool filling_acceptance = 1 [features = { field_presence: EXPLICIT }];

  // True if the user filled any fields via Autofill on a submitted form, and
  // false otherwise. If the user reverts the filling, the form is still
  // counted as filled.
  //
  // This metric is different from FillingAcceptance in the sense that the
  // latter is only recorded if the user has actually seen a prompt to fill
  // data.
  bool filling_assistance = 2 [features = { field_presence: IMPLICIT }];

  // False for submitted and autofilled forms if user edited at least one
  // filled value before submitting the form, true otherwise.
  // Only recorded if any suggestion was filled.
  bool filling_correctness = 3 [features = { field_presence: EXPLICIT }];

  // True for submitted forms when Autofill had any Autofill AI data to fill,
  // and false otherwise.
  //
  // It does not matter whether the user actually requested to fill the data.
  // It does not matter either whether the data available for filling
  // corresponded to the submitted data.
  bool filling_readiness = 4 [features = { field_presence: IMPLICIT }];

  // A random variable assigned to a specific instance of a HTML form in a
  // specific renderer. This should be globally unique and suitable for
  // counting distinct forms. Two different users would have different values.
  // A single user loading the same form in two different tabs would have two
  // different values. This is used to link the fields to a form in
  // AutofillAi.FieldInfo.
  uint64 form_session_identifier = 5 [features = { field_presence: IMPLICIT }];

  // The signature of the form (mod 1021). This is the hash identifier used to
  // denote this form for query and voting purposes. See
  // components/autofill/core/common/signatures.cc for more details.
  uint64 form_signature = 6 [features = { field_presence: IMPLICIT }];

  // The registered domain of the page that the form is on.
  string domain = 7 [features = { field_presence: IMPLICIT }];

  // The number of fields that were filled by Autofill at form submission. This
  // will include fields that are autofilled by any source except Autocomplete,
  // including AutofillAi.
  int32 autofill_filled_field_count = 8 [features = { field_presence: IMPLICIT }];

  // The number of fields that were filled by Autofill AI at form submission
  // specifically, all fields autofilled by other sources will be excluded.
  int32 autofill_ai_filled_field_count = 9 [features = { field_presence: IMPLICIT }];
}

enum AutofillAiFieldEventType {
  AUTOFILL_AI_FIELD_EVENT_TYPE_SUGGESTION_SHOWN = 0;

  AUTOFILL_AI_FIELD_EVENT_TYPE_SUGGESTION_FILLED = 1;

  AUTOFILL_AI_FIELD_EVENT_TYPE_EDITED_AUTOFILLED_FIELD = 2;

  AUTOFILL_AI_FIELD_EVENT_TYPE_FIELD_FILLED = 3;
}

enum FormatStringSource {
  FORMAT_STRING_SOURCE_UNSET = 0;

  FORMAT_STRING_SOURCE_HEURISTICS = 1;

  FORMAT_STRING_SOURCE_ML_MODEL = 2;

  FORMAT_STRING_SOURCE_SERVER = 3;
}