Skip to content

Commit 84f7d14

Browse files
author
Dylan Huang
committed
use latest SDK
1 parent a7fd3f4 commit 84f7d14

3 files changed

Lines changed: 49 additions & 22 deletions

File tree

eval_protocol/cli.py

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ def _configure_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParse
332332
"upload",
333333
help="Scan for evaluation tests, select, and upload as Fireworks evaluators",
334334
)
335+
336+
# CLI workflow flags (not part of the SDK create() signature)
335337
upload_parser.add_argument(
336338
"--path",
337339
default=".",
@@ -341,23 +343,6 @@ def _configure_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParse
341343
"--entry",
342344
help="Entrypoint of evaluation test to upload (module:function or path::function). For multiple, separate by commas.",
343345
)
344-
upload_parser.add_argument(
345-
"--id",
346-
help="Evaluator ID to use (if multiple selections, a numeric suffix is appended)",
347-
)
348-
upload_parser.add_argument(
349-
"--display-name",
350-
help="Display name for evaluator (defaults to ID)",
351-
)
352-
upload_parser.add_argument(
353-
"--description",
354-
help="Description for evaluator",
355-
)
356-
upload_parser.add_argument(
357-
"--force",
358-
action="store_true",
359-
help="Overwrite existing evaluator with the same ID",
360-
)
361346
upload_parser.add_argument(
362347
"--yes",
363348
"-y",
@@ -368,6 +353,48 @@ def _configure_parser(parser: argparse.ArgumentParser) -> argparse.ArgumentParse
368353
"--env-file",
369354
help="Path to .env file containing secrets to upload (default: .env in current directory)",
370355
)
356+
upload_parser.add_argument(
357+
"--force",
358+
action="store_true",
359+
help="Overwrite existing evaluator with the same ID",
360+
)
361+
362+
# Auto-generate flags from SDK Fireworks().evaluators.create() signature
363+
create_evaluator_fn = Fireworks().evaluators.create
364+
365+
upload_skip_fields = {
366+
"__top_level__": {
367+
"account_id", # auto-detected
368+
"extra_headers",
369+
"extra_query",
370+
"extra_body",
371+
"timeout",
372+
},
373+
"evaluator": {
374+
"commit_hash", # should be auto-detected from git
375+
"source", # not relevant for CLI flow
376+
},
377+
}
378+
upload_aliases = {
379+
"evaluator_id": ["--id"],
380+
"evaluator.display_name": ["--name"],
381+
}
382+
upload_help_overrides = {
383+
"evaluator_id": "Evaluator ID to use (if multiple selections, a numeric suffix is appended)",
384+
"evaluator.display_name": "Display name for evaluator (defaults to ID)",
385+
"evaluator.description": "Description for evaluator",
386+
"evaluator.requirements": "Requirements for evaluator (auto-detected from requirements.txt if not provided)",
387+
"evaluator.entry_point": "Pytest-style entrypoint (e.g., test_file.py::test_func). Auto-detected if not provided.",
388+
"evaluator.default_dataset": "Default dataset to use with this evaluator",
389+
}
390+
391+
add_args_from_callable_signature(
392+
upload_parser,
393+
create_evaluator_fn,
394+
skip_fields=upload_skip_fields,
395+
aliases=upload_aliases,
396+
help_overrides=upload_help_overrides,
397+
)
371398

372399
# Create command group
373400
create_parser = subparsers.add_parser(

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies = [
3636
"pytest-asyncio>=0.21.0",
3737
"peewee>=3.18.2",
3838
"backoff>=2.2.0",
39-
"fireworks-ai==1.0.0a19",
39+
"fireworks-ai==1.0.0a20",
4040
"questionary>=2.0.0",
4141
# Dependencies for vendored tau2 package
4242
"toml>=0.10.0",

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)