@@ -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 (
0 commit comments