Skip to content

feat(api): sync UniParser to v1.3 client APIs - #23

Merged
TimothyZero merged 21 commits into
mainfrom
feat/uniparser/update_v1.3
Aug 3, 2026
Merged

TimothyZero merged 21 commits into
mainfrom
feat/uniparser/update_v1.3

Conversation

@uni-parser

Copy link
Copy Markdown
Collaborator

Summary

Sync the customer-facing UniParser-Tools client with the supported APIs in UniParser release/v1.3.

The implementation was validated against upstream commit e6f9694.

Changes

Shared HTTP transport

  • Add a shared authenticated HTTP transport and connection reuse.
  • Add configurable timeouts for normal requests, synchronous parsing, and TOS uploads.
  • Keep the server-side parsing budget independent from client HTTP timeouts.
  • Normalize HTTP and JSON error responses.
  • Redact query credentials from presigned URL diagnostics.

Parse submission APIs

Update trigger_file(), trigger_snip(), and trigger_url() with release/v1.3 options, including:

  • server-generated tokens;
  • model version selection;
  • callbacks;
  • preset layouts;
  • in-place updates;
  • image padding where supported;
  • per-request HTTP timeouts.

Add TOS upload helpers:

  • request_tos_upload_links()
  • upload_files_to_tos()

Presigned TOS uploads do not carry the UniParser API key, and upload credentials are removed from high-level results.

Result APIs and data models

Update:

  • get_result()
  • get_formatted()
  • get_third_party_output()

Add the corresponding release/v1.3 result fields and recursive conversion support while preserving positional-constructor compatibility.

Service information APIs

Expose:

  • health()
  • version()
  • get_constants()

These allow clients to inspect available model versions, service capabilities, and current constants.

Read-only account APIs

Add UniParserAccountClient, also available through parser.account, with:

  • current-user information;
  • balance information;
  • usage summaries;
  • paginated usage records;
  • paginated balance transactions.

Documentation and packaging

  • Update README and the UniParser Tools Skill references.
  • Correct callback verification examples for the release/v1.3 raw-body HMAC contract.
  • Clear notebook outputs and redact task-token-shaped values.
  • Remove hardcoded API-key examples from notebooks.
  • Restrict wheel contents to uniparser_tools.
  • Declare Python >=3.11, matching the pinned dependencies.
  • Install test extras consistently in CI.

@uni-parser
uni-parser requested review from LeoMY1 and TimothyZero July 30, 2026 10:10

@LeoMY1 LeoMY1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improvement suggestions

All comments below are non-blocking and may be addressed in this or a follow-up PR:

  1. Consider checking the HTTP status code for TOS uploads so non-standard JSON error responses cannot be misclassified as successful.
  2. Add consistent fallback behavior for Markdown and LaTeX formatting of empty or malformed tables.
  3. Preserve server-provided metadata such as method during recursive GroupedResult conversion.
  4. Extend unknown-field filtering to nested models such as Reaction and ReactionComponent.
  5. Clarify the compatibility behavior of token="": normalize it to None or document the stricter validation.
  6. As follow-up maintenance, align Ruff’s Python target, add Python 3.12 CI coverage, and pin Ruff for reproducible checks.

Verdict

Approve

The implementation is sound, the primary feature set is complete, and the current test coverage provides sufficient confidence for merge. The remaining comments concern edge cases, forward compatibility, and defensive error handling; they do not affect the main v1.3 client workflow and should not block this PR.

I recommend merging the PR and tracking these suggestions as follow-up improvements.

@TimothyZero
TimothyZero merged commit fd1eaae into main Aug 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants