feat: add Workflow Evals to the SDK and CLI - #540
Open
joaomarcoscrs wants to merge 2 commits into
Open
joaomarcoscrs wants to merge 2 commits into
joaomarcoscrs wants to merge 2 commits into
Conversation
Covers every route of the public Workflow Evals API (roboflow/roboflow#16426).
Contributor
Author
|
[Jarbas Local João] — APPROVED at Gist: https://gist.github.com/joaomarcoscrs/51194ef17b0b6f59c4d53c0a790b0abb |
This branch has not been deployed
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.
Description
Adds SDK and CLI support for the public Workflow Evals API that shipped in roboflow/roboflow#16426 (
https://api.roboflow.com/workspaces/{workspace}/workflow-evals). All 71 public routes are covered.SDK
roboflow/adapters/workflowevalsapi.py: shared transport. Handles bearer auth,Idempotency-Key/If-Match/Deletion-Keyheaders, and parses the Workflow Evals error envelope into a typedWorkflowEvalError(code,category,retryable,requestId,details). The platform OAuth error envelope is parsed too. Also includes SSE parsing for AI drafting and signed-URL PUTs.roboflow/core/workflow_evals.py:WorkflowEvalsclient with one method per endpoint, reached throughrf.workspace().workflow_evals(). On top of that it adds a few helpers:upload_case_asset: intent → signed PUT → completeai_draft/iter_ai_draft: SSE draftingdelete_confirmed/delete_run_confirmed: the two-step deletion-key protocolwait_for_run/wait_for_export: poll until donerevision.CLI:
roboflow workflow-eval …list,get(--by-url),create,update,delete,capabilities,openapi,operation,comparespec,dataset,case,binding,preparation,run,execution,export,embedding,evaluator,schema,agent--bodyaccepts inline JSON,@file.json, a file path, or-for stdin. Explicit flags are merged on top of it.case import --source/--from-dataset id:split/--artifact,binding suggest --workflow [--workflow-version],preparation start --case,compare -x a -x b,run start --wait,export start --wait.deleteshows the deletion impact and asks for confirmation (--yesskips it). Without a TTY, it refuses unless--yesis passed.--jsonmode. Exit codes: 2 for 401/403, 3 for 404, 1 otherwise. Revision, scope, feature-flag and validation errors come with hints.Also updates the
CLI-COMMANDS.mdquickstart. The full reference inroboflow-product-docsstill needs a follow-up.Type of change
How has this change been tested, please provide a testcase or example of how you tested the change?
tests/test_workflow_evals.py: a table-driven test sends a request through every JSON route and checks the method, URL, bearer auth, the UUID v4 idempotency key on the routes that require it, andIf-Match. The 71st route (SSEai-draft) has its own tests. Also covers error envelope parsing, the deletion-key flow, SSE events, the three-step upload, and polling.tests/cli/test_workflow_eval_handler.py:--helpfor every subcommand, plus body loading from file/stdin, flag merging, exit codes, delete confirmation, and payload building for import, binding, preparation, run, export and compare.ruffandmypyare clean.capabilities,evaluator list,agent skills,spec list,schema get spec, and a 404 onget(exit code 3 with a structured error).Any specific deployment considerations
None. The new endpoints still require the
Feature.WorkflowEvalsentitlement and theworkflow-evals:*key scopes.Docs
CLI-COMMANDS.mdquickstart section and command-group table.