o
    Cji                     @  s   d dl mZ d dlmZ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 ddlmZmZ dd	lmZmZ dd
lmZ ddlmZmZ erTddlmZ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"dS )    )annotations)TYPE_CHECKINGUnion)LiteralN   )	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transform)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperasync_to_raw_response_wrapper)speech_create_params)HttpxBinaryResponseContentmake_request_options)OpenAIAsyncOpenAISpeechAsyncSpeechc                      B   e Zd ZU ded< d  fddZeed	d	d	ed
d!ddZ  ZS )"r   SpeechWithRawResponsewith_raw_responseclientr   returnNonec                      t  | t| | _d S N)super__init__r   r   selfr   	__class__ t/var/www/html/Resume-Parser/resume-parser-inhouse/venv/lib/python3.10/site-packages/openai/resources/audio/speech.pyr!         zSpeech.__init__Nresponse_formatspeedextra_headersextra_query
extra_bodytimeoutinputstrmodel(Union[str, Literal['tts-1', 'tts-1-hd']]voice<Literal['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer']r*   0Literal['mp3', 'opus', 'aac', 'flac'] | NotGivenr+   float | NotGivenr,   Headers | Noner-   Query | Noner.   Body | Noner/   'float | httpx.Timeout | None | NotGivenr   c       	   
   	   C  s2   | 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. 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`.

          response_format: The format to audio in. Supported formats are `mp3`, `opus`, `aac`, and `flac`.

          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
        /audio/speechr0   r2   r4   r*   r+   r,   r-   r.   r/   bodyoptionscast_to_postr   r   SpeechCreateParamsr   r   
r#   r0   r2   r4   r*   r+   r,   r-   r.   r/   r&   r&   r'   create   s    )
zSpeech.create)r   r   r   r   r0   r1   r2   r3   r4   r5   r*   r6   r+   r7   r,   r8   r-   r9   r.   r:   r/   r;   r   r   __name__
__module____qualname____annotations__r!   r   rH   __classcell__r&   r&   r$   r'   r         
 
c                      r   )"r   AsyncSpeechWithRawResponser   r   r   r   r   c                   r   r   )r    r!   rQ   r   r"   r$   r&   r'   r!   ]   r(   zAsyncSpeech.__init__Nr)   r0   r1   r2   r3   r4   r5   r*   r6   r+   r7   r,   r8   r-   r9   r.   r:   r/   r;   r   c       	   
   	     s:   | j dt|||||dtjt||||	dtdI dH S )r<   r=   r>   r?   r@   NrD   rG   r&   r&   r'   rH   a   s"   )
zAsyncSpeech.create)r   r   r   r   rI   rJ   r&   r&   r$   r'   r   Z   rP   c                   @     e Zd ZdddZdS )	r   speechr   r   r   c                 C     t |j| _d S r   )r   rH   r#   rS   r&   r&   r'   r!         
zSpeechWithRawResponse.__init__N)rS   r   r   r   rK   rL   rM   r!   r&   r&   r&   r'   r          r   c                   @  rR   )	rQ   rS   r   r   r   c                 C  rT   r   )r   rH   rU   r&   r&   r'   r!      rV   z#AsyncSpeechWithRawResponse.__init__N)rS   r   r   r   rW   r&   r&   r&   r'   rQ      rX   rQ   )#
__future__r   typingr   r   typing_extensionsr   httpx_typesr   r   r	   r
   r   _utilsr   	_resourcer   r   	_responser   r   types.audior   _base_clientr   r   _clientr   r   __all__r   r   r   rQ   r&   r&   r&   r'   <module>   s"   CC