Skip to content

Commit 9dd828e

Browse files
committed
Updated config_file option in CLI
1 parent 83e2adb commit 9dd828e

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "neuralnoise"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
description = "An AI-powered podcast studio that uses multiple AI agents working together."
55
authors = [
66
{ name = "Leonardo Piñeyro", email = "[email protected]" }

src/neuralnoise/cli.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@
1717
def new(
1818
input: str = typer.Argument(..., help="Path to the input file or URL"),
1919
name: str = typer.Option(..., help="Name of the podcast episode"),
20-
config_file: Path = typer.Option(
21-
..., help="Path to the podcast configuration file"
22-
),
20+
config: Path = typer.Option(..., help="Path to the podcast configuration file"),
2321
only_script: bool = typer.Option(False, help="Only generate the script and exit"),
2422
):
2523
"""
2624
Generate a script from an input text file using the specified configuration.
2725
2826
For example:
2927
30-
nn <url|file> --name <name> --config-file config/config_openai.json
28+
nn new <url|file> --name <name> --config config/config_openai.json
3129
"""
3230
typer.echo(f"Generating script from {input}")
3331

@@ -44,7 +42,7 @@ def new(
4442
create_podcast_episode(
4543
name,
4644
content,
47-
config_file=config_file,
45+
config_path=config,
4846
only_script=only_script,
4947
)
5048

src/neuralnoise/prompts/script_generation.system.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
speaker: "speaker1" | "speaker2";
2020
content: string;
2121
type: "narrative" | "reaction" | "question";
22-
blank_duration?: number; // Time in seconds (0.1 to 1.0) for silence after speaking
22+
blank_duration?: number; // Time in seconds (0.1, 0.2, 0.3, or 0.5) for silence after speaking
2323
}>;
2424
}
2525
]]>

src/neuralnoise/studio/create.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def create_podcast_episode_from_script(
7373
def create_podcast_episode(
7474
name: str,
7575
content: str,
76-
config_file: str | Path,
76+
config: StudioConfig | None = None,
77+
config_path: str | Path | None = None,
7778
format: Literal["wav", "mp3", "ogg"] = "wav",
7879
only_script: bool = False,
7980
):
@@ -82,12 +83,16 @@ def create_podcast_episode(
8283
output_dir.mkdir(parents=True, exist_ok=True)
8384

8485
# Load configuration
85-
logger.info("🔧 Loading configuration from %s", config_file)
86-
with open(config_file, "r") as f:
87-
config = StudioConfig.model_validate_json(f.read())
86+
if config_path:
87+
logger.info("🔧 Loading configuration from %s", config_path)
88+
with open(config_path, "r") as f:
89+
config = StudioConfig.model_validate_json(f.read())
90+
91+
if not config:
92+
raise ValueError("No studio configuration provided")
8893

8994
# Generate the script
90-
script_path = output_dir / f"script.json"
95+
script_path = output_dir / "script.json"
9196

9297
if script_path.exists():
9398
logger.info("💬 Loading cached script")

0 commit comments

Comments
 (0)