Overview

Convert provider OCR responses into openparser@1 graphs and call cloud OCR providers.

@openparser/adapters converts provider OCR responses into openparser@1 document graphs and ships production HTTP/SDK clients for cloud OCR providers.

Inputs use provider-native model ids and options. Converters preserve hierarchy, text spans, coordinate spaces, styles, structured tables, returned image assets, and confidence at the closest granularity supplied by the provider. Original scores and scales remain available for lineage and review.

Configuration

This package never reads environment variables or discovers credentials on its own. Pass API keys, endpoints, regions, and auth objects into each client factory. Google and AWS clients may fall back to Application Default Credentials or the AWS default credential chain when you omit explicit auth.

Install

npm install @openparser/adapters

Runtime deps for cloud clients ship as package dependencies (google-auth-library, @aws-sdk/client-textract, pdf-lib, zod).

Subpath imports

Prefer subpath imports so bundlers only pull the provider you need:

ProviderImport pathAdapter + client
Paddle HPS@openparser/adapters/paddlemapLayoutResultsToParsedDocument
Mistral OCR@openparser/adapters/mistralmapMistralOcrResponseToParsedDocument, createHttpMistralOcrClient
Azure Document Intelligence@openparser/adapters/azure-document-intelligencemapAzureDocumentIntelligenceToParsedDocument, createHttpAzureDiClient
Google Document AI@openparser/adapters/google-document-aimapGoogleDocumentAiToParsedDocument, createGoogleDocumentAiClient
AWS Textract@openparser/adapters/aws-textractmapAwsTextractToParsedDocument, createAwsTextractClient

The root entry @openparser/adapters re-exports all adapters and clients, plus package provenance helpers.

Converter provenance

import {
  OPENPARSER_ADAPTERS_VERSION,
  openparserAdapterConverterVersion,
} from '@openparser/adapters';

openparserAdapterConverterVersion('mistral');
// → `@openparser/adapters@<semver>#mistral`

Provider-native options and output types

Each adapter exports strict Zod option schemas (with model/operation compatibility where it is a provider fact), request translators, and conservative output capability constants / ParsedDocumentWithElementKinds aliases. These describe possible converter element kinds — not guaranteed fields.

Provider guides

File-byte clients (mistral, azure, google) take bytes: Uint8Array. AWS remains S3-sourced. Each cloud parse returns { canonical: ParsedDocument, nativeResult: Record<string, unknown> }.

On this page