
    OYhf                    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/feuerwehr-webapp/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-BUSUWzz """'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-BUSUWZZ,"""'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"    &>>MM
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MM
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MM%
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    ?MM*
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"   