o
    i                      @  s   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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 deZ%G dd deZ&G dd dZ'G dd dZ(G dd dZ)G dd dZ*dS )    )annotations)Union)LiteralN   )BodyOmitQueryHeadersNotGivenomit	not_given)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                   @  D   e Zd Zed ddZed!ddZeeeddded	d"ddZdS )#r   returnSpeechWithRawResponsec                 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
        )r    self r%   a/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/groq/resources/audio/speech.pywith_raw_response      zSpeech.with_raw_responseSpeechWithStreamingResponsec                 C  r!   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
        )r)   r#   r%   r%   r&   with_streaming_response)      zSpeech.with_streaming_responseNresponse_formatsample_ratespeedextra_headersextra_query
extra_bodytimeoutinputstrmodel6Union[str, Literal['playai-tts', 'playai-tts-arabic']]voicer.   4Literal['flac', 'mp3', 'mulaw', 'ogg', 'wav'] | Omitr/   >Literal[8000, 16000, 22050, 24000, 32000, 44100, 48000] | Omitr0   float | Omitr1   Headers | Noner2   Query | Noner3   Body | Noner4   'float | httpx.Timeout | None | NotGivenr   c       
      
   C  sD   ddi|pi }| j dt||||||dtjt|||	|
dtdS )L  
        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 of the generated audio. Supported formats are
              `flac, mp3, mulaw, ogg, wav`.

          sample_rate: The sample rate for generated audio

          speed: The speed of the generated audio.

          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r5   r7   r9   r.   r/   r0   r1   r2   r3   r4   bodyoptionscast_to)_postr   r   SpeechCreateParamsr   r   r$   r5   r7   r9   r.   r/   r0   r1   r2   r3   r4   r%   r%   r&   create2   s$   *zSpeech.create)r   r    )r   r)   )r5   r6   r7   r8   r9   r6   r.   r:   r/   r;   r0   r<   r1   r=   r2   r>   r3   r?   r4   r@   r   r   	__name__
__module____qualname__r   r'   r+   r   r   rN   r%   r%   r%   r&   r          	c                   @  r   )#r   r   AsyncSpeechWithRawResponsec                 C  r!   r"   )rT   r#   r%   r%   r&   r'   r   r(   zAsyncSpeech.with_raw_response AsyncSpeechWithStreamingResponsec                 C  r!   r*   )rU   r#   r%   r%   r&   r+   |   r,   z#AsyncSpeech.with_streaming_responseNr-   r5   r6   r7   r8   r9   r.   r:   r/   r;   r0   r<   r1   r=   r2   r>   r3   r?   r4   r@   r   c       
      
     sR   ddi|pi }| j dt||||||dtjI dH t|||	|
dtdI dH S )rA   rB   rC   rD   rE   NrF   rG   )rK   r   r   rL   r   r   rM   r%   r%   r&   rN      s&   *zAsyncSpeech.create)r   rT   )r   rU   )r5   r6   r7   r8   r9   r6   r.   r:   r/   r;   r0   r<   r1   r=   r2   r>   r3   r?   r4   r@   r   r   rO   r%   r%   r%   r&   r   q   rS   c                   @     e Zd ZdddZdS )	r    speechr   r   Nonec                 C     || _ t|jt| _d S N)_speechr   rN   r   r$   rW   r%   r%   r&   __init__   
   
zSpeechWithRawResponse.__init__NrW   r   r   rX   rP   rQ   rR   r]   r%   r%   r%   r&   r           r    c                   @  rV   )	rT   rW   r   r   rX   c                 C  rY   rZ   )r[   r   rN   r   r\   r%   r%   r&   r]      r^   z#AsyncSpeechWithRawResponse.__init__NrW   r   r   rX   r`   r%   r%   r%   r&   rT      ra   rT   c                   @  rV   )	r)   rW   r   r   rX   c                 C  rY   rZ   )r[   r   rN   r   r\   r%   r%   r&   r]      r^   z$SpeechWithStreamingResponse.__init__Nr_   r`   r%   r%   r%   r&   r)      ra   r)   c                   @  rV   )	rU   rW   r   r   rX   c                 C  rY   rZ   )r[   r   rN   r   r\   r%   r%   r&   r]      r^   z)AsyncSpeechWithStreamingResponse.__init__Nrb   r`   r%   r%   r%   r&   rU      ra   rU   )+
__future__r   typingr   typing_extensionsr   httpx_typesr   r   r   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    rT   r)   rU   r%   r%   r%   r&   <module>   s$   $(
SS


