diff --git a/src/openai/cli/_api/audio.py b/src/openai/cli/_api/audio.py index 90d21b9932..7038dfa76c 100644 --- a/src/openai/cli/_api/audio.py +++ b/src/openai/cli/_api/audio.py @@ -75,7 +75,18 @@ def transcribe(args: CLITranscribeArgs) -> None: # but we don't want to validate that here for forwards-compat response_format=cast(Any, args.response_format), ) - print_model(model) + + if args.response_format == 'json': + print_model(model) + elif args.response_format == 'srt': + # Handle SRT response format + print_model(model.get('srt')) + elif args.response_format == 'vtt': + # Handle VTT response format + print_model(model.get('vtt')) + else: + raise CLIError(f"Unsupported response format: {args.response_format}") + @staticmethod def translate(args: CLITranslationArgs) -> None: @@ -91,4 +102,14 @@ def translate(args: CLITranslationArgs) -> None: # but we don't want to validate that here for forwards-compat response_format=cast(Any, args.response_format), ) - print_model(model) + + if args.response_format == 'json': + print_model(model) + elif args.response_format == 'srt': + # Handle SRT response format + print_model(model.get('srt')) + elif args.response_format == 'vtt': + # Handle VTT response format + print_model(model.get('vtt')) + else: + raise CLIError(f"Unsupported response format: {args.response_format}")