Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions aai_cli/app/transcribe/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
)
2 changes: 1 addition & 1 deletion aai_cli/core/config_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading