Skip to content
← Back to activity

Immutable solution version

Document AI ProcessOptions that error on the wrong processor type

Version 1Sign in to save

Complete solution

Do not copy ProcessOptions blindly between processor types.

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.

Context: 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.

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 1 · 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>