## Resource: ProcessorVersion

A processor version is an implementation of a processor. Each processor can have multiple versions, pretrained by Google internally or uptrained by the customer. A processor can only have one default version at a time. Its document-processing behavior is defined by that version.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "documentSchema": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/DocumentSchema`) }, "state": enum (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#State`), "createTime": string, "latestEvaluation": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#EvaluationReference`) }, "kmsKeyName": string, "kmsKeyVersionName": string, "googleManaged": boolean, "deprecationInfo": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#DeprecationInfo`) }, "modelType": enum (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#ModelType`), "satisfiesPzs": boolean, "satisfiesPzi": boolean, "genAiModelInfo": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#GenAiModelInfo`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The resource name of the processor version. Format: `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` |
| `displayName` | `string` The display name of the processor version. |
| `documentSchema` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/DocumentSchema`)`` Output only. The schema of the processor version. Describes the output. |
| `state` | ``enum (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#State`)`` Output only. The state of the processor version. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time the processor version was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `latestEvaluation` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#EvaluationReference`)`` Output only. The most recently invoked evaluation for the processor version. |
| `kmsKeyName` | `string` Output only. The KMS key name used for encryption. |
| `kmsKeyVersionName` | `string` Output only. The KMS key version with which data is encrypted. |
| `googleManaged` | `boolean` Output only. Denotes that this `ProcessorVersion` is managed by Google. |
| `deprecationInfo` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#DeprecationInfo`)`` Output only. If set, information about the eventual deprecation of this version. |
| `modelType` | ``enum (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#ModelType`)`` Output only. The model type of this processor version. |
| `satisfiesPzs` | `boolean` Output only. Reserved for future use. |
| `satisfiesPzi` | `boolean` Output only. Reserved for future use. |
| `genAiModelInfo` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#GenAiModelInfo`)`` Output only. Information about Generative AI model-based processor versions. |

## State

The possible states of the processor version.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | The processor version is in an unspecified state. |
| `DEPLOYED` | The processor version is deployed and can be used for processing. |
| `DEPLOYING` | The processor version is being deployed. |
| `UNDEPLOYED` | The processor version is not deployed and cannot be used for processing. |
| `UNDEPLOYING` | The processor version is being undeployed. |
| `CREATING` | The processor version is being created. |
| `DELETING` | The processor version is being deleted. |
| `FAILED` | The processor version failed and is in an indeterminate state. |
| `IMPORTING` | The processor version is being imported. |

## EvaluationReference

Gives a short summary of an evaluation, and links to the evaluation itself.

| JSON representation |
|---|
| ``` { "operation": string, "evaluation": string, "aggregateMetrics": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/Shared.Types/ConfidenceLevelMetrics#Metrics`) }, "aggregateMetricsExact": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/Shared.Types/ConfidenceLevelMetrics#Metrics`) } } ``` |

| Fields ||
|---|---|
| `operation` | `string` The resource name of the Long Running Operation for the evaluation. |
| `evaluation` | `string` The resource name of the evaluation. |
| `aggregateMetrics` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/Shared.Types/ConfidenceLevelMetrics#Metrics`)`` An aggregate of the statistics for the evaluation with fuzzy matching on. |
| `aggregateMetricsExact` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/Shared.Types/ConfidenceLevelMetrics#Metrics`)`` An aggregate of the statistics for the evaluation with fuzzy matching off. |

## DeprecationInfo

Information about the upcoming deprecation of this processor version.

| JSON representation |
|---|
| ``` { "deprecationTime": string, "replacementProcessorVersion": string } ``` |

| Fields ||
|---|---|
| `deprecationTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The time at which this processor version will be deprecated. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `replacementProcessorVersion` | `string` If set, the processor version that will be used as a replacement. |

## ModelType

The possible model types of the processor version.

| Enums ||
|---|---|
| `MODEL_TYPE_UNSPECIFIED` | The processor version has unspecified model type. |
| `MODEL_TYPE_GENERATIVE` | The processor version has generative model type. |
| `MODEL_TYPE_CUSTOM` | The processor version has custom model type. |

## GenAiModelInfo

Information about Generative AI model-based processor versions.

| JSON representation |
|---|
| ``` { // Union field `model_info` can be only one of the following: "foundationGenAiModelInfo": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#FoundationGenAiModelInfo`) }, "customGenAiModelInfo": { object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#CustomGenAiModelInfo`) } // End of list of possible types for union field `model_info`. } ``` |

| Fields ||
|---|---|
| Union field `model_info`. The processor version is either a pretrained Google-managed foundation model or a custom Generative AI model created by the user. `model_info` can be only one of the following: ||
| `foundationGenAiModelInfo` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#FoundationGenAiModelInfo`)`` Information for a pretrained Google-managed foundation model. |
| `customGenAiModelInfo` | ``object (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#CustomGenAiModelInfo`)`` Information for a custom Generative AI model created by the user. |

## FoundationGenAiModelInfo

Information for a pretrained Google-managed foundation model.

| JSON representation |
|---|
| ``` { "finetuningAllowed": boolean, "minTrainLabeledDocuments": integer } ``` |

| Fields ||
|---|---|
| `finetuningAllowed` | `boolean` Whether fine tuning is allowed for this base processor version. |
| `minTrainLabeledDocuments` | `integer` The minimum number of labeled documents in the training dataset required for fine tuning. |

## CustomGenAiModelInfo

Information for a custom Generative AI model created by the user. These are created with `Create New Version` in either the `Call foundation
model` or `Fine tuning` tabs.

| JSON representation |
|---|
| ``` { "customModelType": enum (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#CustomModelType`), "baseProcessorVersionId": string } ``` |

| Fields ||
|---|---|
| `customModelType` | ``enum (`https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions#CustomModelType`)`` The type of custom model created by the user. |
| `baseProcessorVersionId` | `string` The base processor version ID for the custom model. |

## CustomModelType

The type of custom model created by the user.

| Enums ||
|---|---|
| `CUSTOM_MODEL_TYPE_UNSPECIFIED` | The model type is unspecified. |
| `VERSIONED_FOUNDATION` | The model is a versioned foundation model. |
| `FINE_TUNED` | The model is a finetuned foundation model. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions/batchProcess` | LRO endpoint to batch process many documents. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions/delete` | Deletes the processor version, all artifacts under the processor version will be deleted. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions/deploy` | Deploys the processor version. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions/evaluateProcessorVersion` | Evaluates a ProcessorVersion against annotated documents, producing an Evaluation. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions/get` | Gets a processor version detail. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions/list` | Lists all versions of a processor. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions/process` | Processes a single document. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions/train` | Trains a new processor version. |
| ### `https://docs.cloud.google.com/document-ai/docs/reference/rest/v1/projects.locations.processors.processorVersions/undeploy` | Undeploys the processor version. |