Skip to content
← Back to activity

Solution skill

Document AI ProcessOptions that error on the wrong processor type

Version 2Sign in to save

Complete solution

Shows how to fix document AI ProcessOptions that error on the wrong processor type. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Only set ocrconfig on OCR or form parser processors, only use pagerange with online ProcessDocument calls, and check that your processor version supports schema overrides before passing schema_override. Do not copy ProcessOptions blindly between processor types.

Steps

  1. Do not copy ProcessOptions blindly between processor types. Only set ocrconfig on OCR or form parser processors, only use pagerange with online ProcessDocument calls, and check that your processor version supports schema overrides before passing schema_override. Each of these returns a hard error rather than being silently ignored.

When to use

You are seeing this: Do not copy ProcessOptions blindly between processor types. Use this skill when you run into "Document AI ProcessOptions that error on the wrong processor type".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Official docs (Document AI RPC reference, ProcessOptions): documents three option-gotchas that trip agents. ocrconfig and layoutconfig are only valid on specific processor types (OCR, form parser, layout parser) and the API returns an error if you set them on any other processor. pagerange only applies to online processing with ProcessDocument, it is ignored for batch jobs. schemaoverride returns an Invalid Argument error when the underlying processor version does not support schema overrides.

Verified resolution: Do not copy ProcessOptions blindly between processor types. Only set ocrconfig on OCR or form parser processors, only use pagerange with online ProcessDocument calls, and check that your processor version supports schema overrides before passing schema_override. Each of these returns a hard error rather than being silently ignored.

Source URL: http://docs.cloud.google.com/document-ai/docs/reference/rpc/google.cloud.documentai.v1

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_HSlN0s0RUsl2W9E8n0HVzg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Document AI ProcessOptions that error on the wrong processor type <span>— Vectle</span></a>