HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/openai/resources/audio/__pycache__/speech.cpython-310.pyc
o

���g#�@s ddlmZddlmZddlmZddlZddlmZddl	m
Z
mZmZm
Z
mZddlmZmZdd	lmZdd
lmZmZddlmZmZmZmZddlmZdd
lmZddl m!Z!ddgZ"Gdd�de�Z#Gdd�de�Z$Gdd�d�Z%Gdd�d�Z&Gdd�d�Z'Gdd�d�Z(dS)�)�annotations)�Union)�LiteralN�)�_legacy_response)�	NOT_GIVEN�Body�Query�Headers�NotGiven)�maybe_transform�async_maybe_transform)�cached_property)�SyncAPIResource�AsyncAPIResource)�StreamedBinaryAPIResponse�AsyncStreamedBinaryAPIResponse�#to_custom_streamed_response_wrapper�)async_to_custom_streamed_response_wrapper)�speech_create_params)�make_request_options)�SpeechModel�Speech�AsyncSpeechc@�BeZdZeddd��Zed dd��Zeeddded	�d!dd�ZdS)"r�return�SpeechWithRawResponsecC�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/openai/openai-python#accessing-raw-response-data-eg-headers
        )r��self�r!�H/usr/local/lib/python3.10/dist-packages/openai/resources/audio/speech.py�with_raw_response �zSpeech.with_raw_response�SpeechWithStreamingResponsecCr�z�
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )r%rr!r!r"�with_streaming_response*�zSpeech.with_streaming_responseN��response_format�speed�
extra_headers�extra_query�
extra_body�timeout�input�str�model�Union[str, SpeechModel]�voice�TLiteral['alloy', 'ash', 'coral', 'echo', 'fable', 'onyx', 'nova', 'sage', 'shimmer']r*�>Literal['mp3', 'opus', 'aac', 'flac', 'wav', 'pcm'] | NotGivenr+�float | NotGivenr,�Headers | Noner-�Query | Noner.�Body | Noner/�'float | httpx.Timeout | None | NotGiven�+_legacy_response.HttpxBinaryResponseContentc	
	CsDddi|pi�}|jdt|||||d�tj�t||||	d�tjd�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`, `ash`,
              `coral`, `echo`, `fable`, `onyx`, `nova`, `sage` and `shimmer`. Previews of the
              voices are available in the
              [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).

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

          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
        �Accept�application/octet-stream�
/audio/speech�r0r2r4r*r+�r,r-r.r/��body�options�cast_to)�_postrr�SpeechCreateParamsrr�HttpxBinaryResponseContent�
r r0r2r4r*r+r,r-r.r/r!r!r"�create3s",��
��z
Speech.create)rr)rr%�r0r1r2r3r4r5r*r6r+r7r,r8r-r9r.r:r/r;rr<��__name__�
__module__�__qualname__rr#r'rrKr!r!r!r"r�	�c@r)"rr�AsyncSpeechWithRawResponsecCrr)rRrr!r!r"r#tr$zAsyncSpeech.with_raw_response� AsyncSpeechWithStreamingResponsecCrr&)rSrr!r!r"r'~r(z#AsyncSpeech.with_streaming_responseNr)r0r1r2r3r4r5r*r6r+r7r,r8r-r9r.r:r/r;r<c	
	�sR�ddi|pi�}|jdt|||||d�tj�IdHt||||	d�tjd�IdHS)r=r>r?r@rANrBrC)rGr
rrHrrrIrJr!r!r"rK�s$�,��
��zAsyncSpeech.create)rrR)rrSrLrMr!r!r!r"rsrQc@�eZdZddd�ZdS)	r�speechrr�NonecC�||_t�|j�|_dS�N)�_speechr�to_raw_response_wrapperrK�r rUr!r!r"�__init__��
�zSpeechWithRawResponse.__init__N�rUrrrV�rNrOrPr\r!r!r!r"r��rc@rT)	rRrUrrrVcCrWrX)rYr�async_to_raw_response_wrapperrKr[r!r!r"r\�r]z#AsyncSpeechWithRawResponse.__init__N�rUrrrVr_r!r!r!r"rR�r`rRc@rT)	r%rUrrrVcC�||_t|jt�|_dSrX)rYrrKrr[r!r!r"r\��

�z$SpeechWithStreamingResponse.__init__Nr^r_r!r!r!r"r%�r`r%c@rT)	rSrUrrrVcCrcrX)rYrrKrr[r!r!r"r\�rdz)AsyncSpeechWithStreamingResponse.__init__Nrbr_r!r!r!r"rS�r`rS))�
__future__r�typingr�typing_extensionsr�httpx�r�_typesrrr	r
r�_utilsrr
�_compatr�	_resourcerr�	_responserrrr�types.audior�_base_clientr�types.audio.speech_modelr�__all__rrrrRr%rSr!r!r!r"�<module>s(TT