o
    h(                     @  s(  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 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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                
   @  H   e Zd Zed ddZed!ddZeeeeeddded		d"ddZdS )#r   returnTranslationsWithRawResponsec                 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%   u/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/groq/resources/audio/translations.pywith_raw_response!      zTranslations.with_raw_response!TranslationsWithStreamingResponsec                 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$Translations.with_streaming_responseN	filepromptresponse_formattemperatureurlextra_headersextra_query
extra_bodytimeoutmodel'Union[str, Literal['whisper-large-v3']]r.   FileTypes | NotGivenr/   str | NotGivenr0   2Literal['json', 'text', 'verbose_json'] | NotGivenr1   float | NotGivenr2   r3   Headers | Noner4   Query | Noner5   Body | Noner6   'float | httpx.Timeout | None | NotGivenr   c       
      
   C  sl   t ||||||d}tttttf |dggd}ddi|p i }| jdt|tj	|t
|||	|
dtdS )	  Translates audio into English.

        Args:
          model: ID of the model to use.

        Only `whisper-large-v3` is currently available.

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

          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.

          url: The audio URL to translate/transcribe (supports Base64URL). Either file or url
              must be provided. When using the Batch API only url is supported.

          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
        r7   r.   r/   r0   r1   r2   r.   pathsContent-Typemultipart/form-data/openai/v1/audio/translationsr3   r4   r5   r6   bodyfilesoptionscast_to)r   r   r   r   strobject_postr   r   TranslationCreateParamsr   r   r$   r7   r.   r/   r0   r1   r2   r3   r4   r5   r6   rJ   rK   r%   r%   r&   create4   s(   2

zTranslations.create)r   r    )r   r)   r7   r8   r.   r9   r/   r:   r0   r;   r1   r<   r2   r:   r3   r=   r4   r>   r5   r?   r6   r@   r   r   __name__
__module____qualname__r   r'   r+   r   rS   r%   r%   r%   r&   r           	c                
   @  r   )#r   r    AsyncTranslationsWithRawResponsec                 C  r!   r"   )rZ   r#   r%   r%   r&   r'      r(   z#AsyncTranslations.with_raw_response&AsyncTranslationsWithStreamingResponsec                 C  r!   r*   )r[   r#   r%   r%   r&   r+      r,   z)AsyncTranslations.with_streaming_responseNr-   r7   r8   r.   r9   r/   r:   r0   r;   r1   r<   r2   r3   r=   r4   r>   r5   r?   r6   r@   r   c       
      
     sz   t ||||||d}tttttf |dggd}ddi|p!i }| jdt|tj	I dH |t
|||	|
dtd	I dH S )
rA   rB   r.   rC   rE   rF   rG   NrH   rI   )r   r   r   r   rN   rO   rP   r   r   rQ   r   r   rR   r%   r%   r&   rS      s*   2
zAsyncTranslations.create)r   rZ   )r   r[   rT   rU   r%   r%   r%   r&   r      rY   c                   @     e Zd ZdddZdS )	r    translationsr   r   Nonec                 C     || _ t|j| _d S N)_translationsr   rS   r$   r]   r%   r%   r&   __init__      
z$TranslationsWithRawResponse.__init__Nr]   r   r   r^   rV   rW   rX   rc   r%   r%   r%   r&   r           r    c                   @  r\   )	rZ   r]   r   r   r^   c                 C  r_   r`   )ra   r   rS   rb   r%   r%   r&   rc      rd   z)AsyncTranslationsWithRawResponse.__init__Nr]   r   r   r^   rf   r%   r%   r%   r&   rZ      rg   rZ   c                   @  r\   )	r)   r]   r   r   r^   c                 C  r_   r`   )ra   r   rS   rb   r%   r%   r&   rc      rd   z*TranslationsWithStreamingResponse.__init__Nre   rf   r%   r%   r%   r&   r)      rg   r)   c                   @  r\   )	r[   r]   r   r   r^   c                 C  r_   r`   )ra   r   rS   rb   r%   r%   r&   rc      rd   z/AsyncTranslationsWithStreamingResponse.__init__Nrh   rf   r%   r%   r%   r&   r[      rg   r[   ),
__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    rZ   r)   r[   r%   r%   r%   r&   <module>   s&    ``			