Ë
    $Æ%h&  ã                  óD  — 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 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)Ú	NOT_GIVENÚBodyÚQueryÚHeadersÚNotGiven)Ú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                  ót   — e Zd Zedd„«       Zedd„«       Zeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)	r   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    ú[/var/www/skyplay_api_hub/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Úextra_headersÚextra_queryÚ
extra_bodyÚtimeoutc       
        ó´   — ddi|xs i ¥}| j                  dt        ||||||dœt        j                  «      t	        |||	|
¬«      t
        j                  ¬«      S )áˆ  
        Generates audio from the input text.

        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` or `gpt-4o-mini-tts`.

          voice: The voice to use when generating the audio. Supported voices are `alloy`, `ash`,
              `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
              `verse`. 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. Does not work with `gpt-4o-mini-tts`.

          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,   r-   r.   r/   ©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚSpeechCreateParamsr   r   ÚHttpxBinaryResponseContent©r    r6   r7   r8   r)   r*   r+   r,   r-   r.   r/   s              r!   ÚcreatezSpeech.create0   s~   € ðd "Ð#=ÐWÀ-ÒBUÐSUÐWˆØ�z‰zØÜ à"Ø"Ø"Ø$0Ø'6Ø"ñô %×7Ñ7ó
ô )Ø+¸ÐQ[Ðelôô %×?Ñ?ð! ó 
ð 	
r#   )Úreturnr   )rC   r&   ©r6   Ústrr7   zUnion[str, SpeechModel]r8   zsUnion[str, Literal['alloy', 'ash', 'ballad', 'coral', 'echo', 'fable', 'onyx', 'nova', 'sage', 'shimmer', 'verse']]r)   zstr | NotGivenr*   z>Literal['mp3', 'opus', 'aac', 'flac', 'wav', 'pcm'] | NotGivenr+   zfloat | NotGivenr,   zHeaders | Noner-   zQuery | Noner.   zBody | Noner/   z'float | httpx.Timeout | None | NotGivenrC   z+_legacy_response.HttpxBinaryResponseContent©Ú__name__Ú
__module__Ú__qualname__r   r"   r'   r   rB   © r#   r!   r   r      sÁ   „ Øò+ó ð+ð ò1ó ð1ð  (1ØZcØ"+ð )-Ø$(Ø"&Ø;Dñ!D
ð ðD
ð 'ð	D
ð

ðD
ð %ðD
ð XðD
ð  ðD
ð &ðD
ð "ðD
ð  ðD
ð  9ð!D
ð" 
5ô#D
r#   c                  ót   — e Zd Zedd„«       Zedd„«       Zeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)	r   c                ó   — t        | «      S r   )ÚAsyncSpeechWithRawResponser   s    r!   r"   zAsyncSpeech.with_raw_responsex   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	        |||	|
¬«      t
        j                  ¬«      ƒ d{  –—† S 7 Œ.7 Œ­w)r1   r2   r3   r4   r5   Nr9   r:   )r>   r   r   r?   r   r   r@   rA   s              r!   rB   zAsyncSpeech.create‹   s—   è ø€ ðd "Ð#=ÐWÀ-ÒBUÐSUÐWˆØ—Z‘ZØÜ,à"Ø"Ø"Ø$0Ø'6Ø"ñô %×7Ñ7ó
÷ 
ô )Ø+¸ÐQ[Ðelôô %×?Ñ?ð!  ó 
÷ 
ð 	
ð
øð
ús!   ‚;A0½A,
¾)A0Á'A.Á(A0Á.A0)rC   rM   )rC   rO   rD   rF   rJ   r#   r!   r   r   w   sÁ   „ Øò0ó ð0ð ò6ó ð6ð  (1ØZcØ"+ð )-Ø$(Ø"&Ø;Dñ!D
ð ðD
ð 'ð	D
ð

ðD
ð %ðD
ð XðD
ð  ðD
ð &ðD
ð "ðD
ð  ðD
ð  9ð!D
ð" 
5ô#D
r#   c                  ó   — e Zd Zdd„Zy)r   c                óZ   — || _         t        j                  |j                  «      | _        y ©N)Ú_speechr   Úto_raw_response_wrapperrB   ©r    Úspeechs     r!   Ú__init__zSpeechWithRawResponse.__init__Ó   s"   € ØˆŒä&×>Ñ>Ø�M‰Mó
ˆ�r#   N©rW   r   rC   ÚNone©rG   rH   rI   rX   rJ   r#   r!   r   r   Ò   ó   „ ô
r#   r   c                  ó   — e Zd Zdd„Zy)rM   c                óZ   — || _         t        j                  |j                  «      | _        y rS   )rT   r   Úasync_to_raw_response_wrapperrB   rV   s     r!   rX   z#AsyncSpeechWithRawResponse.__init__Ü   s"   € ØˆŒä&×DÑDØ�M‰Mó
ˆ�r#   N©rW   r   rC   rZ   r[   rJ   r#   r!   rM   rM   Û   r\   r#   rM   c                  ó   — e Zd Zdd„Zy)r&   c                óP   — || _         t        |j                  t        «      | _        y rS   )rT   r   rB   r   rV   s     r!   rX   z$SpeechWithStreamingResponse.__init__å   s   € ØˆŒä9Ø�M‰MÜ%ó
ˆ�r#   NrY   r[   rJ   r#   r!   r&   r&   ä   ó   „ ô
r#   r&   c                  ó   — e Zd Zdd„Zy)rO   c                óP   — || _         t        |j                  t        «      | _        y rS   )rT   r   rB   r   rV   s     r!   rX   z)AsyncSpeechWithStreamingResponse.__init__ï   s   € ØˆŒä?Ø�M‰MÜ*ó
ˆ�r#   Nr`   r[   rJ   r#   r!   rO   rO   î   rc   r#   rO   ))Ú
__future__r   Útypingr   Útyping_extensionsr   ÚhttpxÚ r   Ú_typesr   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   rM   r&   rO   rJ   r#   r!   ú<module>rt      s‹   ðõ #å Ý %ã å  ß ?Õ ?ß <Ý &ß :÷ó õ 0Ý 0Ý 3à�]Ð
#€ôX
ˆ_ô X
ôvX
Ð"ô X
÷v
ñ 
÷
ñ 
÷
ñ 
÷
ò 
r#   