Ë
    ñEjÄ  ã                  ó8  — 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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ÚSpeechÚAsyncSpeechc                  ón   — e Zd Zedd„«       Zedd„«       Zeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)	r   c                ó   — t        | «      S ©N)ÚSpeechWithRawResponse©Úselfs    ú`/var/www/html/peoplehubportal/venv/lib/python3.12/site-packages/openai/resources/audio/speech.pyÚwith_raw_responsezSpeech.with_raw_response!   s   € ä$ TÓ*Ð*ó    c                ó   — t        | «      S r   )ÚSpeechWithStreamingResponser   s    r    Úwith_streaming_responsezSpeech.with_streaming_response%   s   € ä*¨4Ó0Ð0r"   N©Ú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` or `tts-1-hd`

          voice: The voice to use when generating the audio. Supported voices are `alloy`,
              `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Previews of the voices are
              available in the
              [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech/voice-options).

          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.

          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,   ©ÚbodyÚoptionsÚcast_to)Ú_postr   r   ÚSpeechCreateParamsr   r   ÚHttpxBinaryResponseContent©
r   r3   r4   r5   r'   r(   r)   r*   r+   r,   s
             r    ÚcreatezSpeech.create)   s{   € ðX "Ð#=ÐWÀ-ÒBUÐSUÐWˆØ�z‰zØÜ à"Ø"Ø"Ø'6Ø"ñô %×7Ñ7ó	ô )Ø+¸ÐQ[Ðelôô %×?Ñ?ð ó 
ð 	
r"   )Úreturnr   )r@   r$   ©r3   Ústrr4   z(Union[str, Literal['tts-1', 'tts-1-hd']]r5   z<Literal['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer']r'   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 | NotGivenr@   z+_legacy_response.HttpxBinaryResponseContent©Ú__name__Ú
__module__Ú__qualname__r   r!   r%   r   r?   © r"   r    r   r       s«   „ Øò+ó ð+ð ò1ó ð1ð [dØ"+ð )-Ø$(Ø"&Ø;Dñ=
ð ð=
ð 8ð	=
ð
 Lð=
ð Xð=
ð  ð=
ð &ð=
ð "ð=
ð  ð=
ð 9ð=
ð 
5ô=
r"   c                  ón   — e Zd Zedd„«       Zedd„«       Zeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)	r   c                ó   — t        | «      S r   )ÚAsyncSpeechWithRawResponser   s    r    r!   zAsyncSpeech.with_raw_responsej   s   € ä)¨$Ó/Ð/r"   c                ó   — t        | «      S r   )Ú AsyncSpeechWithStreamingResponser   s    r    r%   z#AsyncSpeech.with_streaming_responsen   s   € ä/°Ó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)r.   r/   r0   r1   r2   Nr6   r7   )r;   r   r   r<   r   r   r=   r>   s
             r    r?   zAsyncSpeech.creater   s”   è ø€ ðX "Ð#=ÐWÀ-ÒBUÐSUÐWˆØ—Z‘ZØÜ,à"Ø"Ø"Ø'6Ø"ñô %×7Ñ7ó	÷ 	ô )Ø+¸ÐQ[Ðelôô %×?Ñ?ð  ó 
÷ 
ð 	
ð	øð
ús!   ‚:A/¼A+
½)A/Á&A-Á'A/Á-A/)r@   rJ   )r@   rL   rA   rC   rG   r"   r    r   r   i   s«   „ Øò0ó ð0ð ò6ó ð6ð [dØ"+ð )-Ø$(Ø"&Ø;Dñ=
ð ð=
ð 8ð	=
ð
 Lð=
ð Xð=
ð  ð=
ð &ð=
ð "ð=
ð  ð=
ð 9ð=
ð 
5ô=
r"   c                  ó   — e Zd Zdd„Zy)r   c                óZ   — || _         t        j                  |j                  «      | _        y r   )Ú_speechr   Úto_raw_response_wrapperr?   ©r   Úspeechs     r    Ú__init__zSpeechWithRawResponse.__init__³   s"   € ØˆŒä&×>Ñ>Ø�M‰Mó
ˆ�r"   N©rS   r   r@   ÚNone©rD   rE   rF   rT   rG   r"   r    r   r   ²   ó   „ ô
r"   r   c                  ó   — e Zd Zdd„Zy)rJ   c                óZ   — || _         t        j                  |j                  «      | _        y r   )rP   r   Úasync_to_raw_response_wrapperr?   rR   s     r    rT   z#AsyncSpeechWithRawResponse.__init__¼   s"   € ØˆŒä&×DÑDØ�M‰Mó
ˆ�r"   N©rS   r   r@   rV   rW   rG   r"   r    rJ   rJ   »   rX   r"   rJ   c                  ó   — e Zd Zdd„Zy)r$   c                óP   — || _         t        |j                  t        «      | _        y r   )rP   r   r?   r   rR   s     r    rT   z$SpeechWithStreamingResponse.__init__Å   s   € ØˆŒä9Ø�M‰MÜ%ó
ˆ�r"   NrU   rW   rG   r"   r    r$   r$   Ä   ó   „ ô
r"   r$   c                  ó   — e Zd Zdd„Zy)rL   c                óP   — || _         t        |j                  t        «      | _        y r   )rP   r   r?   r   rR   s     r    rT   z)AsyncSpeechWithStreamingResponse.__init__Ï   s   € ØˆŒä?Ø�M‰MÜ*ó
ˆ�r"   Nr\   rW   rG   r"   r    rL   rL   Î   r_   r"   rL   )'Ú
__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   Ú__all__r   r   r   rJ   r$   rL   rG   r"   r    ú<module>ro      s�   ðõ #å Ý %ã å  ß ?Õ ?÷õ 'ß :÷ó õ 0õð �]Ð
#€ôF
ˆ_ô F
ôRF
Ð"ô F
÷R
ñ 
÷
ñ 
÷
ñ 
÷
ò 
r"   