diff --git a/aai_cli/app/transcribe/run.py b/aai_cli/app/transcribe/run.py index 3ec3d18..4b1d5c9 100644 --- a/aai_cli/app/transcribe/run.py +++ b/aai_cli/app/transcribe/run.py @@ -269,6 +269,12 @@ def flags(self, pii_policies: list[str] | None) -> dict[str, object]: flags.update(config_builder.auth_header_flags(self.webhook_auth_header)) return flags + def transform_options(self) -> TransformOptions: + """The post-transcription LLM transform spec built from the `--llm` flags.""" + return TransformOptions( + prompts=list(self.llm_prompt or []), model=self.model, max_tokens=self.max_tokens + ) + def _print_show_code(opts: TranscribeOptions, merged: dict[str, object]) -> None: """Print the equivalent SDK script and exit without transcribing or authenticating. @@ -340,9 +346,7 @@ def run_transcribe(opts: TranscribeOptions, state: AppState, *, json_mode: bool) transcription_config=config_builder.construct_transcription_config(merged), concurrency=opts.concurrency, force=opts.force, - transform=TransformOptions( - prompts=list(opts.llm_prompt or []), model=opts.model, max_tokens=opts.max_tokens - ), + transform=opts.transform_options(), json_mode=json_mode, quiet=state.quiet, ) @@ -376,9 +380,7 @@ def run_transcribe(opts: TranscribeOptions, state: AppState, *, json_mode: bool) out=opts.out, output_field=opts.output_field, chars_per_caption=opts.chars_per_caption, - transform=TransformOptions( - prompts=list(opts.llm_prompt or []), model=opts.model, max_tokens=opts.max_tokens - ), + transform=opts.transform_options(), json_mode=json_mode, quiet=state.quiet, ) diff --git a/aai_cli/core/config_builder.py b/aai_cli/core/config_builder.py index 5e72a64..d54038e 100644 --- a/aai_cli/core/config_builder.py +++ b/aai_cli/core/config_builder.py @@ -200,7 +200,7 @@ def coerce_value(field: str, raw: str) -> object: """Coerce a string --config value to the type expected by `field`.""" kind = TRANSCRIBE_COERCE.get(field) or STREAM_COERCE.get(field, "str") if kind == "list": - return [part.strip() for part in raw.split(",") if part.strip()] + return split_csv(raw) or [] entry = _VALIDATORS.get(kind) if entry is None: # "str" and any unknown kind pass through raw return raw