
    >'h                    <   d dl mZ d dlmZ d dlmZ d dl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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   )	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)BinaryAPIResponseAsyncBinaryAPIResponseStreamedBinaryAPIResponseAsyncStreamedBinaryAPIResponseto_custom_raw_response_wrapper#to_custom_streamed_response_wrapper$async_to_custom_raw_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 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/groq/groq-python#accessing-raw-response-data-eg-headers
        )SpeechWithRawResponseselfs    b/home/kushmeetdev/Regenta/Chatbot/venv/lib/python3.12/site-packages/groq/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/groq/groq-python#with_streaming_response
        )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
              S )  
        Generates audio from the input text.

        Args:
          input: The text to generate audio for.

          model: One of the [available TTS models](/docs/text-to-speech).

          voice: The voice to use when generating the audio. List of voices can be found
              [here](/docs/text-to-speech).

          response_format: The format to audio in. Supported formats are `wav, mp3`.

          speed: The speed of the generated audio. 1.0 is the only supported value.

          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	audio/wav/openai/v1/audio/speechinputmodelvoicer+   r,   r-   r.   r/   r0   bodyoptionscast_to)_postr   r   SpeechCreateParamsr   r   
r"   r7   r8   r9   r+   r,   r-   r.   r/   r0   s
             r#   createzSpeech.create2   ss    L ";H=3FBHzz% """'6" %77	 )+Q[el &  
 	
r%   )returnr    )rC   r(   )r7   strr8   6Union[str, Literal['playai-tts', 'playai-tts-arabic']]r9   rD   r+    Literal['wav', 'mp3'] | NotGivenr,   float | NotGivenr-   Headers | Noner.   Query | Noner/   Body | Noner0   'float | httpx.Timeout | None | NotGivenrC   r   __name__
__module____qualname__r   r$   r)   r   rB    r%   r#   r   r      s    + + 1 1 =F"+ )-$("&;D7
 7
 F	7

 7
 :7
  7
 &7
 "7
  7
 97
 
7
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_responsem   s     *$//r%   c                    t        |       S r'   ) AsyncSpeechWithStreamingResponser!   s    r#   r)   z#AsyncSpeech.with_streaming_responsew   s     055r%   Nr*   c       	           K   ddi|xs i }| j                  dt        |||||dt        j                         d{   t	        ||||	      t
               d{   S 7 $7 w)r2   r3   r4   r5   r6   Nr:   r;   )r?   r   r   r@   r   r   rA   s
             r#   rB   zAsyncSpeech.create   s     L ";H=3FBHZZ%,"""'6" %77	 	 )+Q[el +   
 
 	
	
s!   :A%A!
A%A#A%#A%)rC   rS   )rC   rU   )r7   rD   r8   rE   r9   rD   r+   rF   r,   rG   r-   rH   r.   rI   r/   rJ   r0   rK   rC   r   rL   rP   r%   r#   r   r   l   s    0 0 6 6 =F"+ )-$("&;D7
 7
 F	7

 7
 :7
  7
 &7
 "7
  7
 97
 
 7
r%   c                      e Zd ZddZy)r    c                P    || _         t        |j                  t              | _        y N)_speechr   rB   r   r"   speechs     r#   __init__zSpeechWithRawResponse.__init__   s    4MM
r%   Nr\   r   rC   NonerM   rN   rO   r]   rP   r%   r#   r    r           
r%   r    c                      e Zd ZddZy)rS   c                P    || _         t        |j                  t              | _        y rY   )rZ   r   rB   r   r[   s     r#   r]   z#AsyncSpeechWithRawResponse.__init__   s    :MM"
r%   Nr\   r   rC   r_   r`   rP   r%   r#   rS   rS      ra   r%   rS   c                      e Zd ZddZy)r(   c                P    || _         t        |j                  t              | _        y rY   )rZ   r   rB   r   r[   s     r#   r]   z$SpeechWithStreamingResponse.__init__   s    9MM%
r%   Nr^   r`   rP   r%   r#   r(   r(      ra   r%   r(   c                      e Zd ZddZy)rU   c                P    || _         t        |j                  t              | _        y rY   )rZ   r   rB   r   r[   s     r#   r]   z)AsyncSpeechWithStreamingResponse.__init__   s    ?MM*
r%   Nrd   r`   rP   r%   r#   rU   rU      ra   r%   rU   ))
__future__r   typingr   typing_extensionsr   httpx_typesr   r   r	   r
   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   r   r   r   r   r   r   types.audior   _base_clientr   __all__r   r   r    rS   r(   rU   rP   r%   r#   <module>ru      s    #  %  ? ? < & :	 	 	 0 0]
#K
_ K
\K
" K
\
 

 

 

 
r%   