HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/.local/lib/python3.10/site-packages/openai/cli/_api/__pycache__/audio.cpython-310.pyc
o

���g��@s�ddlmZddlZddlmZmZmZmZddlm	Z	ddl
mZmZddl
mZdd	lmZdd
lmZddlmZerDddlmZddd�ZGdd�de�ZGdd�de�ZGdd�d�ZdS)�)�annotationsN)�
TYPE_CHECKING�Any�Optional�cast)�ArgumentParser�)�
get_client�print_model�)�	NOT_GIVEN)�	BaseModel)�BufferReader)�
Transcription)�_SubParsersAction�	subparser�!_SubParsersAction[ArgumentParser]�return�NonecCs�|�d�}|jddtdd�|jddtdd	�|jd
td�|jdtd�|jd
dtd�|jdtd�|jtjtd�|�d�}|jddtdd	�|jddtdd�|jd
td�|jd
dtd�|jdtd�|jtjt	d�dS)Nzaudio.transcriptions.createz-mz--modelz	whisper-1)�type�defaultz-fz--fileT)r�requiredz--response-format)rz
--languagez-tz
--temperaturez--prompt)�func�
args_modelzaudio.translations.create)
�
add_parser�add_argument�str�float�set_defaults�CLIAudio�
transcribe�CLITranscribeArgs�	translate�CLITranslationArgs)r�sub�r%�H/home/arjun/.local/lib/python3.10/site-packages/openai/cli/_api/audio.py�registers

r'c@�NeZdZUded<ded<dZded<dZded<dZded	<dZded
<dS)r!r�model�fileN�
Optional[str]�response_format�language�Optional[float]�temperature�prompt��__name__�
__module__�__qualname__�__annotations__r,r-r/r0r%r%r%r&r!.�
r!c@r()r#rr)r*Nr+r,r-r.r/r0r1r%r%r%r&r#7r6r#c@s(eZdZeddd��Zeddd	��Zd
S)
r�argsr!rrcCs�t|jd��}t|��dd�}Wd�n1swYtdt�jjj|j|f|j	|j
p/t|jp3t|j
p7ttt|j�d��}t|t�rOtj�|d�dSt|�dS)N�rb�Upload progress��desc�Transcription | str)r*r)r-r/r0r,�
)�openr*r�readrr	�audio�transcriptions�creater)r-rr/r0rr,�
isinstancer�sys�stdout�writer
�r7�file_reader�
buffer_readerr)r%r%r&r As"�

��

zCLIAudio.transcriber#c
Cs�t|jd��}t|��dd�}Wd�n1swYtdt�jjj|j|f|j	|j
p/t|jp3ttt
|j�d��}t|t�rKtj�|d�dSt|�dS)Nr8r9r:r<)r*r)r/r0r,r=)r>r*rr?rr	r@�translationsrBr)r/rr0rr,rCrrDrErFr
rGr%r%r&r"Xs �

��
zCLIAudio.translateN)r7r!rr)r7r#rr)r2r3r4�staticmethodr r"r%r%r%r&r@s
r)rrrr)�
__future__rrD�typingrrrr�argparser�_utilsr	r
�_typesr�_modelsr
�	_progressr�types.audiorrr'r!r#rr%r%r%r&�<module>s