§
    �’j+  ã                  ór  — 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*dS )é    )Ú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	dS )$r   ú(Turn audio into text or text into audio.ÚreturnÚSpeechWithRawResponsec                ó    — 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
        )r    ©Úselfs    úKC:\Projects\DSCons\.venv\Lib\site-packages\openai\resources\audio\speech.pyÚwith_raw_responsezSpeech.with_raw_response   s   € õ % TÑ*Ô*Ð*ó    ÚSpeechWithStreamingResponsec                ó    — 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
        )r(   r#   s    r%   Úwith_streaming_responsezSpeech.with_streaming_response)   s   € õ +¨4Ñ0Ô0Ð0r'   N©ÚinstructionsÚresponse_formatÚspeedÚstream_formatÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚinputÚstrÚmodelúUnion[str, SpeechModel]Úvoiceúspeech_create_params.Voicer-   ú
str | Omitr.   ú:Literal['mp3', 'opus', 'aac', 'flac', 'wav', 'pcm'] | Omitr/   úfloat | Omitr0   úLiteral['sse', 'audio'] | Omitr1   úHeaders | Noner2   úQuery | Noner3   úBody | Noner4   ú(float | httpx2.Timeout | None | NotGivenú+_legacy_response.HttpxBinaryResponseContentc               óÀ   — ddi|pi ¥}|                       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://platform.openai.com/docs/models#tts):
              `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://platform.openai.com/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©r5   r7   r9   r-   r.   r/   r0   Úbearer_authT©r1   r2   r3   r4   Úsecurity©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚSpeechCreateParamsr   r   ÚHttpxBinaryResponseContent©r$   r5   r7   r9   r-   r.   r/   r0   r1   r2   r3   r4   s               r%   ÚcreatezSpeech.create2   s�   € ðp "Ð#=ÐWÀ-ÐBUÐSUÐWˆØ�zŠzØÝ à"Ø"Ø"Ø$0Ø'6Ø"Ø%2ðð õ %Ô7ñô õ )Ø+Ø'Ø%ØØ'¨Ð.ðñ ô õ %Ô?ð+ ñ 
ô 
ð 	
r'   )r   r    )r   r(   ©r5   r6   r7   r8   r9   r:   r-   r;   r.   r<   r/   r=   r0   r>   r1   r?   r2   r@   r3   rA   r4   rB   r   rC   ©
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r&   r+   r   r   rU   © r'   r%   r   r      sš   € € € € € Ø2Ð2àð+ð +ð +ñ „_ð+ð ð1ð 1ð 1ñ „_ð1ð $(ØVZØ"Ø8<ð )-Ø$(Ø"&Ø<EðO
ð O
ð O
ð O
ð O
ð O
ð O
ð O
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	dS )$r   r   r   ÚAsyncSpeechWithRawResponsec                ó    — t          | ¦  «        S r"   )r^   r#   s    r%   r&   zAsyncSpeech.with_raw_response‡   s   € õ *¨$Ñ/Ô/Ð/r'   Ú AsyncSpeechWithStreamingResponsec                ó    — t          | ¦  «        S r*   )r`   r#   s    r%   r+   z#AsyncSpeech.with_streaming_response‘   s   € õ 0°Ñ5Ô5Ð5r'   Nr,   r5   r6   r7   r8   r9   r:   r-   r;   r.   r<   r/   r=   r0   r>   r1   r?   r2   r@   r3   rA   r4   rB   rC   c             ƒ  óÜ   K  — ddi|pi ¥}|                       dt          |||||||dœt          j        ¦  «        ƒ d{V —†t	          ||	|
|ddi¬¦  «        t
          j        ¬	¦  «        ƒ d{V —†S )
rE   rF   rG   rH   rI   NrJ   TrK   rM   )rQ   r   r   rR   r   r   rS   rT   s               r%   rU   zAsyncSpeech.createš   sÝ   è è € ðp "Ð#=ÐWÀ-ÐBUÐSUÐWˆØ—Z’ZØÝ,à"Ø"Ø"Ø$0Ø'6Ø"Ø%2ðð õ %Ô7ñô ð ð ð ð ð ð õ )Ø+Ø'Ø%ØØ'¨Ð.ðñ ô õ %Ô?ð+  ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r'   )r   r^   )r   r`   rV   rW   r\   r'   r%   r   r   „   sš   € € € € € Ø2Ð2àð0ð 0ð 0ñ „_ð0ð ð6ð 6ð 6ñ „_ð6ð $(ØVZØ"Ø8<ð )-Ø$(Ø"&Ø<EðO
ð O
ð O
ð O
ð O
ð O
ð O
ð O
r'   c                  ó   — e Zd Zdd„ZdS )r    Úspeechr   r   ÚNonec                óP   — || _         t          j        |j        ¦  «        | _        d S ©N)Ú_speechr   Úto_raw_response_wrapperrU   ©r$   rd   s     r%   Ú__init__zSpeechWithRawResponse.__init__í   s&   € ØˆŒå&Ô>ØŒMñ
ô 
ˆŒˆˆr'   N©rd   r   r   re   ©rX   rY   rZ   rk   r\   r'   r%   r    r    ì   ó(   € € € € € ð
ð 
ð 
ð 
ð 
ð 
r'   r    c                  ó   — e Zd Zdd„ZdS )r^   rd   r   r   re   c                óP   — || _         t          j        |j        ¦  «        | _        d S rg   )rh   r   Úasync_to_raw_response_wrapperrU   rj   s     r%   rk   z#AsyncSpeechWithRawResponse.__init__ö   s&   € ØˆŒå&ÔDØŒMñ
ô 
ˆŒˆˆr'   N©rd   r   r   re   rm   r\   r'   r%   r^   r^   õ   rn   r'   r^   c                  ó   — e Zd Zdd„ZdS )r(   rd   r   r   re   c                óR   — || _         t          |j        t          ¦  «        | _        d S rg   )rh   r   rU   r   rj   s     r%   rk   z$SpeechWithStreamingResponse.__init__ÿ   s&   € ØˆŒå9ØŒMÝ%ñ
ô 
ˆŒˆˆr'   Nrl   rm   r\   r'   r%   r(   r(   þ   ó(   € € € € € ð
ð 
ð 
ð 
ð 
ð 
r'   r(   c                  ó   — e Zd Zdd„ZdS )r`   rd   r   r   re   c                óR   — || _         t          |j        t          ¦  «        | _        d S rg   )rh   r   rU   r   rj   s     r%   rk   z)AsyncSpeechWithStreamingResponse.__init__	  s&   € ØˆŒå?ØŒMÝ*ñ
ô 
ˆŒˆˆr'   Nrr   rm   r\   r'   r%   r`   r`     ru   r'   r`   )+Ú
__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    r^   r(   r`   r\   r'   r%   ú<module>r†      s_  ðð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ø %Ð %Ð %Ð %Ð %Ð %à €€€à  Ð  Ð  Ð  Ð  Ð  Ø KÐ KÐ KÐ KÐ KÐ KÐ KÐ KÐ KÐ KÐ KÐ KÐ KÐ KÐ KÐ KÐ KÐ KØ <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ø &Ð &Ð &Ð &Ð &Ð &Ø :Ð :Ð :Ð :Ð :Ð :Ð :Ð :ðð ð ð ð ð ð ð ð ð ð ð ð 0Ð /Ð /Ð /Ð /Ð /Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3à�]Ð
#€ðe
ð e
ð e
ð e
ð e
ˆ_ñ e
ô e
ð e
ðPe
ð e
ð e
ð e
ð e
Ð"ñ e
ô e
ð e
ðP
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
r'   