Skip to content

Add Model Target Web API client support - #3147

Merged
adamtheturtle merged 1 commit into
mainfrom
adamtheturtle/create-pr
Aug 14, 2026
Merged

Add Model Target Web API client support#3147
adamtheturtle merged 1 commit into
mainfrom
adamtheturtle/create-pr

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Aug 14, 2026

Copy link
Copy Markdown
Member

Adds ModelTargetService and AsyncModelTargetService, covering the full create, poll, download and delete lifecycle for standard and advanced Model Target datasets, with OAuth2 client-credentials authentication and a bearer token which is cached until shortly before it expires. Typed request structures describe the models, guide views and State-Based Model Target configuration which Vuforia accepts, typed status reports expose generation errors and warnings, and the Model Target error envelope is parsed into public exceptions. Documentation, an API reference entry and a news fragment are included, along with 48 tests which exercise both clients against vws-python-mock.

Closes #3119.

🤖 Generated with Claude Code


Note

Medium Risk
New OAuth2 credential handling and a large public API surface, but changes are additive with broad mock-based test coverage and no changes to existing VWS signing auth.

Overview
Adds Model Target Web API support via new ModelTargetService and AsyncModelTargetService on the public package surface, covering create → poll → download → delete for standard and advanced datasets.

Authentication uses OAuth2 client credentials (client_id / client_secret), separate from VWS server keys, with cached bearer tokens refreshed before expiry. Shared logic in _model_targets builds request bodies, maps HTTP status codes to model_target_exceptions, and parses status into ModelTargetDatasetStatusReport (including generation errors/warnings). model_target_datasets adds typed models, guide views, and API option enums.

Docs gain a Model Targets usage section, API reference entries, and exception docs; Sybil/doc conftest and test fixtures wire mock OAuth env vars. Large sync/async test suites exercise the full lifecycle against vws-python-mock.

Reviewed by Cursor Bugbot for commit 88034b2. Bugbot is set up for automated code reviews on this repo. Configure here.

Add ``ModelTargetService`` and ``AsyncModelTargetService``, which cover
the create, poll, download and delete lifecycle for standard and
advanced Model Target datasets.

The clients authenticate with OAuth2 client credentials and reuse the
returned bearer token until it expires.  Typed request structures
describe the models, guide views and State-Based Model Target
configuration which Vuforia accepts, and the Model Target error envelope
is parsed into public exceptions.

Closes #3119.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 88034b2. Configure here.

Comment thread src/vws/reports.py

PROCESSING = "processing"
DONE = "done"
FAILED = "failed"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing cancelled dataset status

Medium Severity

ModelTargetDatasetStatuses only defines processing, done, and failed, but the Model Target Web API also returns cancelled when a dataset is deleted during generation. from_response_dict constructs the enum from the raw status string, so a cancelled dataset raises ValueError instead of a status report. wait_for_dataset_generated hits the same path and cannot finish.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 88034b2. Configure here.

@adamtheturtle
adamtheturtle merged commit cf2f049 into main Aug 14, 2026
14 checks passed
@adamtheturtle
adamtheturtle deleted the adamtheturtle/create-pr branch August 14, 2026 14:21
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.

Add Model Target Web API client support

1 participant