o
    h                     @  s  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 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)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                   @  B   e Zd ZedddZedddZ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"   o/var/www/html/construction_image-detection-poc/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speedextra_headersextra_query
extra_bodytimeoutinputstrmodelvoicer+   Literal['wav'] | NotGivenr,   float | NotGivenr-   Headers | Noner.   Query | Noner/   Body | Noner0   'float | httpx.Timeout | None | NotGivenr   c       	   
   	   C  sB   ddi|pi }| j dt|||||dtjt||||	dtdS )  
        Generates audio from the input text.

        Args:
          input: The text to generate audio for.

          model: One of the available TTS models

          voice: The voice to use when generating the audio.

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

          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application/octet-stream/openai/v1/audio/speechr1   r3   r4   r+   r,   r-   r.   r/   r0   bodyoptionscast_to)_postr
   r   SpeechCreateParamsr   r   
r!   r1   r3   r4   r+   r,   r-   r.   r/   r0   r"   r"   r#   create4   s"   %
zSpeech.create)r   r   )r   r&   )r1   r2   r3   r2   r4   r2   r+   r5   r,   r6   r-   r7   r.   r8   r/   r9   r0   r:   r   r   __name__
__module____qualname__r   r$   r(   r   rH   r"   r"   r"   r#   r           	c                   @  r   ) r   r   AsyncSpeechWithRawResponsec                 C  r   r   )rN   r    r"   r"   r#   r$   n   r%   zAsyncSpeech.with_raw_response AsyncSpeechWithStreamingResponsec                 C  r   r'   )rO   r    r"   r"   r#   r(   x   r)   z#AsyncSpeech.with_streaming_responseNr*   r1   r2   r3   r4   r+   r5   r,   r6   r-   r7   r.   r8   r/   r9   r0   r:   r   c       	   
   	     sP   ddi|pi }| j dt|||||dtjI dH t||||	dtdI dH S )r;   r<   r=   r>   r?   Nr@   rA   )rE   r   r   rF   r   r   rG   r"   r"   r#   rH      s$   %
zAsyncSpeech.create)r   rN   )r   rO   )r1   r2   r3   r2   r4   r2   r+   r5   r,   r6   r-   r7   r.   r8   r/   r9   r0   r:   r   r   rI   r"   r"   r"   r#   r   m   rM   c                   @     e Zd ZdddZdS )	r   speechr   r   Nonec                 C     || _ t|jt| _d S N)_speechr   rH   r   r!   rQ   r"   r"   r#   __init__   
   
zSpeechWithRawResponse.__init__NrQ   r   r   rR   rJ   rK   rL   rW   r"   r"   r"   r#   r          r   c                   @  rP   )	rN   rQ   r   r   rR   c                 C  rS   rT   )rU   r   rH   r   rV   r"   r"   r#   rW      rX   z#AsyncSpeechWithRawResponse.__init__NrQ   r   r   rR   rZ   r"   r"   r"   r#   rN      r[   rN   c                   @  rP   )	r&   rQ   r   r   rR   c                 C  rS   rT   )rU   r   rH   r   rV   r"   r"   r#   rW      rX   z$SpeechWithStreamingResponse.__init__NrY   rZ   r"   r"   r"   r#   r&      r[   r&   c                   @  rP   )	rO   rQ   r   r   rR   c                 C  rS   rT   )rU   r   rH   r   rV   r"   r"   r#   rW      rX   z)AsyncSpeechWithStreamingResponse.__init__Nr\   rZ   r"   r"   r"   r#   rO      r[   rO   )'
__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   rN   r&   rO   r"   r"   r"   r#   <module>   s"   (
MM


