feat(v2): align client.v2 with updated ADE spec (service_tier, billing)#106
Merged
Conversation
Applies the three semantic changes from the updated V2 (AIDE Gateway)
OpenAPI spec to the unreleased client.v2 surface:
- Rename the async job-create field `priority` -> `service_tier` on
`parse_jobs.create` and `extract_jobs.create` (same enum
standard/priority). Hard rename: client.v2 shipped after the v1.12.0
tag, so `priority` was never released.
- Add `billing` ({service_tier, total_credits}) to the extract response
metadata via a new `V2ExtractBilling` model, mirroring the existing
`V2ParseBilling`.
- Document the `206`/`404` responses on `GET /v2/parse/jobs/{job_id}`.
No code change: the base client already treats 206 as success and
raises `NotFoundError` on 404; added regression tests to lock this.
Docs (api.md, examples, v2-testing) updated for the rename.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the (unreleased) client.v2 SDK surface with updated V2 ADE gateway OpenAPI semantics by renaming the async job-create “priority” field to service_tier, modeling extract response billing metadata, and adding regression tests for parse job GET status handling.
Changes:
- Renamed async job-create parameter/body key from
priority→service_tierfor V2 parse and extract jobs. - Added
V2ExtractBillingand exposed it viaV2ExtractMetadata.billing(and exported it fromlandingai_ade.types.v2). - Added regression tests for parse job GET handling of HTTP
206(success) and404(NotFoundError), plus wire-body assertions forservice_tier.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/api_resources/v2/test_parse.py |
Updates tests for service_tier rename and adds regression coverage for 206/404 on parse job GET. |
tests/api_resources/v2/test_extract.py |
Updates extract job create test for service_tier and adds coverage for parsing new extract metadata.billing. |
src/landingai_ade/types/v2/extract_response.py |
Introduces V2ExtractBilling and adds billing to V2ExtractMetadata. |
src/landingai_ade/types/v2/__init__.py |
Re-exports V2ExtractBilling from the public types.v2 package. |
src/landingai_ade/resources/v2/parse.py |
Renames parse job-create parameter/body field to service_tier. |
src/landingai_ade/resources/v2/extract.py |
Renames extract job-create parameter/body field to service_tier. |
examples/v2_parse.py |
Updates example usage to service_tier. |
api.md |
Updates API docs for service_tier rename and documents extract billing type nesting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This was referenced Jul 9, 2026
yzld2002
added a commit
that referenced
this pull request
Jul 13, 2026
…111) A tech-writer review against aide surfaced SDK parameters that were dropped from the API: - Remove `markdown_ref` from `client.v2.extract` / `extract_jobs.create` (dropped in aide#951); extract now requires exactly one of `markdown` or `markdown_url`. Delete the README section documenting it. - Remove `idempotency_key` from the same methods (dropped in aide#944). - Fix the README jobs example to use `service_tier="priority"` — the code was already renamed from `priority` (aide#899) in #106, but the example still passed a nonexistent kwarg that raised TypeError. - Reword `files.upload` docstrings/api.md to stop referencing the removed `markdown_ref` (`/v1/files` itself is still in the spec). `password` on v2 parse is intentionally kept: it remains in the tracked spec (specs/v2-aide.json) as a placeholder until PDF decryption ships (aide#272, aide#390). No released-surface break: client.v2 shipped after v1.12.0 (griffe surface-lock clean). Full suite: 587 passed; ruff/mypy clean. Co-authored-by: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the (unreleased)
client.v2surface with the updated V2 AIDE Gateway OpenAPI spec. Three semantic differences were identified between the staging spec saved in #96 and the current dev spec; this PR applies all three.Changes
1.
priority→service_tier(breaking rename, but safe)The async job-create field is renamed on
parse_jobs.createandextract_jobs.create(same enumstandard/priority). Done as a hard rename with no deprecation alias:client.v2was added in #105 after thev1.12.0tag, soprioritywas never in a release.2.
billingadded to extract response metadataNew
V2ExtractBilling { service_tier, total_credits }model, added asbillingonV2ExtractMetadata(mirrors the existingV2ParseBilling). Parse metadata already modeledbilling.3.
206/404onGET /v2/parse/jobs/{job_id}No code change — the base client already treats
206as success (envelope normalizes normally) and raisesNotFoundErroron404. Added regression tests to lock the behavior.Docs updated for the rename:
api.md,examples/v2_parse.py,docs/v2-testing.md.Out of scope
The spec also has
/v2/workflowendpoints, but the SDK has no workflow resource (it never did — not one of the three diffs). Left as a follow-up.Test plan
service_tierreaches the wire body (parse + extract), extractbillingparses, parsegethandles206, parsegetraisesNotFoundErroron404mypyclean on changed files;ruffclean on touched trees🤖 Generated with Claude Code