Ë
    îO´jX*  ã                  óL  — d dl mZ d dlmZ d dlmZ d dlZddlmZ ddl	m
Z
mZmZmZmZmZmZ ddlmZmZ dd	lmZ dd
lmZmZ ddlmZmZmZmZ ddlmZ ddl m!Z! ddl"m#Z# ddgZ$ G d„ de«      Z% G d„ de«      Z& G d„ d«      Z' G d„ d«      Z( G d„ d«      Z) G d„ d«      Z*y)é    )Úannotations)ÚUnion)ÚLiteralNé   )Ú_legacy_response)ÚBodyÚOmitÚQueryÚHeadersÚNotGivenÚomitÚ	not_given)Úmaybe_transformÚasync_maybe_transform)Úcached_property)ÚSyncAPIResourceÚAsyncAPIResource)ÚStreamedBinaryAPIResponseÚAsyncStreamedBinaryAPIResponseÚ#to_custom_streamed_response_wrapperÚ)async_to_custom_streamed_response_wrapper)Úspeech_create_params)Úmake_request_options)ÚSpeechModelÚSpeechÚAsyncSpeechc            	      ó~   — e Zd ZdZedd„«       Zedd„«       Zeeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	d„Z	y)
r   ú(Turn audio into text or text into audio.c                ó   — t        | «      S ©a  
        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
        )ÚSpeechWithRawResponse©Úselfs    út/var/www/origus_pro_usr/data/www/origus.pro/core/.venv/lib/python3.12/site-packages/openai/resources/audio/speech.pyÚwith_raw_responsezSpeech.with_raw_response   s   € ô % TÓ*Ð*ó    c                ó   — t        | «      S ©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
        )ÚSpeechWithStreamingResponser"   s    r$   Úwith_streaming_responsezSpeech.with_streaming_response)   s   € ô +¨4Ó0Ð0r&   N©ÚinstructionsÚresponse_formatÚspeedÚstream_formatÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutc               ó¼   — ddi|xs i ¥}| j                  dt        |||||||dœt        j                  «      t	        ||	|
|ddi¬«      t
        j                  ¬«      S )	á(  
        Generates audio from the input text.

        Returns the audio file content, or a stream of audio events.

        Args:
          input: The text to generate audio for. The maximum length is 4096 characters.

          model:
              One of the available
              [TTS models](https://developers.openai.com/api/docs/guides/text-to-speech):
              `tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`, or `gpt-4o-mini-tts-2025-12-15`.

          voice: The voice to use when generating the audio. Supported built-in voices are
              `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
              `shimmer`, `verse`, `marin`, and `cedar`. You may also provide a custom voice
              object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
              voices are available in the
              [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).

          instructions: Control the voice of your generated audio with additional instructions. Does not
              work with `tts-1` or `tts-1-hd`.

          response_format: The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`,
              `wav`, and `pcm`.

          speed: The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is
              the default.

          stream_format: The format to stream the audio in. Supported formats are `sse` and `audio`.
              `sse` is not supported for `tts-1` or `tts-1-hd`.

          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
        ÚAcceptúapplication/octet-streamú/audio/speech©ÚinputÚmodelÚvoicer,   r-   r.   r/   Úbearer_authT©r0   r1   r2   r3   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚSpeechCreateParamsr   r   ÚHttpxBinaryResponseContent©r#   r:   r;   r<   r,   r-   r.   r/   r0   r1   r2   r3   s               r$   ÚcreatezSpeech.create2   sŠ   € ðr "Ð#=ÐWÀ-ÒBUÐSUÐWˆØ�z‰zØÜ à"Ø"Ø"Ø$0Ø'6Ø"Ø%2ñô %×7Ñ7óô )Ø+Ø'Ø%ØØ'¨Ð.ôô %×?Ñ?ð+ ó 
ð 	
r&   )Úreturnr!   )rI   r)   ©r:   Ústrr;   zUnion[str, SpeechModel]r<   zspeech_create_params.Voicer,   z
str | Omitr-   z:Literal['mp3', 'opus', 'aac', 'flac', 'wav', 'pcm'] | Omitr.   zfloat | Omitr/   zLiteral['sse', 'audio'] | Omitr0   zHeaders | Noner1   zQuery | Noner2   zBody | Noner3   z(float | httpx2.Timeout | None | NotGivenrI   z+_legacy_response.HttpxBinaryResponseContent©
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r%   r*   r   r   rH   © r&   r$   r   r      sÒ   „ Ù2àò+ó ð+ð ò1ó ð1ð $(ØVZØ"Ø8<ð )-Ø$(Ø"&Ø<EñP
ð ðP
ð 'ð	P
ð
 *ðP
ð !ðP
ð TðP
ð ðP
ð 6ðP
ð &ðP
ð "ðP
ð  ðP
ð :ðP
ð  
5ô!P
r&   c            	      ó~   — e Zd ZdZedd„«       Zedd„«       Zeeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	d„Z	y)
r   r   c                ó   — t        | «      S r    )ÚAsyncSpeechWithRawResponser"   s    r$   r%   zAsyncSpeech.with_raw_responseˆ   s   € ô *¨$Ó/Ð/r&   c                ó   — t        | «      S r(   )Ú AsyncSpeechWithStreamingResponser"   s    r$   r*   z#AsyncSpeech.with_streaming_response’   s   € ô 0°Ó5Ð5r&   Nr+   c             ƒ  óì   K  — ddi|xs i ¥}| j                  dt        |||||||dœt        j                  «      ƒ d{  –—† t	        ||	|
|ddi¬«      t
        j                  ¬	«      ƒ d{  –—† S 7 Œ17 Œ­w)
r5   r6   r7   r8   r9   Nr=   Tr>   r@   )rD   r   r   rE   r   r   rF   rG   s               r$   rH   zAsyncSpeech.create›   s£   è ø€ ðr "Ð#=ÐWÀ-ÒBUÐSUÐWˆØ—Z‘ZØÜ,à"Ø"Ø"Ø$0Ø'6Ø"Ø%2ñô %×7Ñ7ó÷ ô )Ø+Ø'Ø%ØØ'¨Ð.ôô %×?Ñ?ð+  ó 
÷ 
ð 	
ðøð
ús!   ‚<A4¾A0
¿,A4Á+A2Á,A4Á2A4)rI   rT   )rI   rV   rJ   rL   rQ   r&   r$   r   r   …   sÒ   „ Ù2àò0ó ð0ð ò6ó ð6ð $(ØVZØ"Ø8<ð )-Ø$(Ø"&Ø<EñP
ð ðP
ð 'ð	P
ð
 *ðP
ð !ðP
ð TðP
ð ðP
ð 6ðP
ð &ðP
ð "ðP
ð  ðP
ð :ðP
ð  
5ô!P
r&   c                  ó   — e Zd Zdd„Zy)r!   c                óZ   — || _         t        j                  |j                  «      | _        y ©N)Ú_speechr   Úto_raw_response_wrapperrH   ©r#   Úspeechs     r$   Ú__init__zSpeechWithRawResponse.__init__ï   s"   € ØˆŒä&×>Ñ>Ø�M‰Mó
ˆ�r&   N©r^   r   rI   ÚNone©rM   rN   rO   r_   rQ   r&   r$   r!   r!   î   ó   „ ô
r&   r!   c                  ó   — e Zd Zdd„Zy)rT   c                óZ   — || _         t        j                  |j                  «      | _        y rZ   )r[   r   Úasync_to_raw_response_wrapperrH   r]   s     r$   r_   z#AsyncSpeechWithRawResponse.__init__ø   s"   € ØˆŒä&×DÑDØ�M‰Mó
ˆ�r&   N©r^   r   rI   ra   rb   rQ   r&   r$   rT   rT   ÷   rc   r&   rT   c                  ó   — e Zd Zdd„Zy)r)   c                óP   — || _         t        |j                  t        «      | _        y rZ   )r[   r   rH   r   r]   s     r$   r_   z$SpeechWithStreamingResponse.__init__  s   € ØˆŒä9Ø�M‰MÜ%ó
ˆ�r&   Nr`   rb   rQ   r&   r$   r)   r)      ó   „ ô
r&   r)   c                  ó   — e Zd Zdd„Zy)rV   c                óP   — || _         t        |j                  t        «      | _        y rZ   )r[   r   rH   r   r]   s     r$   r_   z)AsyncSpeechWithStreamingResponse.__init__  s   € ØˆŒä?Ø�M‰MÜ*ó
ˆ�r&   Nrg   rb   rQ   r&   r$   rV   rV   
  rj   r&   rV   )+Ú
__future__r   Útypingr   Útyping_extensionsr   Úhttpx2Ú r   Ú_typesr   r	   r
   r   r   r   r   Ú_utilsr   r   Ú_compatr   Ú	_resourcer   r   Ú	_responser   r   r   r   Útypes.audior   Ú_base_clientr   Útypes.audio.speech_modelr   Ú__all__r   r   r!   rT   r)   rV   rQ   r&   r$   ú<module>r{      sŽ   ðõ #å Ý %ã å  ß K× KÑ Kß <Ý &ß :÷ó õ 0Ý 0Ý 3à�]Ð
#€ôf
ˆ_ô f
ôRf
Ð"ô f
÷R
ñ 
÷
ñ 
÷
ñ 
÷
ò 
r&   