
    hP=                       % S SK Jr  S SKrS SKJrJrJrJr  S SKJ	r	J
r
Jr  S SKrSSKJr  SSKJrJrJrJrJrJr  SSKJrJrJrJr  SS	KJr  SS
KJrJr  SSK J!r!J"r"  SSK#J$r$  SSK%J&r&  SSK'J(r(  SSK)J*r*  SSK+J,r,  SSK-J.r.  SS/r/\R`                  " S5      r1S\2S'    " S S\5      r3 " S S\5      r4 " S S5      r5 " S S5      r6 " S S5      r7 " S S 5      r8    S"S! jr9g)#    )annotationsN)TYPE_CHECKINGUnionMappingcast)Literaloverloadassert_never   )_legacy_response)	NOT_GIVENBodyQueryHeadersNotGiven	FileTypes)extract_filesmaybe_transformdeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)translation_create_params)make_request_options)
AudioModel)Translation)AudioResponseFormat)TranslationVerboseTranslationsAsyncTranslationszopenai.audio.transcriptionszlogging.Loggerlogc            	      f   \ rS rSr\SS j5       r\SS j5       r\\\\SSS\S.                   SS jj5       r	\\\SSS\S.                   SS jj5       r	\\\SSS\S.                   SS	 jj5       r	\\\SSS\S
.                   SS jjr	Sr
g)r"   "   c                    [        U 5      $ z
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
)TranslationsWithRawResponseselfs    U/var/www/html/env/lib/python3.13/site-packages/openai/resources/audio/translations.pywith_raw_responseTranslations.with_raw_response#   s     +400    c                    [        U 5      $ z
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/openai/openai-python#with_streaming_response
)!TranslationsWithStreamingResponser*   s    r,   with_streaming_response$Translations.with_streaming_response-   s     166r/   Nresponse_formatprompttemperatureextra_headersextra_query
extra_bodytimeoutc       	            g N 
r+   filemodelr6   r7   r8   r9   r:   r;   r<   s
             r,   createTranslations.create6   s     r/   r7   r8   r9   r:   r;   r<   c       	            g r>   r?   r@   s
             r,   rC   rD   G   s     !r/   c       	            g r>   r?   r@   s
             r,   rC   rD   X   s     r/   r7   r6   r8   r9   r:   r;   r<   c       	           [        UUUUUS.5      n
[        [        [        [        [
        4   U
5      S//S9nSS0U=(       d    0 EnU R                  S[        U
[        R                  5      U[        XgXS9[        U5      S9$ )	  
Translates audio into English.

Args:
  file: The audio file object (not file name) translate, 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` (which is powered by our open source
      Whisper V2 model) is currently available.

  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 be in English.

  response_format: The format of the 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
rA   rB   r7   r6   r8   rA   pathsContent-Typemultipart/form-data/audio/translationsr9   r:   r;   r<   bodyfilesoptionscast_to)r   r   r   r   strobject_postr   r   TranslationCreateParamsr   _get_response_format_typer+   rA   rB   r7   r6   r8   r9   r:   r;   r<   rS   rT   s               r,   rC   rD   i   s    ^   #2*
 d73;#7>xjQ ()>X=CVTVXzz! '@'X'XY(+Q[ .o>  
 	
r/   r?   )returnr)   )r]   r2   rA   r   rB   Union[str, AudioModel]r6   z Union[Literal['json'], NotGiven]r7   str | NotGivenr8   float | NotGivenr9   Headers | Noner:   Query | Noner;   Body | Noner<   'float | httpx.Timeout | None | NotGivenr]   r   rA   r   rB   r_   r6   zLiteral['verbose_json']r7   r`   r8   ra   r9   rb   r:   rc   r;   rd   r<   re   r]   r!   rA   r   rB   r_   r6   zLiteral['text', 'srt', 'vtt']r7   r`   r8   ra   r9   rb   r:   rc   r;   rd   r<   re   r]   rW   )rA   r   rB   r_   r7   r`   r6   zFUnion[Literal['json', 'text', 'srt', 'verbose_json', 'vtt'], NotGiven]r8   ra   r9   rb   r:   rc   r;   rd   r<   re   r]   &Translation | TranslationVerbose | str__name__
__module____qualname____firstlineno__r   r-   r3   r	   r   rC   __static_attributes__r?   r/   r,   r"   r"   "   sj   1 1 7 7  =F!*(1 )-$("&;D  &	
 :  & & "   9 
    "+(1 )-$("&;D! ! &	!
 1! ! &! &! "!  ! 9! 
! !   "+(1 )-$("&;D  &	
 7  & & "   9 
 * "+bk(1 )-$("&;DE
 E
 &	E

 E
 `E
 &E
 &E
 "E
  E
 9E
 
0E
 E
r/   c            	      f   \ rS rSr\SS j5       r\SS j5       r\\\\SSS\S.                   SS jj5       r	\\\SSS\S.                   SS jj5       r	\\\SSS\S.                   SS	 jj5       r	\\\SSS\S
.                   SS jjr	Sr
g)r#      c                    [        U 5      $ r(   ) AsyncTranslationsWithRawResponser*   s    r,   r-   #AsyncTranslations.with_raw_response   s     055r/   c                    [        U 5      $ r1   )&AsyncTranslationsWithStreamingResponser*   s    r,   r3   )AsyncTranslations.with_streaming_response   s     6d;;r/   Nr5   c       	           #    g 7fr>   r?   r@   s
             r,   rC   AsyncTranslations.create   s
         rE   c       	           #    g 7fr>   r?   r@   s
             r,   rC   rx      s
      !ry   c       	           #    g 7fr>   r?   r@   s
             r,   rC   rx      s
      ry   rH   c       	        8  #    [        UUUUUS.5      n
[        [        [        [        [
        4   U
5      S//S9nSS0U=(       d    0 EnU R                  S[        U
[        R                  5      I Sh  vN U[        XgXS9[        U5      S	9I Sh  vN $  N" N7f)
rJ   rK   rA   rL   rN   rO   rP   NrQ   rR   )r   r   r   r   rW   rX   rY   r   r   rZ   r   r[   r\   s               r,   rC   rx      s     ^   #2*
 d73;#7>xjQ ()>X=CVTVXZZ!,T3L3d3dee(+Q[ .o>   
 
 	
e
s$   A1B3B
4BBBBr?   )r]   rr   )r]   ru   r^   rf   rg   )rA   r   rB   r_   r7   r`   r6   z$Union[AudioResponseFormat, NotGiven]r8   ra   r9   rb   r:   rc   r;   rd   r<   re   r]   rh   ri   r?   r/   r,   r#   r#      si   6 6 < <  =F!*(1 )-$("&;D  &	
 :  & & "   9 
    "+(1 )-$("&;D! ! &	!
 1! ! &! &! "!  ! 9! 
! !   "+(1 )-$("&;D  &	
 7  & & "   9 
 * "+@I(1 )-$("&;DE
 E
 &	E

 E
 >E
 &E
 &E
 "E
  E
 9E
 
0E
 E
r/   c                      \ rS rSrSS jrSrg)r)   i@  c                Z    Xl         [        R                  " UR                  5      U l        g r>   )_translationsr   to_raw_response_wrapperrC   r+   translationss     r,   __init__$TranslationsWithRawResponse.__init__A  s#    )&>>
r/   r   rC   Nr   r"   r]   Nonerj   rk   rl   rm   r   rn   r?   r/   r,   r)   r)   @      
r/   r)   c                      \ rS rSrSS jrSrg)rr   iI  c                Z    Xl         [        R                  " UR                  5      U l        g r>   )r   r   async_to_raw_response_wrapperrC   r   s     r,   r   )AsyncTranslationsWithRawResponse.__init__J  s#    )&DD
r/   r   Nr   r#   r]   r   r   r?   r/   r,   rr   rr   I  r   r/   rr   c                      \ rS rSrSS jrSrg)r2   iR  c                D    Xl         [        UR                  5      U l        g r>   )r   r   rC   r   s     r,   r   *TranslationsWithStreamingResponse.__init__S  s    )2
r/   r   Nr   r   r?   r/   r,   r2   r2   R  r   r/   r2   c                      \ rS rSrSS jrSrg)ru   i[  c                D    Xl         [        UR                  5      U l        g r>   )r   r   rC   r   s     r,   r   /AsyncTranslationsWithStreamingResponse.__init__\  s    )8
r/   r   Nr   r   r?   r/   r,   ru   ru   [  r   r/   ru   c                   [        U [        5      (       d  U c  [        $ U S:X  a  [        $ U S:X  a  [        $ U S:X  d  U S:X  d  U S:X  a  [        $ [
        (       a  [        U 5        g [        R                  SU 5        [        $ )Njsonverbose_jsonsrttextvttz$Unexpected audio response format: %s)

isinstancer   r   r!   rW   r   r
   r$   warnTranscription)r6   s    r,   r[   r[   d  sv     /8,,0G& 	N	*!!	E	!_%>/UZBZ
	_%7Ir/   )r6   z@Literal['json', 'text', 'srt', 'verbose_json', 'vtt'] | NotGivenr]   z,type[Translation | TranslationVerbose | str]):
__future__r   loggingtypingr   r   r   r   typing_extensionsr   r	   r
   httpx r   _typesr   r   r   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer   r   	_responser   r   types.audior   _base_clientr   types.audio_modelr   types.audio.translationr   types.audio_response_formatr    types.audio.translation_verboser!   __all__	getLoggerr$   __annotations__r"   r#   r)   rr   r2   ru   r[   r?   r/   r,   <module>r      s    #  6 6 = =    J J  ' : Y 4 0 + 2 > A.
/''(EF^ FL
? L
^L
( L
^
 

 

 

 
U1r/   