
    f j                        d dl mZ d dlmZmZmZmZ d dlmZ ddl	m
Z
mZ ddlmZ ddlmZ dd	lmZ erd d
lmZ ddZ G d de          Z G d de          Z G d d          ZdS )    )annotations)TYPE_CHECKINGAnyOptionalcast)ArgumentParser   )
get_clientprint_model   )	NOT_GIVEN)	BaseModel)BufferReader)_SubParsersAction	subparser!_SubParsersAction[ArgumentParser]returnNonec                n   |                      d          }|                    ddt          d           |                    ddt          d	           |                    d
t                     |                    dt                     |                    ddt                     |                    dt                     |                    t
          j        t                     |                      d          }|                    ddt          d	           |                    ddt          d           |                    d
t                     |                    ddt                     |                    dt                     |                    t
          j        t                     d S )Nzaudio.transcriptions.createz-mz--modelz	whisper-1)typedefaultz-fz--fileT)r   requiredz--response-format)r   z
--languagez-tz--temperaturez--prompt)func
args_modelzaudio.translations.create)

add_parseradd_argumentstrfloatset_defaultsCLIAudio
transcribeCLITranscribeArgs	translateCLITranslationArgs)r   subs     iC:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\openai/cli/_api/audio.pyregisterr'      s   


<
=
=C T93DDDT8#===(s333\,,,T?777Zc***(-:KLLL 

:
;
;C T8#===T93DDD(s333 T?777Zc***(,9KLLLLL    c                  \    e Zd ZU ded<   ded<   dZded<   dZded<   dZded	<   dZded
<   dS )r"   r   modelfileNOptional[str]response_formatlanguageOptional[float]temperatureprompt__name__
__module____qualname____annotations__r-   r.   r0   r1    r(   r&   r"   r"   ,   h         JJJIII%)O))))"H""""#'K'''' F      r(   r"   c                  \    e Zd ZU ded<   ded<   dZded<   dZded<   dZded	<   dZded
<   dS )r$   r   r*   r+   Nr,   r-   r.   r/   r0   r1   r2   r7   r(   r&   r$   r$   5   r8   r(   r$   c                  >    e Zd Zed	d            Zed
d            ZdS )r    argsr"   r   r   c                   t          | j        d          5 }t          |                                d          }d d d            n# 1 swxY w Y   t	                      j        j                            | j        |f| j        | j	        pt          | j        pt          | j        pt          t          t          | j                            }t!          |           d S )NrbUpload progressdesc)r+   r*   r.   r0   r1   r-   )openr+   r   readr
   audiotranscriptionscreater*   r.   r   r0   r1   r   r   r-   r   r;   file_readerbuffer_readerr*   s       r&   r!   zCLIAudio.transcribe?   s   $)T"" 	Uk()9)9););BSTTTM	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U "188)]+*]/i(5I;+) !d&:;; 9 	
 	
 	E   $AA
A
r$   c           
        t          | j        d          5 }t          |                                d          }d d d            n# 1 swxY w Y   t	                      j        j                            | j        |f| j        | j	        pt          | j        pt          t          t          | j                            }t          |           d S )Nr=   r>   r?   )r+   r*   r0   r1   r-   )rA   r+   r   rB   r
   rC   translationsrE   r*   r0   r   r1   r   r   r-   r   rF   s       r&   r#   zCLIAudio.translateP   s   $)T"" 	Uk()9)9););BSTTTM	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U 	U "/66)]+*(5I;+) !d&:;; 7 
 
 	ErI   N)r;   r"   r   r   )r;   r$   r   r   )r3   r4   r5   staticmethodr!   r#   r7   r(   r&   r    r    >   sR           \     \  r(   r    N)r   r   r   r   )
__future__r   typingr   r   r   r   argparser   _utilsr
   r   _typesr   _modelsr   	_progressr   r   r'   r"   r$   r    r7   r(   r&   <module>rT      sS   " " " " " " 5 5 5 5 5 5 5 5 5 5 5 5 # # # # # # , , , , , , , ,             $ $ $ $ $ $ +******M M M M:! ! ! ! !	 ! ! !! ! ! ! ! ! ! !                   r(   