synth-ai 0.2.7__py3-none-any.whl → 0.2.8.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of synth-ai might be problematic. Click here for more details.
- synth_ai/cli/demo.py +44 -39
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev1.dist-info}/METADATA +1 -1
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev1.dist-info}/RECORD +7 -7
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev1.dist-info}/WHEEL +0 -0
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev1.dist-info}/entry_points.txt +0 -0
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev1.dist-info}/licenses/LICENSE +0 -0
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev1.dist-info}/top_level.txt +0 -0
synth_ai/cli/demo.py
CHANGED
|
@@ -35,60 +35,65 @@ def _forward_to_new(args: list[str]) -> None:
|
|
|
35
35
|
|
|
36
36
|
def register(cli):
|
|
37
37
|
@cli.group("demo", invoke_without_command=True)
|
|
38
|
+
@click.option("--force", is_flag=True, help="Overwrite existing files in CWD when initializing demo")
|
|
38
39
|
@click.option("--list", "list_only", is_flag=True, help="List available legacy demos and exit")
|
|
39
40
|
@click.option("-f", "filter_term", default="", help="Filter legacy demos by substring")
|
|
40
41
|
@click.pass_context
|
|
41
|
-
def demo(ctx: click.Context, list_only: bool, filter_term: str):
|
|
42
|
+
def demo(ctx: click.Context, force: bool, list_only: bool, filter_term: str):
|
|
42
43
|
"""Demo helpers.
|
|
43
44
|
|
|
44
|
-
-
|
|
45
|
+
- Default (no subcommand): initialize RL demo files into ./synth_demo/ (alias of rl_demo init)
|
|
46
|
+
- Legacy mode: with --list, find and run examples/*/run_demo.sh
|
|
45
47
|
- New RL demo subcommands: deploy, configure, run
|
|
46
48
|
"""
|
|
47
49
|
if ctx.invoked_subcommand is not None:
|
|
48
50
|
return
|
|
49
|
-
# Legacy behavior: interactive examples runner
|
|
50
|
-
repo_root = Path(os.getcwd())
|
|
51
|
-
examples_dir = repo_root / "examples"
|
|
52
|
-
demos = _find_demo_scripts(examples_dir)
|
|
53
|
-
if filter_term:
|
|
54
|
-
demos = [p for p in demos if filter_term.lower() in str(p).lower()]
|
|
55
|
-
|
|
56
|
-
if not demos:
|
|
57
|
-
click.echo("No run_demo.sh scripts found under examples/.")
|
|
58
|
-
return
|
|
59
51
|
|
|
52
|
+
# If explicitly asked to list legacy demos, show interactive picker
|
|
60
53
|
if list_only:
|
|
54
|
+
repo_root = Path(os.getcwd())
|
|
55
|
+
examples_dir = repo_root / "examples"
|
|
56
|
+
demos = _find_demo_scripts(examples_dir)
|
|
57
|
+
if filter_term:
|
|
58
|
+
demos = [p for p in demos if filter_term.lower() in str(p).lower()]
|
|
59
|
+
|
|
60
|
+
if not demos:
|
|
61
|
+
click.echo("No run_demo.sh scripts found under examples/.")
|
|
62
|
+
return
|
|
63
|
+
|
|
61
64
|
click.echo("Available demos:")
|
|
62
|
-
for p in demos:
|
|
63
|
-
click.echo(f"
|
|
64
|
-
|
|
65
|
+
for idx, p in enumerate(demos, start=1):
|
|
66
|
+
click.echo(f" {idx}. {p.relative_to(repo_root)}")
|
|
67
|
+
click.echo("")
|
|
68
|
+
|
|
69
|
+
def _validate_choice(val: str) -> int:
|
|
70
|
+
try:
|
|
71
|
+
i = int(val)
|
|
72
|
+
except Exception as err:
|
|
73
|
+
raise click.BadParameter("Enter a number from the list") from err
|
|
74
|
+
if i < 1 or i > len(demos):
|
|
75
|
+
raise click.BadParameter(f"Choose a number between 1 and {len(demos)}")
|
|
76
|
+
return i
|
|
65
77
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
78
|
+
choice = click.prompt("Select a demo to run", value_proc=_validate_choice)
|
|
79
|
+
script = demos[choice - 1]
|
|
80
|
+
|
|
81
|
+
click.echo("")
|
|
82
|
+
click.echo(f"🚀 Running {script.relative_to(repo_root)}\n")
|
|
70
83
|
|
|
71
|
-
def _validate_choice(val: str) -> int:
|
|
72
84
|
try:
|
|
73
|
-
|
|
74
|
-
except
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
try:
|
|
87
|
-
subprocess.run(["bash", str(script)], check=True)
|
|
88
|
-
except subprocess.CalledProcessError as e:
|
|
89
|
-
click.echo(f"❌ Demo exited with non-zero status: {e.returncode}")
|
|
90
|
-
except KeyboardInterrupt:
|
|
91
|
-
click.echo("\n🛑 Demo interrupted by user")
|
|
85
|
+
subprocess.run(["bash", str(script)], check=True)
|
|
86
|
+
except subprocess.CalledProcessError as e:
|
|
87
|
+
click.echo(f"❌ Demo exited with non-zero status: {e.returncode}")
|
|
88
|
+
except KeyboardInterrupt:
|
|
89
|
+
click.echo("\n🛑 Demo interrupted by user")
|
|
90
|
+
return
|
|
91
|
+
|
|
92
|
+
# Default: forward to RL demo init behavior, optionally with --force
|
|
93
|
+
args: list[str] = ["rl_demo.init"]
|
|
94
|
+
if force:
|
|
95
|
+
args.append("--force")
|
|
96
|
+
_forward_to_new(args)
|
|
92
97
|
|
|
93
98
|
# (prepare command removed; configure now prepares baseline TOML)
|
|
94
99
|
|
|
@@ -7,7 +7,7 @@ synth_ai/install_sqld.sh,sha256=AMBhlfq661PxeTTc6D4K_Nei_qwMvA84ei4NhQzmUUk,928
|
|
|
7
7
|
synth_ai/cli/__init__.py,sha256=ThBK5FykxAqX8Mz0E4gj94_PX9EwMEtXcmm-A8krv7E,1559
|
|
8
8
|
synth_ai/cli/balance.py,sha256=z4h1MQSyFX60k-13L9IT0rtOCI16iKNGJeNjFMZuv_k,8010
|
|
9
9
|
synth_ai/cli/calc.py,sha256=RJyQJ41e02xn-V0vRRCAVkL59UHDqyz8XpYGsenfdm4,2085
|
|
10
|
-
synth_ai/cli/demo.py,sha256=
|
|
10
|
+
synth_ai/cli/demo.py,sha256=NeRiLv9ZQyX9tVxvZ6uV5YmucQ8fu5gyL5qZE0GfBZY,5496
|
|
11
11
|
synth_ai/cli/legacy_root_backup.py,sha256=KSMADyJ2g5OVpsq_CeBzqIeDC2Um-9GyINzsJH-75uw,15872
|
|
12
12
|
synth_ai/cli/man.py,sha256=JQDon73ZkuKP9xr1_vRh5fjV9_b5xiUb7zNjny7ArB8,3765
|
|
13
13
|
synth_ai/cli/recent.py,sha256=mHhM-QrR_MfjfKSzBvvPUEC-lkXTWUZrQwqYTmb2x0Y,4173
|
|
@@ -412,9 +412,9 @@ synth_ai/v0/tracing_v1/events/manage.py,sha256=ZDXXP-ZwLH9LCsmw7Ru9o55d7bl_diPtJ
|
|
|
412
412
|
synth_ai/v0/tracing_v1/events/scope.py,sha256=BuBkhSpVHUJt8iGT9HJZF82rbb88mQcd2vM2shg-w2I,2550
|
|
413
413
|
synth_ai/v0/tracing_v1/events/store.py,sha256=0342lvAcalyJbVEIzQFaPuMQGgwiFm7M5rE6gr-G0E8,9041
|
|
414
414
|
synth_ai/zyk/__init__.py,sha256=htVLnzTYQ5rxzYpzSYBm7_o6uNKZ3pB_PrqkBrgTRS4,771
|
|
415
|
-
synth_ai-0.2.
|
|
416
|
-
synth_ai-0.2.
|
|
417
|
-
synth_ai-0.2.
|
|
418
|
-
synth_ai-0.2.
|
|
419
|
-
synth_ai-0.2.
|
|
420
|
-
synth_ai-0.2.
|
|
415
|
+
synth_ai-0.2.8.dev1.dist-info/licenses/LICENSE,sha256=ynhjRQUfqA_RdGRATApfFA_fBAy9cno04sLtLUqxVFM,1069
|
|
416
|
+
synth_ai-0.2.8.dev1.dist-info/METADATA,sha256=fvfulLHeAJH3XRKXDBAhNQbb2vRtCXvzh4qXu06PsmI,4980
|
|
417
|
+
synth_ai-0.2.8.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
418
|
+
synth_ai-0.2.8.dev1.dist-info/entry_points.txt,sha256=Neq-3bT7TAijjgOIR77pKL-WYg6TWBDeO8pp_nL4vGY,91
|
|
419
|
+
synth_ai-0.2.8.dev1.dist-info/top_level.txt,sha256=fBmtZyVHuKaGa29oHBaaUkrUIWTqSpoVMPiVdCDP3k8,9
|
|
420
|
+
synth_ai-0.2.8.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|