Skip to content

feat: add vision events SDK and CLI support#451

Open
rvirani1 wants to merge 3 commits intomainfrom
ENT-1082
Open

feat: add vision events SDK and CLI support#451
rvirani1 wants to merge 3 commits intomainfrom
ENT-1082

Conversation

@rvirani1
Copy link
Copy Markdown

@rvirani1 rvirani1 commented Apr 10, 2026

Description

  • Adds SDK support for the vision events API: write single/batch events, query with pagination, list use cases, and upload images
  • Adds roboflow vision-events CLI command group with subcommands: write, write-batch, query, use-cases, upload-image
  • Thin-client design with no client-side validation, so new event types and fields work without an SDK release
  • 21 unit tests covering all endpoints, pagination, passthrough integrity, filter forwarding, and error handling

Fixes ENT-1082

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?

Locally. 21 new unit tests + full suite (396 tests), ruff, mypy all pass.

Will the change affect Universe? If so was this change tested in universe?

N/A

Any specific deployment considerations

None

Docs

  • Docs updated? What were the changes:

CLI commands and SDK methods need to be documented in roboflow-product-docs (docs.roboflow.com).

rvirani1 and others added 3 commits April 9, 2026 22:42
Adds a thin-client adapter for the vision events API with no client-side
validation, so new event types and fields work without SDK releases.
Includes SDK methods on Workspace, typer CLI commands, and 21 tests.

Endpoints: write, write-batch, query, list use cases, upload image.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds get_custom_metadata_schema to the adapter, get_vision_event_metadata_schema
to Workspace, and "roboflow vision-events metadata-schema" CLI command.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@renzon renzon left a comment

Choose a reason for hiding this comment

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

Manual E2E Test Results — Vision Events SDK & CLI

Tested against local dev server (localapi.roboflow.one) with workspace renzo-sandbox and a manually created use case (jEYfHQY5Ib1EjW4imyBT).

SDK Results (all pass ✅)

Method Result
write_vision_event Created event, created: true, no warnings
write_vision_events_batch Created 5 events in one call (minor eventData warnings on non-quality_check types)
upload_vision_event_image Got sourceId + GCS URL; with --name and --metadata
Write event with uploaded image Created event referencing sourceId from upload
query_vision_events Found 7 events across 4 types
query_vision_events (filtered) Correctly filtered to 1 safety_alert event
get_vision_event_metadata_schema Discovered 3 custom fields: camera_id, line, shift
list_vision_event_use_cases Listed the use case with correct id, name, status

CLI Results (all pass ✅)

Command Exit Code Result
vision-events write '{...}' 0 Created event
vision-events write-batch '[...]' 0 Created 2 events
vision-events query <use-case> (text mode) 0 Listed all 10 events with types
vision-events query <use-case> -t quality_check -l 2 --json 0 Filtered + paginated correctly (hasMore: true, nextCursor present)
vision-events use-cases --json 0 Listed the use case
vision-events metadata-schema <use-case> --json 0 Showed 4 discovered fields
vision-events upload-image <path> --json 0 Uploaded real JPEG, got sourceId

Result on UI:

image

Caveat: Use Case (Solution) must be created manually

To run these tests, I had to create the use case (Solution) through the Vision Events UI (/renzo-sandbox/vision-events → "+ Create Use Case"). The SDK and CLI don't expose Solution CRUD — the create/update/archive/unarchive endpoints exist on the server (/query/vision-events/{workspace}/solutions) and are used by the frontend, but they're not included in this PR.

Question: Is this intentional — i.e., use cases are meant to be managed only through the UI? Or should we also add Solution CRUD to the SDK/CLI (create-use-case, update-use-case, archive-use-case, etc.) so users can fully manage the lifecycle programmatically?

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.

2 participants