12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070 |
- // Copyright 2022 Google LLC
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- syntax = "proto3";
- package google.cloud.documentai.v1beta3;
- import "google/api/annotations.proto";
- import "google/api/client.proto";
- import "google/api/field_behavior.proto";
- import "google/api/resource.proto";
- import "google/cloud/documentai/v1beta3/document.proto";
- import "google/cloud/documentai/v1beta3/document_io.proto";
- import "google/cloud/documentai/v1beta3/document_schema.proto";
- import "google/cloud/documentai/v1beta3/evaluation.proto";
- import "google/cloud/documentai/v1beta3/operation_metadata.proto";
- import "google/cloud/documentai/v1beta3/processor.proto";
- import "google/cloud/documentai/v1beta3/processor_type.proto";
- import "google/longrunning/operations.proto";
- import "google/protobuf/field_mask.proto";
- import "google/protobuf/timestamp.proto";
- import "google/rpc/status.proto";
- option csharp_namespace = "Google.Cloud.DocumentAI.V1Beta3";
- option go_package = "google.golang.org/genproto/googleapis/cloud/documentai/v1beta3;documentai";
- option java_multiple_files = true;
- option java_outer_classname = "DocumentAiProcessorService";
- option java_package = "com.google.cloud.documentai.v1beta3";
- option php_namespace = "Google\\Cloud\\DocumentAI\\V1beta3";
- option ruby_package = "Google::Cloud::DocumentAI::V1beta3";
- option (google.api.resource_definition) = {
- type: "documentai.googleapis.com/HumanReviewConfig"
- pattern: "projects/{project}/locations/{location}/processors/{processor}/humanReviewConfig"
- };
- option (google.api.resource_definition) = {
- type: "documentai.googleapis.com/Location"
- pattern: "projects/{project}/locations/{location}"
- };
- // Service to call Cloud DocumentAI to process documents according to the
- // processor's definition. Processors are built using state-of-the-art Google
- // AI such as natural language, computer vision, and translation to extract
- // structured information from unstructured or semi-structured documents.
- service DocumentProcessorService {
- option (google.api.default_host) = "documentai.googleapis.com";
- option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
- // Processes a single document.
- rpc ProcessDocument(ProcessRequest) returns (ProcessResponse) {
- option (google.api.http) = {
- post: "/v1beta3/{name=projects/*/locations/*/processors/*}:process"
- body: "*"
- additional_bindings {
- post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:process"
- body: "*"
- }
- };
- option (google.api.method_signature) = "name";
- }
- // LRO endpoint to batch process many documents. The output is written
- // to Cloud Storage as JSON in the [Document] format.
- rpc BatchProcessDocuments(BatchProcessRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- post: "/v1beta3/{name=projects/*/locations/*/processors/*}:batchProcess"
- body: "*"
- additional_bindings {
- post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:batchProcess"
- body: "*"
- }
- };
- option (google.api.method_signature) = "name";
- option (google.longrunning.operation_info) = {
- response_type: "BatchProcessResponse"
- metadata_type: "BatchProcessMetadata"
- };
- }
- // Fetches processor types. Note that we do not use ListProcessorTypes here
- // because it is not paginated.
- rpc FetchProcessorTypes(FetchProcessorTypesRequest) returns (FetchProcessorTypesResponse) {
- option (google.api.http) = {
- get: "/v1beta3/{parent=projects/*/locations/*}:fetchProcessorTypes"
- };
- option (google.api.method_signature) = "parent";
- }
- // Lists the processor types that exist.
- rpc ListProcessorTypes(ListProcessorTypesRequest) returns (ListProcessorTypesResponse) {
- option (google.api.http) = {
- get: "/v1beta3/{parent=projects/*/locations/*}/processorTypes"
- };
- option (google.api.method_signature) = "parent";
- }
- // Lists all processors which belong to this project.
- rpc ListProcessors(ListProcessorsRequest) returns (ListProcessorsResponse) {
- option (google.api.http) = {
- get: "/v1beta3/{parent=projects/*/locations/*}/processors"
- };
- option (google.api.method_signature) = "parent";
- }
- // Gets a processor detail.
- rpc GetProcessor(GetProcessorRequest) returns (Processor) {
- option (google.api.http) = {
- get: "/v1beta3/{name=projects/*/locations/*/processors/*}"
- };
- option (google.api.method_signature) = "name";
- }
- // Trains a new processor version.
- // Operation metadata is returned as
- // cloud_documentai_core.TrainProcessorVersionMetadata.
- rpc TrainProcessorVersion(TrainProcessorVersionRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- post: "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions:train"
- body: "*"
- };
- option (google.api.method_signature) = "parent,processor_version";
- option (google.longrunning.operation_info) = {
- response_type: "TrainProcessorVersionResponse"
- metadata_type: "TrainProcessorVersionMetadata"
- };
- }
- // Gets a processor version detail.
- rpc GetProcessorVersion(GetProcessorVersionRequest) returns (ProcessorVersion) {
- option (google.api.http) = {
- get: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}"
- };
- option (google.api.method_signature) = "name";
- }
- // Lists all versions of a processor.
- rpc ListProcessorVersions(ListProcessorVersionsRequest) returns (ListProcessorVersionsResponse) {
- option (google.api.http) = {
- get: "/v1beta3/{parent=projects/*/locations/*/processors/*}/processorVersions"
- };
- option (google.api.method_signature) = "parent";
- }
- // Deletes the processor version, all artifacts under the processor version
- // will be deleted.
- rpc DeleteProcessorVersion(DeleteProcessorVersionRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- delete: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}"
- };
- option (google.api.method_signature) = "name";
- option (google.longrunning.operation_info) = {
- response_type: "google.protobuf.Empty"
- metadata_type: "DeleteProcessorVersionMetadata"
- };
- }
- // Deploys the processor version.
- rpc DeployProcessorVersion(DeployProcessorVersionRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:deploy"
- body: "*"
- };
- option (google.api.method_signature) = "name";
- option (google.longrunning.operation_info) = {
- response_type: "DeployProcessorVersionResponse"
- metadata_type: "DeployProcessorVersionMetadata"
- };
- }
- // Undeploys the processor version.
- rpc UndeployProcessorVersion(UndeployProcessorVersionRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- post: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*}:undeploy"
- body: "*"
- };
- option (google.api.method_signature) = "name";
- option (google.longrunning.operation_info) = {
- response_type: "UndeployProcessorVersionResponse"
- metadata_type: "UndeployProcessorVersionMetadata"
- };
- }
- // Creates a processor from the type processor that the user chose.
- // The processor will be at "ENABLED" state by default after its creation.
- rpc CreateProcessor(CreateProcessorRequest) returns (Processor) {
- option (google.api.http) = {
- post: "/v1beta3/{parent=projects/*/locations/*}/processors"
- body: "processor"
- };
- option (google.api.method_signature) = "parent,processor";
- }
- // Deletes the processor, unloads all deployed model artifacts if it was
- // enabled and then deletes all artifacts associated with this processor.
- rpc DeleteProcessor(DeleteProcessorRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- delete: "/v1beta3/{name=projects/*/locations/*/processors/*}"
- };
- option (google.api.method_signature) = "name";
- option (google.longrunning.operation_info) = {
- response_type: "google.protobuf.Empty"
- metadata_type: "DeleteProcessorMetadata"
- };
- }
- // Enables a processor
- rpc EnableProcessor(EnableProcessorRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- post: "/v1beta3/{name=projects/*/locations/*/processors/*}:enable"
- body: "*"
- };
- option (google.longrunning.operation_info) = {
- response_type: "EnableProcessorResponse"
- metadata_type: "EnableProcessorMetadata"
- };
- }
- // Disables a processor
- rpc DisableProcessor(DisableProcessorRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- post: "/v1beta3/{name=projects/*/locations/*/processors/*}:disable"
- body: "*"
- };
- option (google.longrunning.operation_info) = {
- response_type: "DisableProcessorResponse"
- metadata_type: "DisableProcessorMetadata"
- };
- }
- // Set the default (active) version of a [Processor][google.cloud.documentai.v1beta3.Processor] that will be used in
- // [ProcessDocument][google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument] and
- // [BatchProcessDocuments][google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments].
- rpc SetDefaultProcessorVersion(SetDefaultProcessorVersionRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- post: "/v1beta3/{processor=projects/*/locations/*/processors/*}:setDefaultProcessorVersion"
- body: "*"
- };
- option (google.longrunning.operation_info) = {
- response_type: "SetDefaultProcessorVersionResponse"
- metadata_type: "SetDefaultProcessorVersionMetadata"
- };
- }
- // Send a document for Human Review. The input document should be processed by
- // the specified processor.
- rpc ReviewDocument(ReviewDocumentRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- post: "/v1beta3/{human_review_config=projects/*/locations/*/processors/*/humanReviewConfig}:reviewDocument"
- body: "*"
- };
- option (google.api.method_signature) = "human_review_config";
- option (google.longrunning.operation_info) = {
- response_type: "ReviewDocumentResponse"
- metadata_type: "ReviewDocumentOperationMetadata"
- };
- }
- // Evaluates a ProcessorVersion against annotated documents, producing an
- // Evaluation.
- rpc EvaluateProcessorVersion(EvaluateProcessorVersionRequest) returns (google.longrunning.Operation) {
- option (google.api.http) = {
- post: "/v1beta3/{processor_version=projects/*/locations/*/processors/*/processorVersions/*}:evaluateProcessorVersion"
- body: "*"
- };
- option (google.api.method_signature) = "processor_version";
- option (google.longrunning.operation_info) = {
- response_type: "EvaluateProcessorVersionResponse"
- metadata_type: "EvaluateProcessorVersionMetadata"
- };
- }
- // Retrieves a specific evaluation.
- rpc GetEvaluation(GetEvaluationRequest) returns (Evaluation) {
- option (google.api.http) = {
- get: "/v1beta3/{name=projects/*/locations/*/processors/*/processorVersions/*/evaluations/*}"
- };
- option (google.api.method_signature) = "name";
- }
- // Retrieves a set of evaluations for a given processor version.
- rpc ListEvaluations(ListEvaluationsRequest) returns (ListEvaluationsResponse) {
- option (google.api.http) = {
- get: "/v1beta3/{parent=projects/*/locations/*/processors/*/processorVersions/*}/evaluations"
- };
- option (google.api.method_signature) = "parent";
- }
- }
- // Request message for the process document method.
- message ProcessRequest {
- // The document payload.
- oneof source {
- // An inline document proto.
- Document inline_document = 4;
- // A raw document content (bytes).
- RawDocument raw_document = 5;
- }
- // Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] or
- // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion]
- // to use for processing. If a [Processor][google.cloud.documentai.v1beta3.Processor] is specified, the server will use
- // its [default version][google.cloud.documentai.v1beta3.Processor.default_processor_version]. Format:
- // `projects/{project}/locations/{location}/processors/{processor}`, or
- // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "*"
- }
- ];
- // The document payload, the [content] and [mime_type] fields must be set.
- Document document = 2 [deprecated = true];
- // Whether Human Review feature should be skipped for this request. Default to
- // false.
- bool skip_human_review = 3;
- // Specifies which fields to include in ProcessResponse's document.
- // Only supports top level document and pages field so it must be in the form
- // of `{document_field_name}` or `pages.{page_field_name}`.
- google.protobuf.FieldMask field_mask = 6;
- }
- // The status of human review on a processed document.
- message HumanReviewStatus {
- // The final state of human review on a processed document.
- enum State {
- // Human review state is unspecified. Most likely due to an internal error.
- STATE_UNSPECIFIED = 0;
- // Human review is skipped for the document. This can happen because human
- // review is not enabled on the processor or the processing request has
- // been set to skip this document.
- SKIPPED = 1;
- // Human review validation is triggered and passed, so no review is needed.
- VALIDATION_PASSED = 2;
- // Human review validation is triggered and the document is under review.
- IN_PROGRESS = 3;
- // Some error happened during triggering human review, see the
- // [state_message] for details.
- ERROR = 4;
- }
- // The state of human review on the processing request.
- State state = 1;
- // A message providing more details about the human review state.
- string state_message = 2;
- // The name of the operation triggered by the processed document. This field
- // is populated only when the [state] is [HUMAN_REVIEW_IN_PROGRESS]. It has
- // the same response type and metadata as the long running operation returned
- // by [ReviewDocument] method.
- string human_review_operation = 3;
- }
- // Response message for the process document method.
- message ProcessResponse {
- // The document payload, will populate fields based on the processor's
- // behavior.
- Document document = 1;
- // The name of the operation triggered by the processed document. If the human
- // review process is not triggered, this field will be empty. It has the same
- // response type and metadata as the long running operation returned by
- // ReviewDocument method.
- string human_review_operation = 2 [deprecated = true];
- // The status of human review on the processed document.
- HumanReviewStatus human_review_status = 3;
- }
- // Request message for batch process document method.
- message BatchProcessRequest {
- // The message for input config in batch process.
- message BatchInputConfig {
- option deprecated = true;
- // The Cloud Storage location as the source of the document.
- string gcs_source = 1;
- // Mimetype of the input. If the input is a raw document, the supported
- // mimetypes are application/pdf, image/tiff, and image/gif.
- // If the input is a [Document] proto, the type should be application/json.
- string mime_type = 2;
- }
- // The message for output config in batch process.
- message BatchOutputConfig {
- option deprecated = true;
- // The output Cloud Storage directory to put the processed documents.
- string gcs_destination = 1;
- }
- // Required. The resource name of [Processor][google.cloud.documentai.v1beta3.Processor] or
- // [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion].
- // Format: `projects/{project}/locations/{location}/processors/{processor}`,
- // or
- // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "*"
- }
- ];
- // The input config for each single document in the batch process.
- repeated BatchInputConfig input_configs = 2 [deprecated = true];
- // The overall output config for batch process.
- BatchOutputConfig output_config = 3 [deprecated = true];
- // The input documents for batch process.
- BatchDocumentsInputConfig input_documents = 5;
- // The overall output config for batch process.
- DocumentOutputConfig document_output_config = 6;
- // Whether Human Review feature should be skipped for this request. Default to
- // false.
- bool skip_human_review = 4;
- }
- // Response message for batch process document method.
- message BatchProcessResponse {
- }
- // The long running operation metadata for batch process method.
- message BatchProcessMetadata {
- // The status of a each individual document in the batch process.
- message IndividualProcessStatus {
- // The source of the document, same as the [input_gcs_source] field in the
- // request when the batch process started. The batch process is started by
- // take snapshot of that document, since a user can move or change that
- // document during the process.
- string input_gcs_source = 1;
- // The status processing the document.
- google.rpc.Status status = 2;
- // The output_gcs_destination (in the request as `output_gcs_destination`)
- // of the processed document if it was successful, otherwise empty.
- string output_gcs_destination = 3;
- // The name of the operation triggered by the processed document. If the
- // human review process is not triggered, this field will be empty. It has
- // the same response type and metadata as the long running operation
- // returned by ReviewDocument method.
- string human_review_operation = 4 [deprecated = true];
- // The status of human review on the processed document.
- HumanReviewStatus human_review_status = 5;
- }
- // Possible states of the batch processing operation.
- enum State {
- // The default value. This value is used if the state is omitted.
- STATE_UNSPECIFIED = 0;
- // Request operation is waiting for scheduling.
- WAITING = 1;
- // Request is being processed.
- RUNNING = 2;
- // The batch processing completed successfully.
- SUCCEEDED = 3;
- // The batch processing was being cancelled.
- CANCELLING = 4;
- // The batch processing was cancelled.
- CANCELLED = 5;
- // The batch processing has failed.
- FAILED = 6;
- }
- // The state of the current batch processing.
- State state = 1;
- // A message providing more details about the current state of processing.
- // For example, the error message if the operation is failed.
- string state_message = 2;
- // The creation time of the operation.
- google.protobuf.Timestamp create_time = 3;
- // The last update time of the operation.
- google.protobuf.Timestamp update_time = 4;
- // The list of response details of each document.
- repeated IndividualProcessStatus individual_process_statuses = 5;
- }
- // Request message for fetch processor types.
- message FetchProcessorTypesRequest {
- // Required. The project of processor type to list.
- // The available processor types may depend on the allow-listing on projects.
- // Format: `projects/{project}/locations/{location}`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "documentai.googleapis.com/ProcessorType"
- }
- ];
- }
- // Response message for fetch processor types.
- message FetchProcessorTypesResponse {
- // The list of processor types.
- repeated ProcessorType processor_types = 1;
- }
- // Request message for list processor types.
- message ListProcessorTypesRequest {
- // Required. The location of processor type to list.
- // The available processor types may depend on the allow-listing on projects.
- // Format: `projects/{project}/locations/{location}`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "documentai.googleapis.com/ProcessorType"
- }
- ];
- // The maximum number of processor types to return.
- // If unspecified, at most 100 processor types will be returned.
- // The maximum value is 500; values above 500 will be coerced to 500.
- int32 page_size = 2;
- // Used to retrieve the next page of results, empty if at the end of the list.
- string page_token = 3;
- }
- // Response message for list processor types.
- message ListProcessorTypesResponse {
- // The processor types.
- repeated ProcessorType processor_types = 1;
- // Points to the next page, otherwise empty.
- string next_page_token = 2;
- }
- // Request message for list all processors belongs to a project.
- message ListProcessorsRequest {
- // Required. The parent (project and location) which owns this collection of Processors.
- // Format: `projects/{project}/locations/{location}`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "documentai.googleapis.com/Processor"
- }
- ];
- // The maximum number of processors to return.
- // If unspecified, at most 50 processors will be returned.
- // The maximum value is 100; values above 100 will be coerced to 100.
- int32 page_size = 2;
- // We will return the processors sorted by creation time. The page token
- // will point to the next processor.
- string page_token = 3;
- }
- // Response message for list processors.
- message ListProcessorsResponse {
- // The list of processors.
- repeated Processor processors = 1;
- // Points to the next processor, otherwise empty.
- string next_page_token = 2;
- }
- // Request message for get processor.
- message GetProcessorRequest {
- // Required. The processor resource name.
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/Processor"
- }
- ];
- }
- // Request message for get processor version.
- message GetProcessorVersionRequest {
- // Required. The processor resource name.
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/ProcessorVersion"
- }
- ];
- }
- // Request message for list all processor versions belongs to a processor.
- message ListProcessorVersionsRequest {
- // Required. The parent (project, location and processor) to list all versions.
- // Format: `projects/{project}/locations/{location}/processors/{processor}`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "documentai.googleapis.com/ProcessorVersion"
- }
- ];
- // The maximum number of processor versions to return.
- // If unspecified, at most 10 processor versions will be returned.
- // The maximum value is 20; values above 20 will be coerced to 20.
- int32 page_size = 2;
- // We will return the processor versions sorted by creation time. The page
- // token will point to the next processor version.
- string page_token = 3;
- }
- // Response message for list processors.
- message ListProcessorVersionsResponse {
- // The list of processors.
- repeated ProcessorVersion processor_versions = 1;
- // Points to the next processor, otherwise empty.
- string next_page_token = 2;
- }
- // Request message for the delete processor version method.
- message DeleteProcessorVersionRequest {
- // Required. The processor version resource name to be deleted.
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/ProcessorVersion"
- }
- ];
- }
- // The long running operation metadata for delete processor version method.
- message DeleteProcessorVersionMetadata {
- // The basic metadata of the long running operation.
- CommonOperationMetadata common_metadata = 1;
- }
- // Request message for the deploy processor version method.
- message DeployProcessorVersionRequest {
- // Required. The processor version resource name to be deployed.
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/ProcessorVersion"
- }
- ];
- }
- // Response message for the deploy processor version method.
- message DeployProcessorVersionResponse {
- }
- // The long running operation metadata for deploy processor version method.
- message DeployProcessorVersionMetadata {
- // The basic metadata of the long running operation.
- CommonOperationMetadata common_metadata = 1;
- }
- // Request message for the undeploy processor version method.
- message UndeployProcessorVersionRequest {
- // Required. The processor version resource name to be undeployed.
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/ProcessorVersion"
- }
- ];
- }
- // Response message for the undeploy processor version method.
- message UndeployProcessorVersionResponse {
- }
- // The long running operation metadata for the undeploy processor version
- // method.
- message UndeployProcessorVersionMetadata {
- // The basic metadata of the long running operation.
- CommonOperationMetadata common_metadata = 1;
- }
- // Request message for create a processor. Notice this request is sent to
- // a regionalized backend service, and if the processor type is not available
- // on that region, the creation will fail.
- message CreateProcessorRequest {
- // Required. The parent (project and location) under which to create the processor.
- // Format: `projects/{project}/locations/{location}`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "documentai.googleapis.com/Processor"
- }
- ];
- // Required. The processor to be created, requires [processor_type] and [display_name]
- // to be set. Also, the processor is under CMEK if CMEK fields are set.
- Processor processor = 2 [(google.api.field_behavior) = REQUIRED];
- }
- // Request message for the delete processor method.
- message DeleteProcessorRequest {
- // Required. The processor resource name to be deleted.
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/Processor"
- }
- ];
- }
- // The long running operation metadata for delete processor method.
- message DeleteProcessorMetadata {
- // The basic metadata of the long running operation.
- CommonOperationMetadata common_metadata = 5;
- }
- // Request message for the enable processor method.
- message EnableProcessorRequest {
- // Required. The processor resource name to be enabled.
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/Processor"
- }
- ];
- }
- // Response message for the enable processor method.
- // Intentionally empty proto for adding fields in future.
- message EnableProcessorResponse {
- }
- // The long running operation metadata for enable processor method.
- message EnableProcessorMetadata {
- // The basic metadata of the long running operation.
- CommonOperationMetadata common_metadata = 5;
- }
- // Request message for the disable processor method.
- message DisableProcessorRequest {
- // Required. The processor resource name to be disabled.
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/Processor"
- }
- ];
- }
- // Response message for the disable processor method.
- // Intentionally empty proto for adding fields in future.
- message DisableProcessorResponse {
- }
- // The long running operation metadata for disable processor method.
- message DisableProcessorMetadata {
- // The basic metadata of the long running operation.
- CommonOperationMetadata common_metadata = 5;
- }
- // Request message for the set default processor version method.
- message SetDefaultProcessorVersionRequest {
- // Required. The resource name of the [Processor][google.cloud.documentai.v1beta3.Processor] to change default version.
- string processor = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/Processor"
- }
- ];
- // Required. The resource name of child [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to use as default.
- // Format:
- // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
- string default_processor_version = 2 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/ProcessorVersion"
- }
- ];
- }
- // Response message for set default processor version method.
- message SetDefaultProcessorVersionResponse {
- }
- // The long running operation metadata for set default processor version
- // method.
- message SetDefaultProcessorVersionMetadata {
- // The basic metadata of the long running operation.
- CommonOperationMetadata common_metadata = 1;
- }
- // Request message for the create processor version method.
- message TrainProcessorVersionRequest {
- // The input data used to train a new `ProcessorVersion`.
- message InputData {
- // The documents used for training the new version.
- BatchDocumentsInputConfig training_documents = 3;
- // The documents used for testing the trained version.
- BatchDocumentsInputConfig test_documents = 4;
- }
- // Required. The parent (project, location and processor) to create the new version for.
- // Format: `projects/{project}/locations/{location}/processors/{processor}`.
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- child_type: "documentai.googleapis.com/ProcessorVersion"
- }
- ];
- // Required. The processor version to be created.
- ProcessorVersion processor_version = 2 [(google.api.field_behavior) = REQUIRED];
- // Optional. The schema the processor version will be trained with.
- DocumentSchema document_schema = 10 [(google.api.field_behavior) = OPTIONAL];
- // Optional. The input data used to train the `ProcessorVersion`.
- InputData input_data = 4 [(google.api.field_behavior) = OPTIONAL];
- // Optional. The processor version to use as a base for training. This processor version
- // must be a child of `parent`. Format:
- // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
- string base_processor_version = 8 [(google.api.field_behavior) = OPTIONAL];
- }
- // The response for the TrainProcessorVersion method.
- message TrainProcessorVersionResponse {
- // The resource name of the processor version produced by training.
- string processor_version = 1;
- }
- // The metadata that represents a processor version being created.
- message TrainProcessorVersionMetadata {
- // The dataset validation information.
- // This includes any and all errors with documents and the dataset.
- message DatasetValidation {
- // The total number of document errors.
- int32 document_error_count = 3;
- // The total number of dataset errors.
- int32 dataset_error_count = 4;
- // Error information pertaining to specific documents. A maximum of 10
- // document errors will be returned.
- // Any document with errors will not be used throughout training.
- repeated google.rpc.Status document_errors = 1;
- // Error information for the dataset as a whole. A maximum of 10 dataset
- // errors will be returned.
- // A single dataset error is terminal for training.
- repeated google.rpc.Status dataset_errors = 2;
- }
- // The basic metadata of the long running operation.
- CommonOperationMetadata common_metadata = 1;
- // The training dataset validation information.
- DatasetValidation training_dataset_validation = 2;
- // The test dataset validation information.
- DatasetValidation test_dataset_validation = 3;
- }
- // Request message for review document method.
- message ReviewDocumentRequest {
- // The priority level of the human review task.
- enum Priority {
- // The default priority level.
- DEFAULT = 0;
- // The urgent priority level. The labeling manager should allocate labeler
- // resource to the urgent task queue to respect this priority level.
- URGENT = 1;
- }
- // The document payload.
- oneof source {
- // An inline document proto.
- Document inline_document = 4;
- }
- // Required. The resource name of the HumanReviewConfig that the document will be
- // reviewed with.
- string human_review_config = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/HumanReviewConfig"
- }
- ];
- // The document that needs human review.
- Document document = 2 [deprecated = true];
- // Whether the validation should be performed on the ad-hoc review request.
- bool enable_schema_validation = 3;
- // The priority of the human review task.
- Priority priority = 5;
- // The document schema of the human review task.
- DocumentSchema document_schema = 6;
- }
- // Response message for review document method.
- message ReviewDocumentResponse {
- // Possible states of the review operation.
- enum State {
- // The default value. This value is used if the state is omitted.
- STATE_UNSPECIFIED = 0;
- // The review operation is rejected by the reviewer.
- REJECTED = 1;
- // The review operation is succeeded.
- SUCCEEDED = 2;
- }
- // The Cloud Storage uri for the human reviewed document if the review is
- // succeeded.
- string gcs_destination = 1;
- // The state of the review operation.
- State state = 2;
- // The reason why the review is rejected by reviewer.
- string rejection_reason = 3;
- }
- // The long running operation metadata for review document method.
- message ReviewDocumentOperationMetadata {
- // State of the longrunning operation.
- enum State {
- // Unspecified state.
- STATE_UNSPECIFIED = 0;
- // Operation is still running.
- RUNNING = 1;
- // Operation is being cancelled.
- CANCELLING = 2;
- // Operation succeeded.
- SUCCEEDED = 3;
- // Operation failed.
- FAILED = 4;
- // Operation is cancelled.
- CANCELLED = 5;
- }
- // Used only when Operation.done is false.
- State state = 1;
- // A message providing more details about the current state of processing.
- // For example, the error message if the operation is failed.
- string state_message = 2;
- // The creation time of the operation.
- google.protobuf.Timestamp create_time = 3;
- // The last update time of the operation.
- google.protobuf.Timestamp update_time = 4;
- // The basic metadata of the long running operation.
- CommonOperationMetadata common_metadata = 5;
- // The Crowd Compute question ID.
- string question_id = 6;
- }
- // Evaluates the given ProcessorVersion against the supplied documents.
- message EvaluateProcessorVersionRequest {
- // Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to evaluate.
- // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
- string processor_version = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/ProcessorVersion"
- }
- ];
- // Optional. The documents used in the evaluation. If unspecified, use the processor's
- // dataset as evaluation input.
- BatchDocumentsInputConfig evaluation_documents = 3 [(google.api.field_behavior) = OPTIONAL];
- }
- // Metadata of the EvaluateProcessorVersion method.
- message EvaluateProcessorVersionMetadata {
- // The basic metadata of the long running operation.
- CommonOperationMetadata common_metadata = 1;
- }
- // Metadata of the EvaluateProcessorVersion method.
- message EvaluateProcessorVersionResponse {
- // The resource name of the created evaluation.
- string evaluation = 2;
- }
- // Retrieves a specific Evaluation.
- message GetEvaluationRequest {
- // Required. The resource name of the [Evaluation][google.cloud.documentai.v1beta3.Evaluation] to get.
- // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
- string name = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/Evaluation"
- }
- ];
- }
- // Retrieves a list of evaluations for a given ProcessorVersion.
- message ListEvaluationsRequest {
- // Required. The resource name of the [ProcessorVersion][google.cloud.documentai.v1beta3.ProcessorVersion] to list evaluations for.
- // `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
- string parent = 1 [
- (google.api.field_behavior) = REQUIRED,
- (google.api.resource_reference) = {
- type: "documentai.googleapis.com/ProcessorVersion"
- }
- ];
- // The standard list page size.
- // If unspecified, at most 5 evaluations will be returned.
- // The maximum value is 100; values above 100 will be coerced to 100.
- int32 page_size = 2;
- // A page token, received from a previous `ListEvaluations` call.
- // Provide this to retrieve the subsequent page.
- string page_token = 3;
- }
- // The response from ListEvaluations.
- message ListEvaluationsResponse {
- // The evaluations requested.
- repeated Evaluation evaluations = 1;
- // A token, which can be sent as `page_token` to retrieve the next page.
- // If this field is omitted, there are no subsequent pages.
- string next_page_token = 2;
- }
|