
    R1i                    0   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)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    _/home/cursorai/projects/iching/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.   r/   bodyoptionscast_to)_postr   r   SpeechCreateParamsr   r   
r!   r6   r7   r8   r*   r+   r,   r-   r.   r/   s
             r"   createzSpeech.create1   ss    L ";H=3FBHzz% """'6" %77	 )+Q[el &  
 	
r$   )returnr   )rB   r'   )r6   strr7   rC   r8   rC   r*    Literal['wav', 'mp3'] | NotGivenr+   float | NotGivenr,   Headers | Noner-   Query | Noner.   Body | Noner/   'float | httpx.Timeout | None | NotGivenrB   r   __name__
__module____qualname__r   r#   r(   r   rA    r$   r"   r   r      s    + + 1 1 =F"+ )-$("&;D7
 7
 	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_responsel   s     *$//r$   c                    t        |       S r&   ) AsyncSpeechWithStreamingResponser    s    r"   r(   z#AsyncSpeech.with_streaming_responsev   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)r1   r2   r3   r4   r5   Nr9   r:   )r>   r   r   r?   r   r   r@   s
             r"   rA   zAsyncSpeech.create   s     L ";H=3FBHZZ%,"""'6" %77	 	 )+Q[el +   
 
 	
	
s!   :A%A!
A%A#A%#A%)rB   rQ   )rB   rS   )r6   rC   r7   rC   r8   rC   r*   rD   r+   rE   r,   rF   r-   rG   r.   rH   r/   rI   rB   r   rJ   rN   r$   r"   r   r   k   s    0 0 6 6 =F"+ )-$("&;D7
 7
 	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   rA   r   r!   speechs     r"   __init__zSpeechWithRawResponse.__init__   s    4MM
r$   NrZ   r   rB   NonerK   rL   rM   r[   rN   r$   r"   r   r          
r$   r   c                      e Zd ZddZy)rQ   c                P    || _         t        |j                  t              | _        y rW   )rX   r   rA   r   rY   s     r"   r[   z#AsyncSpeechWithRawResponse.__init__   s    :MM"
r$   NrZ   r   rB   r]   r^   rN   r$   r"   rQ   rQ      r_   r$   rQ   c                      e Zd ZddZy)r'   c                P    || _         t        |j                  t              | _        y rW   )rX   r   rA   r   rY   s     r"   r[   z$SpeechWithStreamingResponse.__init__   s    9MM%
r$   Nr\   r^   rN   r$   r"   r'   r'      r_   r$   r'   c                      e Zd ZddZy)rS   c                P    || _         t        |j                  t              | _        y rW   )rX   r   rA   r   rY   s     r"   r[   z)AsyncSpeechWithStreamingResponse.__init__   s    ?MM*
r$   Nrb   r^   rN   r$   r"   rS   rS      r_   r$   rS   )'
__future__r   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   rQ   r'   rS   rN   r$   r"   <module>rr      s    # %  ? ? < & :	 	 	 0 0]
#K
_ K
\K
" K
\
 

 

 

 
r$   