 
|
74bdc41608
|
feat: add multi-language API SDK (Python/Go/TypeScript) (#18049)
* feat: add multi-language API SDK for PaddleOCR async API
Add Python/Go/TypeScript SDKs that wrap the PaddleOCR async job API
(submit → poll → fetch result) into simple blocking interfaces.
Python SDK:
- Integrated into paddleocr/_api_client/ as internal subpackage
- APIClient (sync) + AsyncAPIClient (asyncio) dual interfaces
- CLI subcommand: paddleocr api --model_type ocr/doc_parsing
- Supports PP-OCRv5, PP-StructureV3, PaddleOCR-VL, PaddleOCR-VL-1.5
Go SDK (api_sdk/go/):
- Zero dependencies (stdlib only)
- Functional options pattern + context.Context cancellation
- Operation object with Wait(ctx)/Poll(ctx) methods
TypeScript SDK (api_sdk/typescript/):
- Zero dependencies (native fetch, Node>=18)
- AbortSignal cancellation support
- ESM + CJS dual output
All SDKs share:
- Exponential backoff polling (3s initial, 1.5x, 15s max, configurable timeout)
- Typed error hierarchy (Auth/API/JobFailed/Timeout/Network/FileNotFound)
- URL and local file upload support
- Convenience methods + manual control (submit/wait/poll) interfaces
* fix: address PR review feedback
- Rename PaddleOCRError to PaddleOCRAPIError across all three SDKs
- Replace custom FileNotFoundError with Python builtin in Python SDK
- Expand OCROptions/DocParsingOptions with all API parameters (Python/Go/TS)
- CLI: use Model enum values instead of hardcoded strings
- CLI: allow --model for both ocr and doc_parsing tasks
- Update license header year to 2026
- Simplify TypeScript defaultPayload to empty object
* fix: harden multi-language API SDK
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(sdk): jsonl fetch without auth, poll timeout, abort parity
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: harden PaddleOCR official API SDK
Align Python, TypeScript, and Go SDKs around typed jobs, model-aware document parsing, request/poll timeouts, strict errors, resource saving, and integrated release docs for the PaddleOCR official API.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: complete API SDK remediation and default doc parsing to PaddleOCR-VL-1.5
Consolidate SDK hardening, docs, tests, and cross-language default model behavior for document parsing.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix bugs
* Fix bugs and optimize sdks
* Fix bugs
* Fix bugs
* Update skills
* Fix bugs
* Update docs
* Fix docs
* Fix doc
* Fix
---------
Co-authored-by: Bobholamovic <bob1998425@hotmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
2026-05-28 18:24:22 +08:00 |
|