• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.documentai.v1beta3;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/cloud/documentai/v1beta3/document.proto";
24import "google/cloud/documentai/v1beta3/document_io.proto";
25import "google/cloud/documentai/v1beta3/document_schema.proto";
26import "google/cloud/documentai/v1beta3/evaluation.proto";
27import "google/cloud/documentai/v1beta3/operation_metadata.proto";
28import "google/cloud/documentai/v1beta3/processor.proto";
29import "google/cloud/documentai/v1beta3/processor_type.proto";
30import "google/longrunning/operations.proto";
31import "google/protobuf/empty.proto";
32import "google/protobuf/field_mask.proto";
33import "google/protobuf/timestamp.proto";
34import "google/rpc/status.proto";
35
36option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3";
37option go_package = "cloud.google.com/go/documentai/apiv1beta3/documentaipb;documentaipb";
38option java_multiple_files = true;
39option java_outer_classname = "DocumentAiProcessorService";
40option java_package = "com.google.cloud.documentai.v1beta3";
41option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3";
42option ruby_package = "Google::Cloud::DocumentAI::V1beta3";
43option (google.api.resource_definition) = {
44  type: "documentai.googleapis.com/HumanReviewConfig"
45  pattern: "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig"
46};
47option (google.api.resource_definition) = {
48  type: "documentai.googleapis.com/Location"
49  pattern: "projects/{project}/locations/{location}"
50};
51
52// Service to call Document AI to process documents according to the
53// processor's definition. Processors are built using state-of-the-art Google
54// AI such as natural language, computer vision, and translation to extract
55// structured information from unstructured or semi-structured documents.
56service DocumentProcessorService {
57  option (google.api.default_host) = "documentai.googleapis.com";
58  option (google.api.oauth_scopes) =
59      "https://www.googleapis.com/auth/cloud-platform";
60
61  // Processes a single document.
62  rpc ProcessDocument(ProcessRequest) returns (ProcessResponse) {
63    option (google.api.http) = {
64      post: "/v1beta3/{name=projects/*/locations/*/processors/*}:process"
65      body: "*"
66      additional_bindings {
67        post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process"
68        body: "*"
69      }
70    };
71    option (google.api.method_signature) = "name";
72  }
73
74  // LRO endpoint to batch process many documents. The output is written
75  // to Cloud Storage as JSON in the [Document] format.
76  rpc BatchProcessDocuments(BatchProcessRequest)
77      returns (google.longrunning.Operation) {
78    option (google.api.http) = {
79      post: "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess"
80      body: "*"
81      additional_bindings {
82        post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess"
83        body: "*"
84      }
85    };
86    option (google.api.method_signature) = "name";
87    option (google.longrunning.operation_info) = {
88      response_type: "BatchProcessResponse"
89      metadata_type: "BatchProcessMetadata"
90    };
91  }
92
93  // Fetches processor types. Note that we don't use
94  // [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes]
95  // here, because it isn't paginated.
96  rpc FetchProcessorTypes(FetchProcessorTypesRequest)
97      returns (FetchProcessorTypesResponse) {
98    option (google.api.http) = {
99      get: "/v1beta3/{parent=projects/*/locations/*}:fetchProcessorTypes"
100    };
101    option (google.api.method_signature) = "parent";
102  }
103
104  // Lists the processor types that exist.
105  rpc ListProcessorTypes(ListProcessorTypesRequest)
106      returns (ListProcessorTypesResponse) {
107    option (google.api.http) = {
108      get: "/v1beta3/{parent=projects/*/locations/*}/processorTypes"
109    };
110    option (google.api.method_signature) = "parent";
111  }
112
113  // Gets a processor type detail.
114  rpc GetProcessorType(GetProcessorTypeRequest) returns (ProcessorType) {
115    option (google.api.http) = {
116      get: "/v1beta3/{name=projects/*/locations/*/processorTypes/*}"
117    };
118    option (google.api.method_signature) = "name";
119  }
120
121  // Lists all processors which belong to this project.
122  rpc ListProcessors(ListProcessorsRequest) returns (ListProcessorsResponse) {
123    option (google.api.http) = {
124      get: "/v1beta3/{parent=projects/*/locations/*}/processors"
125    };
126    option (google.api.method_signature) = "parent";
127  }
128
129  // Gets a processor detail.
130  rpc GetProcessor(GetProcessorRequest) returns (Processor) {
131    option (google.api.http) = {
132      get: "/v1beta3/{name=projects/*/locations/*/processors/*}"
133    };
134    option (google.api.method_signature) = "name";
135  }
136
137  // Trains a new processor version.
138  // Operation metadata is returned as
139  // [TrainProcessorVersionMetadata][google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata].
140  rpc TrainProcessorVersion(TrainProcessorVersionRequest)
141      returns (google.longrunning.Operation) {
142    option (google.api.http) = {
143      post: "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:train"
144      body: "*"
145    };
146    option (google.api.method_signature) = "parent,processor_version";
147    option (google.longrunning.operation_info) = {
148      response_type: "TrainProcessorVersionResponse"
149      metadata_type: "TrainProcessorVersionMetadata"
150    };
151  }
152
153  // Gets a processor version detail.
154  rpc GetProcessorVersion(GetProcessorVersionRequest)
155      returns (ProcessorVersion) {
156    option (google.api.http) = {
157      get: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}"
158    };
159    option (google.api.method_signature) = "name";
160  }
161
162  // Lists all versions of a processor.
163  rpc ListProcessorVersions(ListProcessorVersionsRequest)
164      returns (ListProcessorVersionsResponse) {
165    option (google.api.http) = {
166      get: "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions"
167    };
168    option (google.api.method_signature) = "parent";
169  }
170
171  // Deletes the processor version, all artifacts under the processor version
172  // will be deleted.
173  rpc DeleteProcessorVersion(DeleteProcessorVersionRequest)
174      returns (google.longrunning.Operation) {
175    option (google.api.http) = {
176      delete: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}"
177    };
178    option (google.api.method_signature) = "name";
179    option (google.longrunning.operation_info) = {
180      response_type: "google.protobuf.Empty"
181      metadata_type: "DeleteProcessorVersionMetadata"
182    };
183  }
184
185  // Deploys the processor version.
186  rpc DeployProcessorVersion(DeployProcessorVersionRequest)
187      returns (google.longrunning.Operation) {
188    option (google.api.http) = {
189      post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy"
190      body: "*"
191    };
192    option (google.api.method_signature) = "name";
193    option (google.longrunning.operation_info) = {
194      response_type: "DeployProcessorVersionResponse"
195      metadata_type: "DeployProcessorVersionMetadata"
196    };
197  }
198
199  // Undeploys the processor version.
200  rpc UndeployProcessorVersion(UndeployProcessorVersionRequest)
201      returns (google.longrunning.Operation) {
202    option (google.api.http) = {
203      post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy"
204      body: "*"
205    };
206    option (google.api.method_signature) = "name";
207    option (google.longrunning.operation_info) = {
208      response_type: "UndeployProcessorVersionResponse"
209      metadata_type: "UndeployProcessorVersionMetadata"
210    };
211  }
212
213  // Creates a processor from the
214  // [ProcessorType][google.cloud.documentai.v1beta3.ProcessorType] provided.
215  // The processor will be at `ENABLED` state by default after its creation.
216  rpc CreateProcessor(CreateProcessorRequest) returns (Processor) {
217    option (google.api.http) = {
218      post: "/v1beta3/{parent=projects/*/locations/*}/processors"
219      body: "processor"
220    };
221    option (google.api.method_signature) = "parent,processor";
222  }
223
224  // Deletes the processor, unloads all deployed model artifacts if it was
225  // enabled and then deletes all artifacts associated with this processor.
226  rpc DeleteProcessor(DeleteProcessorRequest)
227      returns (google.longrunning.Operation) {
228    option (google.api.http) = {
229      delete: "/v1beta3/{name=projects/*/locations/*/processors/*}"
230    };
231    option (google.api.method_signature) = "name";
232    option (google.longrunning.operation_info) = {
233      response_type: "google.protobuf.Empty"
234      metadata_type: "DeleteProcessorMetadata"
235    };
236  }
237
238  // Enables a processor
239  rpc EnableProcessor(EnableProcessorRequest)
240      returns (google.longrunning.Operation) {
241    option (google.api.http) = {
242      post: "/v1beta3/{name=projects/*/locations/*/processors/*}:enable"
243      body: "*"
244    };
245    option (google.longrunning.operation_info) = {
246      response_type: "EnableProcessorResponse"
247      metadata_type: "EnableProcessorMetadata"
248    };
249  }
250
251  // Disables a processor
252  rpc DisableProcessor(DisableProcessorRequest)
253      returns (google.longrunning.Operation) {
254    option (google.api.http) = {
255      post: "/v1beta3/{name=projects/*/locations/*/processors/*}:disable"
256      body: "*"
257    };
258    option (google.longrunning.operation_info) = {
259      response_type: "DisableProcessorResponse"
260      metadata_type: "DisableProcessorMetadata"
261    };
262  }
263
264  // Set the default (active) version of a
265  // [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in
266  // [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument]
267  // and
268  // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
269  rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest)
270      returns (google.longrunning.Operation) {
271    option (google.api.http) = {
272      post: "/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion"
273      body: "*"
274    };
275    option (google.longrunning.operation_info) = {
276      response_type: "SetDefaultProcessorVersionResponse"
277      metadata_type: "SetDefaultProcessorVersionMetadata"
278    };
279  }
280
281  // Send a document for Human Review. The input document should be processed by
282  // the specified processor.
283  rpc ReviewDocument(ReviewDocumentRequest)
284      returns (google.longrunning.Operation) {
285    option (google.api.http) = {
286      post: "/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument"
287      body: "*"
288    };
289    option (google.api.method_signature) = "human_review_config";
290    option (google.longrunning.operation_info) = {
291      response_type: "ReviewDocumentResponse"
292      metadata_type: "ReviewDocumentOperationMetadata"
293    };
294  }
295
296  // Evaluates a ProcessorVersion against annotated documents, producing an
297  // Evaluation.
298  rpc EvaluateProcessorVersion(EvaluateProcessorVersionRequest)
299      returns (google.longrunning.Operation) {
300    option (google.api.http) = {
301      post: "/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion"
302      body: "*"
303    };
304    option (google.api.method_signature) = "processor_version";
305    option (google.longrunning.operation_info) = {
306      response_type: "EvaluateProcessorVersionResponse"
307      metadata_type: "EvaluateProcessorVersionMetadata"
308    };
309  }
310
311  // Retrieves a specific evaluation.
312  rpc GetEvaluation(GetEvaluationRequest) returns (Evaluation) {
313    option (google.api.http) = {
314      get: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}"
315    };
316    option (google.api.method_signature) = "name";
317  }
318
319  // Retrieves a set of evaluations for a given processor version.
320  rpc ListEvaluations(ListEvaluationsRequest)
321      returns (ListEvaluationsResponse) {
322    option (google.api.http) = {
323      get: "/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations"
324    };
325    option (google.api.method_signature) = "parent";
326  }
327
328  // Imports a processor version from source processor version.
329  rpc ImportProcessorVersion(ImportProcessorVersionRequest)
330      returns (google.longrunning.Operation) {
331    option (google.api.http) = {
332      post: "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:importProcessorVersion"
333      body: "*"
334    };
335    option (google.api.method_signature) = "parent";
336    option (google.longrunning.operation_info) = {
337      response_type: "ImportProcessorVersionResponse"
338      metadata_type: "ImportProcessorVersionMetadata"
339    };
340  }
341}
342
343// Options for Process API
344message ProcessOptions {
345  // Serving config for layout parser processor.
346  message LayoutConfig {
347    // Serving config for chunking.
348    message ChunkingConfig {
349      // Optional. The chunk sizes to use when splitting documents, in order of
350      // level.
351      int32 chunk_size = 1 [(google.api.field_behavior) = OPTIONAL];
352
353      // Optional. Whether or not to include ancestor headings when splitting.
354      bool include_ancestor_headings = 2
355          [(google.api.field_behavior) = OPTIONAL];
356
357      // Optional. The number of tokens to group together when evaluating
358      // semantic similarity.
359      bool semantic_chunking_group_size = 3
360          [(google.api.field_behavior) = OPTIONAL];
361
362      // Optional. The percentile of cosine dissimilarity that must be exceeded
363      // between a group of tokens and the next. The smaller this number is, the
364      // more chunks will be generated.
365      int32 breakpoint_percentile_threshold = 4
366          [(google.api.field_behavior) = OPTIONAL];
367    }
368
369    // Optional. Config for chunking in layout parser processor.
370    ChunkingConfig chunking_config = 1 [(google.api.field_behavior) = OPTIONAL];
371  }
372
373  // A list of individual page numbers.
374  message IndividualPageSelector {
375    // Optional. Indices of the pages (starting from 1).
376    repeated int32 pages = 1 [(google.api.field_behavior) = OPTIONAL];
377  }
378
379  // A subset of pages to process. If not specified, all pages are processed.
380  // If a page range is set, only the given pages are extracted and processed
381  // from the document. In the output document,
382  // [Document.Page.page_number][google.cloud.documentai.v1beta3.Document.Page.page_number]
383  // refers to the page number in the original document. This configuration
384  // only applies to sync requests.
385  oneof page_range {
386    // Which pages to process (1-indexed).
387    IndividualPageSelector individual_page_selector = 5;
388
389    // Only process certain pages from the start. Process all if the document
390    // has fewer pages.
391    int32 from_start = 6;
392
393    // Only process certain pages from the end, same as above.
394    int32 from_end = 7;
395  }
396
397  // Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`.
398  // Returns error if set on other processor types.
399  OcrConfig ocr_config = 1;
400
401  // Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`.
402  // Returns error if set on other processor types.
403  LayoutConfig layout_config = 9 [(google.api.field_behavior) = OPTIONAL];
404
405  // Optional. Override the schema of the
406  // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]. Will
407  // return an Invalid Argument error if this field is set when the underlying
408  // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
409  // doesn't support schema override.
410  DocumentSchema schema_override = 8 [(google.api.field_behavior) = OPTIONAL];
411}
412
413// Request message for the
414// [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument]
415// method.
416message ProcessRequest {
417  // The document payload.
418  oneof source {
419    // An inline document proto.
420    Document inline_document = 4;
421
422    // A raw document content (bytes).
423    RawDocument raw_document = 5;
424
425    // A raw document on Google Cloud Storage.
426    GcsDocument gcs_document = 8;
427  }
428
429  // Required. The resource name of the
430  // [Processor][google.cloud.documentai.v1beta3.Processor] or
431  // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
432  // to use for processing. If a
433  // [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the
434  // server will use its [default
435  // version][google.cloud.documentai.v1beta3.Processor.default_processor_version].
436  // Format: `projects/{project}/locations/{location}/processors/{processor}`,
437  // or
438  // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
439  string name = 1 [
440    (google.api.field_behavior) = REQUIRED,
441    (google.api.resource_reference) = { type: "*" }
442  ];
443
444  // The document payload, the
445  // [content][google.cloud.documentai.v1beta3.Document.content] and
446  // [mime_type][google.cloud.documentai.v1beta3.Document.mime_type] fields must
447  // be set.
448  Document document = 2 [deprecated = true];
449
450  // Whether human review should be skipped for this request. Default to
451  // `false`.
452  bool skip_human_review = 3;
453
454  // Specifies which fields to include in the
455  // [ProcessResponse.document][google.cloud.documentai.v1beta3.ProcessResponse.document]
456  // output. Only supports top-level document and pages field, so it must be in
457  // the form of `{document_field_name}` or `pages.{page_field_name}`.
458  google.protobuf.FieldMask field_mask = 6;
459
460  // Inference-time options for the process API
461  ProcessOptions process_options = 7;
462
463  // Optional. The labels with user-defined metadata for the request.
464  //
465  // Label keys and values can be no longer than 63 characters
466  // (Unicode codepoints) and can only contain lowercase letters, numeric
467  // characters, underscores, and dashes. International characters are allowed.
468  // Label values are optional. Label keys must start with a letter.
469  map<string, string> labels = 10 [(google.api.field_behavior) = OPTIONAL];
470}
471
472// The status of human review on a processed document.
473message HumanReviewStatus {
474  // The final state of human review on a processed document.
475  enum State {
476    // Human review state is unspecified. Most likely due to an internal error.
477    STATE_UNSPECIFIED = 0;
478
479    // Human review is skipped for the document. This can happen because human
480    // review isn't enabled on the processor or the processing request has
481    // been set to skip this document.
482    SKIPPED = 1;
483
484    // Human review validation is triggered and passed, so no review is needed.
485    VALIDATION_PASSED = 2;
486
487    // Human review validation is triggered and the document is under review.
488    IN_PROGRESS = 3;
489
490    // Some error happened during triggering human review, see the
491    // [state_message][google.cloud.documentai.v1beta3.HumanReviewStatus.state_message]
492    // for details.
493    ERROR = 4;
494  }
495
496  // The state of human review on the processing request.
497  State state = 1;
498
499  // A message providing more details about the human review state.
500  string state_message = 2;
501
502  // The name of the operation triggered by the processed document. This field
503  // is populated only when the
504  // [state][google.cloud.documentai.v1beta3.HumanReviewStatus.state] is
505  // `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as
506  // the long-running operation returned by
507  // [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument].
508  string human_review_operation = 3;
509}
510
511// Response message for the
512// [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument]
513// method.
514message ProcessResponse {
515  // The document payload, will populate fields based on the processor's
516  // behavior.
517  Document document = 1;
518
519  // The name of the operation triggered by the processed document. If the human
520  // review process isn't triggered, this field is empty. It has the same
521  // response type and metadata as the long-running operation returned by
522  // [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument].
523  string human_review_operation = 2 [deprecated = true];
524
525  // The status of human review on the processed document.
526  HumanReviewStatus human_review_status = 3;
527}
528
529// Request message for
530// [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
531message BatchProcessRequest {
532  // The message for input config in batch process.
533  message BatchInputConfig {
534    option deprecated = true;
535
536    // The Cloud Storage location as the source of the document.
537    string gcs_source = 1;
538
539    // An IANA published [media type (MIME
540    // type)](https://www.iana.org/assignments/media-types/media-types.xhtml) of
541    // the input. If the input is a raw document, refer to [supported file
542    // types](https://cloud.google.com/document-ai/docs/file-types) for the list
543    // of media types. If the input is a
544    // [Document][google.cloud.documentai.v1beta3.Document], the type should be
545    // `application/json`.
546    string mime_type = 2;
547  }
548
549  // The output configuration in the
550  // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]
551  // method.
552  message BatchOutputConfig {
553    option deprecated = true;
554
555    // The output Cloud Storage directory to put the processed documents.
556    string gcs_destination = 1;
557  }
558
559  // Required. The resource name of
560  // [Processor][google.cloud.documentai.v1beta3.Processor] or
561  // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
562  // Format: `projects/{project}/locations/{location}/processors/{processor}`,
563  // or
564  // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
565  string name = 1 [
566    (google.api.field_behavior) = REQUIRED,
567    (google.api.resource_reference) = { type: "*" }
568  ];
569
570  // The input config for each single document in the batch process.
571  repeated BatchInputConfig input_configs = 2 [deprecated = true];
572
573  // The overall output config for batch process.
574  BatchOutputConfig output_config = 3 [deprecated = true];
575
576  // The input documents for the
577  // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]
578  // method.
579  BatchDocumentsInputConfig input_documents = 5;
580
581  // The output configuration for the
582  // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments]
583  // method.
584  DocumentOutputConfig document_output_config = 6;
585
586  // Whether human review should be skipped for this request. Default to
587  // `false`.
588  bool skip_human_review = 4;
589
590  // Inference-time options for the process API
591  ProcessOptions process_options = 7;
592
593  // Optional. The labels with user-defined metadata for the request.
594  //
595  // Label keys and values can be no longer than 63 characters
596  // (Unicode codepoints) and can only contain lowercase letters, numeric
597  // characters, underscores, and dashes. International characters are allowed.
598  // Label values are optional. Label keys must start with a letter.
599  map<string, string> labels = 9 [(google.api.field_behavior) = OPTIONAL];
600}
601
602// Response message for
603// [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
604message BatchProcessResponse {}
605
606// The long-running operation metadata for
607// [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
608message BatchProcessMetadata {
609  // The status of a each individual document in the batch process.
610  message IndividualProcessStatus {
611    // The source of the document, same as the
612    // [input_gcs_source][google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source]
613    // field in the request when the batch process started.
614    string input_gcs_source = 1;
615
616    // The status processing the document.
617    google.rpc.Status status = 2;
618
619    // The Cloud Storage output destination (in the request as
620    // [DocumentOutputConfig.GcsOutputConfig.gcs_uri][google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.gcs_uri])
621    // of the processed document if it was successful, otherwise empty.
622    string output_gcs_destination = 3;
623
624    // The name of the operation triggered by the processed document. If the
625    // human review process isn't triggered, this field will be empty. It has
626    // the same response type and metadata as the long-running operation
627    // returned by the
628    // [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument]
629    // method.
630    string human_review_operation = 4 [deprecated = true];
631
632    // The status of human review on the processed document.
633    HumanReviewStatus human_review_status = 5;
634  }
635
636  // Possible states of the batch processing operation.
637  enum State {
638    // The default value. This value is used if the state is omitted.
639    STATE_UNSPECIFIED = 0;
640
641    // Request operation is waiting for scheduling.
642    WAITING = 1;
643
644    // Request is being processed.
645    RUNNING = 2;
646
647    // The batch processing completed successfully.
648    SUCCEEDED = 3;
649
650    // The batch processing was being cancelled.
651    CANCELLING = 4;
652
653    // The batch processing was cancelled.
654    CANCELLED = 5;
655
656    // The batch processing has failed.
657    FAILED = 6;
658  }
659
660  // The state of the current batch processing.
661  State state = 1;
662
663  // A message providing more details about the current state of processing.
664  // For example, the error message if the operation is failed.
665  string state_message = 2;
666
667  // The creation time of the operation.
668  google.protobuf.Timestamp create_time = 3;
669
670  // The last update time of the operation.
671  google.protobuf.Timestamp update_time = 4;
672
673  // The list of response details of each document.
674  repeated IndividualProcessStatus individual_process_statuses = 5;
675}
676
677// Request message for the
678// [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes]
679// method. Some processor types may require the project be added to an
680// allowlist.
681message FetchProcessorTypesRequest {
682  // Required. The location of processor types to list.
683  // Format: `projects/{project}/locations/{location}`.
684  string parent = 1 [
685    (google.api.field_behavior) = REQUIRED,
686    (google.api.resource_reference) = {
687      child_type: "documentai.googleapis.com/ProcessorType"
688    }
689  ];
690}
691
692// Response message for the
693// [FetchProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes]
694// method.
695message FetchProcessorTypesResponse {
696  // The list of processor types.
697  repeated ProcessorType processor_types = 1;
698}
699
700// Request message for the
701// [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes]
702// method. Some processor types may require the project be added to an
703// allowlist.
704message ListProcessorTypesRequest {
705  // Required. The location of processor types to list.
706  // Format: `projects/{project}/locations/{location}`.
707  string parent = 1 [
708    (google.api.field_behavior) = REQUIRED,
709    (google.api.resource_reference) = {
710      child_type: "documentai.googleapis.com/ProcessorType"
711    }
712  ];
713
714  // The maximum number of processor types to return.
715  // If unspecified, at most `100` processor types will be returned.
716  // The maximum value is `500`. Values above `500` will be coerced to `500`.
717  int32 page_size = 2;
718
719  // Used to retrieve the next page of results, empty if at the end of the list.
720  string page_token = 3;
721}
722
723// Response message for the
724// [ListProcessorTypes][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes]
725// method.
726message ListProcessorTypesResponse {
727  // The processor types.
728  repeated ProcessorType processor_types = 1;
729
730  // Points to the next page, otherwise empty.
731  string next_page_token = 2;
732}
733
734// Request message for list all processors belongs to a project.
735message ListProcessorsRequest {
736  // Required. The parent (project and location) which owns this collection of
737  // Processors. Format: `projects/{project}/locations/{location}`
738  string parent = 1 [
739    (google.api.field_behavior) = REQUIRED,
740    (google.api.resource_reference) = {
741      child_type: "documentai.googleapis.com/Processor"
742    }
743  ];
744
745  // The maximum number of processors to return.
746  // If unspecified, at most `50` processors will be returned.
747  // The maximum value is `100`. Values above `100` will be coerced to `100`.
748  int32 page_size = 2;
749
750  // We will return the processors sorted by creation time. The page token
751  // will point to the next processor.
752  string page_token = 3;
753}
754
755// Response message for the
756// [ListProcessors][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors]
757// method.
758message ListProcessorsResponse {
759  // The list of processors.
760  repeated Processor processors = 1;
761
762  // Points to the next processor, otherwise empty.
763  string next_page_token = 2;
764}
765
766// Request message for the
767// [GetProcessorType][google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType]
768// method.
769message GetProcessorTypeRequest {
770  // Required. The processor type resource name.
771  string name = 1 [
772    (google.api.field_behavior) = REQUIRED,
773    (google.api.resource_reference) = {
774      type: "documentai.googleapis.com/ProcessorType"
775    }
776  ];
777}
778
779// Request message for the
780// [GetProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor]
781// method.
782message GetProcessorRequest {
783  // Required. The processor resource name.
784  string name = 1 [
785    (google.api.field_behavior) = REQUIRED,
786    (google.api.resource_reference) = {
787      type: "documentai.googleapis.com/Processor"
788    }
789  ];
790}
791
792// Request message for the
793// [GetProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion]
794// method.
795message GetProcessorVersionRequest {
796  // Required. The processor resource name.
797  string name = 1 [
798    (google.api.field_behavior) = REQUIRED,
799    (google.api.resource_reference) = {
800      type: "documentai.googleapis.com/ProcessorVersion"
801    }
802  ];
803}
804
805// Request message for list all processor versions belongs to a processor.
806message ListProcessorVersionsRequest {
807  // Required. The parent (project, location and processor) to list all
808  // versions. Format:
809  // `projects/{project}/locations/{location}/processors/{processor}`
810  string parent = 1 [
811    (google.api.field_behavior) = REQUIRED,
812    (google.api.resource_reference) = {
813      child_type: "documentai.googleapis.com/ProcessorVersion"
814    }
815  ];
816
817  // The maximum number of processor versions to return.
818  // If unspecified, at most `10` processor versions will be returned.
819  // The maximum value is `20`. Values above `20` will be coerced to `20`.
820  int32 page_size = 2;
821
822  // We will return the processor versions sorted by creation time. The page
823  // token will point to the next processor version.
824  string page_token = 3;
825}
826
827// Response message for the
828// [ListProcessorVersions][google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions]
829// method.
830message ListProcessorVersionsResponse {
831  // The list of processors.
832  repeated ProcessorVersion processor_versions = 1;
833
834  // Points to the next processor, otherwise empty.
835  string next_page_token = 2;
836}
837
838// Request message for the
839// [DeleteProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion]
840// method.
841message DeleteProcessorVersionRequest {
842  // Required. The processor version resource name to be deleted.
843  string name = 1 [
844    (google.api.field_behavior) = REQUIRED,
845    (google.api.resource_reference) = {
846      type: "documentai.googleapis.com/ProcessorVersion"
847    }
848  ];
849}
850
851// The long-running operation metadata for the
852// [DeleteProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion]
853// method.
854message DeleteProcessorVersionMetadata {
855  // The basic metadata of the long-running operation.
856  CommonOperationMetadata common_metadata = 1;
857}
858
859// Request message for the
860// [DeployProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion]
861// method.
862message DeployProcessorVersionRequest {
863  // Required. The processor version resource name to be deployed.
864  string name = 1 [
865    (google.api.field_behavior) = REQUIRED,
866    (google.api.resource_reference) = {
867      type: "documentai.googleapis.com/ProcessorVersion"
868    }
869  ];
870}
871
872// Response message for the
873// [DeployProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion]
874// method.
875message DeployProcessorVersionResponse {}
876
877// The long-running operation metadata for the
878// [DeployProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion]
879// method.
880message DeployProcessorVersionMetadata {
881  // The basic metadata of the long-running operation.
882  CommonOperationMetadata common_metadata = 1;
883}
884
885// Request message for the
886// [UndeployProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion]
887// method.
888message UndeployProcessorVersionRequest {
889  // Required. The processor version resource name to be undeployed.
890  string name = 1 [
891    (google.api.field_behavior) = REQUIRED,
892    (google.api.resource_reference) = {
893      type: "documentai.googleapis.com/ProcessorVersion"
894    }
895  ];
896}
897
898// Response message for the
899// [UndeployProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion]
900// method.
901message UndeployProcessorVersionResponse {}
902
903// The long-running operation metadata for the
904// [UndeployProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion]
905// method.
906message UndeployProcessorVersionMetadata {
907  // The basic metadata of the long-running operation.
908  CommonOperationMetadata common_metadata = 1;
909}
910
911// Request message for the
912// [CreateProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor]
913// method. Notice this request is sent to a regionalized backend service. If the
914// [ProcessorType][google.cloud.documentai.v1beta3.ProcessorType] isn't
915// available in that region, the creation fails.
916message CreateProcessorRequest {
917  // Required. The parent (project and location) under which to create the
918  // processor. Format: `projects/{project}/locations/{location}`
919  string parent = 1 [
920    (google.api.field_behavior) = REQUIRED,
921    (google.api.resource_reference) = {
922      child_type: "documentai.googleapis.com/Processor"
923    }
924  ];
925
926  // Required. The processor to be created, requires
927  // [Processor.type][google.cloud.documentai.v1beta3.Processor.type] and
928  // [Processor.display_name][google.cloud.documentai.v1beta3.Processor.display_name]
929  // to be set. Also, the
930  // [Processor.kms_key_name][google.cloud.documentai.v1beta3.Processor.kms_key_name]
931  // field must be set if the processor is under CMEK.
932  Processor processor = 2 [(google.api.field_behavior) = REQUIRED];
933}
934
935// Request message for the
936// [DeleteProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor]
937// method.
938message DeleteProcessorRequest {
939  // Required. The processor resource name to be deleted.
940  string name = 1 [
941    (google.api.field_behavior) = REQUIRED,
942    (google.api.resource_reference) = {
943      type: "documentai.googleapis.com/Processor"
944    }
945  ];
946}
947
948// The long-running operation metadata for the
949// [DeleteProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor]
950// method.
951message DeleteProcessorMetadata {
952  // The basic metadata of the long-running operation.
953  CommonOperationMetadata common_metadata = 5;
954}
955
956// Request message for the
957// [EnableProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor]
958// method.
959message EnableProcessorRequest {
960  // Required. The processor resource name to be enabled.
961  string name = 1 [
962    (google.api.field_behavior) = REQUIRED,
963    (google.api.resource_reference) = {
964      type: "documentai.googleapis.com/Processor"
965    }
966  ];
967}
968
969// Response message for the
970// [EnableProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor]
971// method. Intentionally empty proto for adding fields in future.
972message EnableProcessorResponse {}
973
974// The long-running operation metadata for the
975// [EnableProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor]
976// method.
977message EnableProcessorMetadata {
978  // The basic metadata of the long-running operation.
979  CommonOperationMetadata common_metadata = 5;
980}
981
982// Request message for the
983// [DisableProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor]
984// method.
985message DisableProcessorRequest {
986  // Required. The processor resource name to be disabled.
987  string name = 1 [
988    (google.api.field_behavior) = REQUIRED,
989    (google.api.resource_reference) = {
990      type: "documentai.googleapis.com/Processor"
991    }
992  ];
993}
994
995// Response message for the
996// [DisableProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor]
997// method. Intentionally empty proto for adding fields in future.
998message DisableProcessorResponse {}
999
1000// The long-running operation metadata for the
1001// [DisableProcessor][google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor]
1002// method.
1003message DisableProcessorMetadata {
1004  // The basic metadata of the long-running operation.
1005  CommonOperationMetadata common_metadata = 5;
1006}
1007
1008// Request message for the
1009// [SetDefaultProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion]
1010// method.
1011message SetDefaultProcessorVersionRequest {
1012  // Required. The resource name of the
1013  // [Processor][google.cloud.documentai.v1beta3.Processor] to change default
1014  // version.
1015  string processor = 1 [
1016    (google.api.field_behavior) = REQUIRED,
1017    (google.api.resource_reference) = {
1018      type: "documentai.googleapis.com/Processor"
1019    }
1020  ];
1021
1022  // Required. The resource name of child
1023  // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use
1024  // as default. Format:
1025  // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
1026  string default_processor_version = 2 [
1027    (google.api.field_behavior) = REQUIRED,
1028    (google.api.resource_reference) = {
1029      type: "documentai.googleapis.com/ProcessorVersion"
1030    }
1031  ];
1032}
1033
1034// Response message for the
1035// [SetDefaultProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion]
1036// method.
1037message SetDefaultProcessorVersionResponse {}
1038
1039// The long-running operation metadata for the
1040// [SetDefaultProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion]
1041// method.
1042message SetDefaultProcessorVersionMetadata {
1043  // The basic metadata of the long-running operation.
1044  CommonOperationMetadata common_metadata = 1;
1045}
1046
1047// Request message for the
1048// [TrainProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion]
1049// method.
1050message TrainProcessorVersionRequest {
1051  // The input data used to train a new
1052  // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
1053  message InputData {
1054    // The documents used for training the new version.
1055    BatchDocumentsInputConfig training_documents = 3;
1056
1057    // The documents used for testing the trained version.
1058    BatchDocumentsInputConfig test_documents = 4;
1059  }
1060
1061  // Options to control the training of the Custom Document Extraction (CDE)
1062  // Processor.
1063  message CustomDocumentExtractionOptions {
1064    // Training Method for CDE. `TRAINING_METHOD_UNSPECIFIED` will fall back to
1065    // `MODEL_BASED`.
1066    enum TrainingMethod {
1067      TRAINING_METHOD_UNSPECIFIED = 0;
1068
1069      MODEL_BASED = 1;
1070
1071      TEMPLATE_BASED = 2;
1072    }
1073
1074    // Training method to use for CDE training.
1075    TrainingMethod training_method = 3;
1076  }
1077
1078  // Options to control foundation model tuning of the processor.
1079  message FoundationModelTuningOptions {
1080    // Optional. The number of steps to run for model tuning. Valid values are
1081    // between 1 and 400. If not provided, recommended steps will be used.
1082    int32 train_steps = 2 [(google.api.field_behavior) = OPTIONAL];
1083
1084    // Optional. The multiplier to apply to the recommended learning rate. Valid
1085    // values are between 0.1 and 10. If not provided, recommended learning rate
1086    // will be used.
1087    float learning_rate_multiplier = 3 [(google.api.field_behavior) = OPTIONAL];
1088  }
1089
1090  oneof processor_flags {
1091    // Options to control Custom Document Extraction (CDE) Processor.
1092    CustomDocumentExtractionOptions custom_document_extraction_options = 5;
1093
1094    // Options to control foundation model tuning of a processor.
1095    FoundationModelTuningOptions foundation_model_tuning_options = 12;
1096  }
1097
1098  // Required. The parent (project, location and processor) to create the new
1099  // version for. Format:
1100  // `projects/{project}/locations/{location}/processors/{processor}`.
1101  string parent = 1 [
1102    (google.api.field_behavior) = REQUIRED,
1103    (google.api.resource_reference) = {
1104      type: "documentai.googleapis.com/Processor"
1105    }
1106  ];
1107
1108  // Required. The processor version to be created.
1109  ProcessorVersion processor_version = 2
1110      [(google.api.field_behavior) = REQUIRED];
1111
1112  // Optional. The schema the processor version will be trained with.
1113  DocumentSchema document_schema = 10 [(google.api.field_behavior) = OPTIONAL];
1114
1115  // Optional. The input data used to train the
1116  // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
1117  InputData input_data = 4 [(google.api.field_behavior) = OPTIONAL];
1118
1119  // Optional. The processor version to use as a base for training. This
1120  // processor version must be a child of `parent`. Format:
1121  // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
1122  string base_processor_version = 8 [(google.api.field_behavior) = OPTIONAL];
1123}
1124
1125// The response for
1126// [TrainProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion].
1127message TrainProcessorVersionResponse {
1128  // The resource name of the processor version produced by training.
1129  string processor_version = 1;
1130}
1131
1132// The metadata that represents a processor version being created.
1133message TrainProcessorVersionMetadata {
1134  // The dataset validation information.
1135  // This includes any and all errors with documents and the dataset.
1136  message DatasetValidation {
1137    // The total number of document errors.
1138    int32 document_error_count = 3;
1139
1140    // The total number of dataset errors.
1141    int32 dataset_error_count = 4;
1142
1143    // Error information pertaining to specific documents. A maximum of 10
1144    // document errors will be returned.
1145    // Any document with errors will not be used throughout training.
1146    repeated google.rpc.Status document_errors = 1;
1147
1148    // Error information for the dataset as a whole. A maximum of 10 dataset
1149    // errors will be returned.
1150    // A single dataset error is terminal for training.
1151    repeated google.rpc.Status dataset_errors = 2;
1152  }
1153
1154  // The basic metadata of the long-running operation.
1155  CommonOperationMetadata common_metadata = 1;
1156
1157  // The training dataset validation information.
1158  DatasetValidation training_dataset_validation = 2;
1159
1160  // The test dataset validation information.
1161  DatasetValidation test_dataset_validation = 3;
1162}
1163
1164// Request message for the
1165// [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument]
1166// method.
1167message ReviewDocumentRequest {
1168  // The priority level of the human review task.
1169  enum Priority {
1170    // The default priority level.
1171    DEFAULT = 0;
1172
1173    // The urgent priority level. The labeling manager should allocate labeler
1174    // resource to the urgent task queue to respect this priority level.
1175    URGENT = 1;
1176  }
1177
1178  // The document payload.
1179  oneof source {
1180    // An inline document proto.
1181    Document inline_document = 4;
1182  }
1183
1184  // Required. The resource name of the
1185  // [HumanReviewConfig][google.cloud.documentai.v1beta3.HumanReviewConfig] that
1186  // the document will be reviewed with.
1187  string human_review_config = 1 [
1188    (google.api.field_behavior) = REQUIRED,
1189    (google.api.resource_reference) = {
1190      type: "documentai.googleapis.com/HumanReviewConfig"
1191    }
1192  ];
1193
1194  // The document that needs human review.
1195  Document document = 2 [deprecated = true];
1196
1197  // Whether the validation should be performed on the ad-hoc review request.
1198  bool enable_schema_validation = 3;
1199
1200  // The priority of the human review task.
1201  Priority priority = 5;
1202
1203  // The document schema of the human review task.
1204  DocumentSchema document_schema = 6;
1205}
1206
1207// Response message for the
1208// [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument]
1209// method.
1210message ReviewDocumentResponse {
1211  // Possible states of the review operation.
1212  enum State {
1213    // The default value. This value is used if the state is omitted.
1214    STATE_UNSPECIFIED = 0;
1215
1216    // The review operation is rejected by the reviewer.
1217    REJECTED = 1;
1218
1219    // The review operation is succeeded.
1220    SUCCEEDED = 2;
1221  }
1222
1223  // The Cloud Storage uri for the human reviewed document if the review is
1224  // succeeded.
1225  string gcs_destination = 1;
1226
1227  // The state of the review operation.
1228  State state = 2;
1229
1230  // The reason why the review is rejected by reviewer.
1231  string rejection_reason = 3;
1232}
1233
1234// The long-running operation metadata for the
1235// [ReviewDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument]
1236// method.
1237message ReviewDocumentOperationMetadata {
1238  // State of the long-running operation.
1239  enum State {
1240    // Unspecified state.
1241    STATE_UNSPECIFIED = 0;
1242
1243    // Operation is still running.
1244    RUNNING = 1;
1245
1246    // Operation is being cancelled.
1247    CANCELLING = 2;
1248
1249    // Operation succeeded.
1250    SUCCEEDED = 3;
1251
1252    // Operation failed.
1253    FAILED = 4;
1254
1255    // Operation is cancelled.
1256    CANCELLED = 5;
1257  }
1258
1259  // Used only when Operation.done is false.
1260  State state = 1;
1261
1262  // A message providing more details about the current state of processing.
1263  // For example, the error message if the operation is failed.
1264  string state_message = 2;
1265
1266  // The creation time of the operation.
1267  google.protobuf.Timestamp create_time = 3;
1268
1269  // The last update time of the operation.
1270  google.protobuf.Timestamp update_time = 4;
1271
1272  // The basic metadata of the long-running operation.
1273  CommonOperationMetadata common_metadata = 5;
1274
1275  // The Crowd Compute question ID.
1276  string question_id = 6;
1277}
1278
1279// Evaluates the given
1280// [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] against
1281// the supplied documents.
1282message EvaluateProcessorVersionRequest {
1283  // Required. The resource name of the
1284  // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to
1285  // evaluate.
1286  // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
1287  string processor_version = 1 [
1288    (google.api.field_behavior) = REQUIRED,
1289    (google.api.resource_reference) = {
1290      type: "documentai.googleapis.com/ProcessorVersion"
1291    }
1292  ];
1293
1294  // Optional. The documents used in the evaluation. If unspecified, use the
1295  // processor's dataset as evaluation input.
1296  BatchDocumentsInputConfig evaluation_documents = 3
1297      [(google.api.field_behavior) = OPTIONAL];
1298}
1299
1300// Metadata of the
1301// [EvaluateProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion]
1302// method.
1303message EvaluateProcessorVersionMetadata {
1304  // The basic metadata of the long-running operation.
1305  CommonOperationMetadata common_metadata = 1;
1306}
1307
1308// Response of the
1309// [EvaluateProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion]
1310// method.
1311message EvaluateProcessorVersionResponse {
1312  // The resource name of the created evaluation.
1313  string evaluation = 2;
1314}
1315
1316// Retrieves a specific Evaluation.
1317message GetEvaluationRequest {
1318  // Required. The resource name of the
1319  // [Evaluation][google.cloud.documentai.v1beta3.Evaluation] to get.
1320  // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
1321  string name = 1 [
1322    (google.api.field_behavior) = REQUIRED,
1323    (google.api.resource_reference) = {
1324      type: "documentai.googleapis.com/Evaluation"
1325    }
1326  ];
1327}
1328
1329// Retrieves a list of evaluations for a given
1330// [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
1331message ListEvaluationsRequest {
1332  // Required. The resource name of the
1333  // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to
1334  // list evaluations for.
1335  // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
1336  string parent = 1 [
1337    (google.api.field_behavior) = REQUIRED,
1338    (google.api.resource_reference) = {
1339      type: "documentai.googleapis.com/ProcessorVersion"
1340    }
1341  ];
1342
1343  // The standard list page size.
1344  // If unspecified, at most `5` evaluations are returned.
1345  // The maximum value is `100`. Values above `100` are coerced to `100`.
1346  int32 page_size = 2;
1347
1348  // A page token, received from a previous `ListEvaluations` call.
1349  // Provide this to retrieve the subsequent page.
1350  string page_token = 3;
1351}
1352
1353// The response from `ListEvaluations`.
1354message ListEvaluationsResponse {
1355  // The evaluations requested.
1356  repeated Evaluation evaluations = 1;
1357
1358  // A token, which can be sent as `page_token` to retrieve the next page.
1359  // If this field is omitted, there are no subsequent pages.
1360  string next_page_token = 2;
1361}
1362
1363// The request message for the
1364// [ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion]
1365// method.
1366//
1367// The Document AI [Service
1368// Agent](https://cloud.google.com/iam/docs/service-agents) of the destination
1369// project must have [Document AI Editor
1370// role](https://cloud.google.com/document-ai/docs/access-control/iam-roles) on
1371// the source project.
1372//
1373// The destination project is specified as part of the
1374// [parent][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.parent]
1375// field. The source project is specified as part of the
1376// [source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.processor_version_source]
1377// or
1378// [external_processor_version_source][google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.external_processor_version_source]
1379// field.
1380message ImportProcessorVersionRequest {
1381  // The external source processor version.
1382  message ExternalProcessorVersionSource {
1383    // Required. The processor version name. Format:
1384    // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
1385    string processor_version = 1 [(google.api.field_behavior) = REQUIRED];
1386
1387    // Optional. The Document AI service endpoint. For example,
1388    // 'https://us-documentai.googleapis.com'
1389    string service_endpoint = 2 [(google.api.field_behavior) = OPTIONAL];
1390  }
1391
1392  oneof source {
1393    // The source processor version to import from. The source processor version
1394    // and destination processor need to be in the same environment and region.
1395    // Note that ProcessorVersions with `model_type` `MODEL_TYPE_LLM` are not
1396    // supported.
1397    string processor_version_source = 2 [(google.api.resource_reference) = {
1398      type: "documentai.googleapis.com/ProcessorVersion"
1399    }];
1400
1401    // The source processor version to import from. It can be from a different
1402    // environment and region than the destination processor.
1403    ExternalProcessorVersionSource external_processor_version_source = 3;
1404  }
1405
1406  // Required. The destination processor name to create the processor version
1407  // in. Format:
1408  // `projects/{project}/locations/{location}/processors/{processor}`
1409  string parent = 1 [
1410    (google.api.field_behavior) = REQUIRED,
1411    (google.api.resource_reference) = {
1412      child_type: "documentai.googleapis.com/ProcessorVersion"
1413    }
1414  ];
1415}
1416
1417// The response message for the
1418// [ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion]
1419// method.
1420message ImportProcessorVersionResponse {
1421  // The destination processor version name.
1422  string processor_version = 1 [(google.api.resource_reference) = {
1423    type: "documentai.googleapis.com/ProcessorVersion"
1424  }];
1425}
1426
1427// The long-running operation metadata for the
1428// [ImportProcessorVersion][google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion]
1429// method.
1430message ImportProcessorVersionMetadata {
1431  // The basic metadata for the long-running operation.
1432  CommonOperationMetadata common_metadata = 1;
1433}
1434