
    +h"                       d dl mZ d dlmZmZmZmZ d dlmZ d dl	Z	ddl
mZmZmZmZmZmZ ddlmZmZmZ ddlmZmZ dd	lmZmZ dd
lmZmZ ddlmZ erddl m!Z!m"Z" ddgZ# G d de      Z$ G d de      Z% G d d      Z& G d d      Z'y)    )annotations)TYPE_CHECKINGUnionMappingcast)LiteralN   )	NOT_GIVENBodyQueryHeadersNotGiven	FileTypes)extract_filesmaybe_transformdeepcopy_minimal)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperasync_to_raw_response_wrapper)Transcriptiontranscription_create_params)make_request_options)OpenAIAsyncOpenAITranscriptionsAsyncTranscriptionsc            	      r     e Zd ZU ded<   d fdZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ xZS )	r   TranscriptionsWithRawResponsewith_raw_responsec                D    t         |   |       t        |       | _        y N)super__init__r   r    selfclient	__class__s     X/var/www/html/venv/lib/python3.12/site-packages/openai/resources/audio/transcriptions.pyr$   zTranscriptions.__init__   s     !>t!D    Nlanguagepromptresponse_formattemperatureextra_headersextra_query
extra_bodytimeoutc       
           t        ||||||d      }t        t        t        t        t
        f   |      dgg      }|r
ddi|xs i }| j                  dt        |t        j                        |t        |||	|
      t              S )	  
        Transcribes audio into the input language.

        Args:
          file:
              The audio file object (not file name) to transcribe, in one of these formats:
              flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

          model: ID of the model to use. Only `whisper-1` is currently available.

          language: The language of the input audio. Supplying the input language in
              [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format will
              improve accuracy and latency.

          prompt: An optional text to guide the model's style or continue a previous audio
              segment. The
              [prompt](https://platform.openai.com/docs/guides/speech-to-text/prompting)
              should match the audio language.

          response_format: The format of the transcript output, in one of these options: `json`, `text`,
              `srt`, `verbose_json`, or `vtt`.

          temperature: The sampling temperature, between 0 and 1. Higher values like 0.8 will make the
              output more random, while lower values like 0.2 will make it more focused and
              deterministic. If set to 0, the model will use
              [log probability](https://en.wikipedia.org/wiki/Log_probability) to
              automatically increase the temperature until certain thresholds are hit.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        filemodelr,   r-   r.   r/   r7   pathsContent-Typemultipart/form-data/audio/transcriptionsr0   r1   r2   r3   bodyfilesoptionscast_tor   r   r   r   strobject_postr   r   TranscriptionCreateParamsr   r   r&   r7   r8   r,   r-   r.   r/   r0   r1   r2   r3   r@   rA   s                r)   createzTranscriptions.create   s    h  $ #2*	
 d73;#7>xjQ ,-B\}GZXZ\Mzz# 'B'\'\](+Q[el "  
 	
r*   )r'   r   returnNoner7   r   r8   z Union[str, Literal['whisper-1']]r,   str | NotGivenr-   rN   r.   z@Literal['json', 'text', 'srt', 'verbose_json', 'vtt'] | NotGivenr/   zfloat | NotGivenr0   zHeaders | Noner1   zQuery | Noner2   zBody | Noner3   z'float | httpx.Timeout | None | NotGivenrK   r   __name__
__module____qualname____annotations__r$   r
   rJ   __classcell__r(   s   @r)   r   r      s    44E $-!*\e(1 )-$("&;DM
 M
 0	M

 !M
 M
 ZM
 &M
 &M
 "M
  M
 9M
 
M
r*   c            	      r     e Zd ZU ded<   d fdZeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ xZS )	r   "AsyncTranscriptionsWithRawResponser    c                D    t         |   |       t        |       | _        y r"   )r#   r$   rW   r    r%   s     r)   r$   zAsyncTranscriptions.__init__q   s     !CD!Ir*   Nr+   c       
        ,  K   t        ||||||d      }t        t        t        t        t
        f   |      dgg      }|r
ddi|xs i }| j                  dt        |t        j                        |t        |||	|
      t               d	{   S 7 w)
r5   r6   r7   r9   r;   r<   r=   r>   r?   NrD   rI   s                r)   rJ   zAsyncTranscriptions.createu   s     h  $ #2*	
 d73;#7>xjQ ,-B\}GZXZ\MZZ# 'B'\'\](+Q[el "   
 
 	
 
s   BBBB)r'   r   rK   rL   rM   rO   rU   s   @r)   r   r   n   s    99J $-!*\e(1 )-$("&;DM
 M
 0	M

 !M
 M
 ZM
 &M
 &M
 "M
  M
 9M
 
M
r*   c                      e Zd ZddZy)r   c                8    t        |j                        | _        y r"   )r   rJ   r&   transcriptionss     r)   r$   z&TranscriptionsWithRawResponse.__init__   s    -!!
r*   N)r]   r   rK   rL   rP   rQ   rR   r$    r*   r)   r   r          
r*   r   c                      e Zd ZddZy)rW   c                8    t        |j                        | _        y r"   )r   rJ   r\   s     r)   r$   z+AsyncTranscriptionsWithRawResponse.__init__   s    3!!
r*   N)r]   r   rK   rL   r^   r_   r*   r)   rW   rW      r`   r*   rW   )(
__future__r   typingr   r   r   r   typing_extensionsr   httpx_typesr
   r   r   r   r   r   _utilsr   r   r   	_resourcer   r   	_responser   r   types.audior   r   _base_clientr   _clientr   r   __all__r   r   r   rW   r_   r*   r)   <module>ro      sr    # 6 6 %  J J F F : O E 0.2
3T
_ T
nT
* T
n
 

 
r*   