
    g&                    L   d dl mZ d dlmZ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mZ ddl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mZmZ ddl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)UnionMappingcast)LiteralN   )	NOT_GIVENBodyQueryHeadersNotGiven	FileTypes)extract_filesmaybe_transformdeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperto_streamed_response_wrapperasync_to_raw_response_wrapper"async_to_streamed_response_wrapper)translation_create_params)make_request_options)TranslationTranslationsAsyncTranslationsc                  p    e Zd Zedd       Zedd       Ze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
        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
        )TranslationsWithRawResponseselfs    V/var/www/openai/venv/lib/python3.12/site-packages/groq/resources/audio/translations.pywith_raw_responsezTranslations.with_raw_response!   s     +400    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
        )!TranslationsWithStreamingResponser#   s    r%   with_streaming_responsez$Translations.with_streaming_response+   s     166r'   Npromptresponse_formattemperatureextra_headersextra_query
extra_bodytimeoutc       	        
   t        |||||d      }
t        t        t        t        t
        f   |
      dgg      }ddi|xs i }| j                  dt        |
t        j                        |t        ||||	      t              S )	I  
        Translates audio into English.

        Args:
          file: The audio file object (not file name) translate, in one of these formats: flac,
              mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

          model: ID of the model to use. Only `whisper-large-v3` is currently available.

          prompt: An optional text to guide the model's style or continue a previous audio
              segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in
              English.

          response_format: The format of the transcript output, in one of these options: `json`, `text`, or
              `verbose_json`.

          temperature: The sampling temperature, between 0 and 1. Higher values like 0.8 will make the
              output more random, while lower values like 0.2 will make it more focused and
              deterministic. If set to 0, the model will use
              [log probability](https://en.wikipedia.org/wiki/Log_probability) to
              automatically increase the temperature until certain thresholds are hit.

          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
        filemodelr-   r.   r/   r7   pathsContent-Typemultipart/form-data/openai/v1/audio/translationsr0   r1   r2   r3   bodyfilesoptionscast_to)r   r   r   r   strobject_postr   r   TranslationCreateParamsr   r   r$   r7   r8   r-   r.   r/   r0   r1   r2   r3   r@   rA   s               r%   createzTranslations.create4   s    Z   #2*
 d73;#7>xjQ ()>X=CVTVXzz+ '@'X'XY(+Q[el    
 	
r'   )returnr"   )rJ   r*   r7   r   r8   z'Union[str, Literal['whisper-large-v3']]r-   zstr | NotGivenr.   z2Literal['json', 'text', 'verbose_json'] | NotGivenr/   zfloat | NotGivenr0   zHeaders | Noner1   zQuery | Noner2   zBody | Noner3   z'float | httpx.Timeout | None | NotGivenrJ   r   __name__
__module____qualname__r   r&   r+   r	   rI    r'   r%   r   r       s    1 1 7 7 "+NW(1 )-$("&;DC
 C
 7	C

 C
 LC
 &C
 &C
 "C
  C
 9C
 
C
r'   c                  p    e Zd Zedd       Zedd       Zeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)	r   c                    t        |       S r!   ) AsyncTranslationsWithRawResponser#   s    r%   r&   z#AsyncTranslations.with_raw_response{   s     055r'   c                    t        |       S r)   )&AsyncTranslationsWithStreamingResponser#   s    r%   r+   z)AsyncTranslations.with_streaming_response   s     6d;;r'   Nr,   c       	        :  K   t        |||||d      }
t        t        t        t        t
        f   |
      dgg      }ddi|xs i }| j                  dt        |
t        j                         d{   |t        ||||	      t        	       d{   S 7 %7 w)
r5   r6   r7   r9   r;   r<   r=   Nr>   r?   )r   r   r   r   rD   rE   rF   r   r   rG   r   r   rH   s               r%   rI   zAsyncTranslations.create   s     Z   #2*
 d73;#7>xjQ ()>X=CVTVXZZ+,T3L3d3dee(+Q[el     
 
 	
e
s$   A/B1B
2 BBBB)rJ   rS   )rJ   rU   rK   rL   rP   r'   r%   r   r   z   s    6 6 < < "+NW(1 )-$("&;DC
 C
 7	C

 C
 LC
 &C
 &C
 "C
  C
 9C
 
C
r'   c                      e Zd ZddZy)r"   c                F    || _         t        |j                        | _        y N)_translationsr   rI   r$   translationss     r%   __init__z$TranslationsWithRawResponse.__init__   s    )-
r'   Nr\   r   rJ   NonerM   rN   rO   r]   rP   r'   r%   r"   r"          
r'   r"   c                      e Zd ZddZy)rS   c                F    || _         t        |j                        | _        y rY   )rZ   r   rI   r[   s     r%   r]   z)AsyncTranslationsWithRawResponse.__init__   s    )3
r'   Nr\   r   rJ   r_   r`   rP   r'   r%   rS   rS      ra   r'   rS   c                      e Zd ZddZy)r*   c                F    || _         t        |j                        | _        y rY   )rZ   r   rI   r[   s     r%   r]   z*TranslationsWithStreamingResponse.__init__   s    )2
r'   Nr^   r`   rP   r'   r%   r*   r*      ra   r'   r*   c                      e Zd ZddZy)rU   c                F    || _         t        |j                        | _        y rY   )rZ   r   rI   r[   s     r%   r]   z/AsyncTranslationsWithStreamingResponse.__init__   s    )8
r'   Nrd   r`   rP   r'   r%   rU   rU      ra   r'   rU   ),
__future__r   typingr   r   r   typing_extensionsr   httpx_typesr	   r
   r   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer   r   	_responser   r   r   r   types.audior   _base_clientr   types.audio.translationr   __all__r   r   r"   rS   r*   rU   rP   r'   r%   <module>rv      s    # ' ' %  J J  ' :  5 0 2.
/W
? W
tW
( W
t
 

 

 

 
r'   