o
    qmiJ                     @   s   d dl Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZmZ ddlmZmZ e e jdZG dd dZG dd dZdS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)BulkJobCallbackParams)(SpeechToTextTranslateJobParametersParams)BulkJobInitResponseV1)FilesDownloadResponse)FilesUploadResponse)JobStatusV1Response)SpeechToTextTranslateModel   )&AsyncRawSpeechToTextTranslateJobClient!RawSpeechToTextTranslateJobClient)AsyncSpeechToTextTranslateJobSpeechToTextTranslateJob.c                   @   s  e Zd ZdefddZedefddZdeddd	e	d
e
je de
je de
je def
ddZdddede
je defddZdddded
e
je de
je defddZddddede
je d
e
je de
je def
ddZddddede
je d
e
je de
je def
ddZddddedfdedede
je d e
je de
je de
je defd!d"Zdedefd#d$ZdS )%SpeechToTextTranslateJobClientclient_wrapperc                C      t |d| _d S N)r   )r   _raw_clientselfr    r   `/home/ubuntu/.local/lib/python3.10/site-packages/sarvamai/speech_to_text_translate_job/client.py__init__      z'SpeechToTextTranslateJobClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawSpeechToTextTranslateJobClient
        r   r   r   r   r   with_raw_response      	z0SpeechToTextTranslateJobClient.with_raw_responseNptu_idcallbackrequest_optionsjob_parametersr$   r%   r&   c                C      | j j||||d}|jS )aX  
        Get a job uuid, and storage folder details for speech to text tranlsate bulk job v1

        Parameters
        ----------
        job_parameters : SpeechToTextTranslateJobParametersParams
            Job Parameters for the bulk job

        ptu_id : typing.Optional[int]

        callback : typing.Optional[BulkJobCallbackParams]
            Parameters for callback URL

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        BulkJobInitResponseV1
            Successful Response

        Examples
        --------
        from sarvamai import SarvamAI

        client = SarvamAI(
            api_subscription_key="YOUR_API_SUBSCRIPTION_KEY",
        )
        client.speech_to_text_translate_job.initialise(
            job_parameters={},
        )
        r'   r$   r%   r&   r   
initialisedatar   r'   r$   r%   r&   	_responser   r   r   r+   $   s   (z)SpeechToTextTranslateJobClient.initialiser&   job_idc                C   s   | j j||d}|jS )a  
        Get the status of a speech to text translate bulk job V1

        Parameters
        ----------
        job_id : str
            The unique identifier of the job

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        JobStatusV1Response
            Successful Response

        Examples
        --------
        from sarvamai import SarvamAI

        client = SarvamAI(
            api_subscription_key="YOUR_API_SUBSCRIPTION_KEY",
        )
        client.speech_to_text_translate_job.get_status(
            job_id="job_id",
        )
        r/   r   
get_statusr,   r   r0   r&   r.   r   r   r   r2   Q   s   z)SpeechToTextTranslateJobClient.get_statusr$   r&   c                C   s   | j j|||d}|jS )a  
        Start a speech to text translate bulk job V1

        Parameters
        ----------
        job_id : str
            The unique identifier of the job

        ptu_id : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        JobStatusV1Response
            Successful Response

        Examples
        --------
        from sarvamai import SarvamAI

        client = SarvamAI(
            api_subscription_key="YOUR_API_SUBSCRIPTION_KEY",
        )
        client.speech_to_text_translate_job.start(
            job_id="job_id",
        )
        r4   r   startr,   r   r0   r$   r&   r.   r   r   r   r6   r   s   $z$SpeechToTextTranslateJobClient.startfilesc                C   r(   )a  
        Start a speech to text bulk job V1

        Parameters
        ----------
        job_id : str

        files : typing.Sequence[str]

        ptu_id : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        FilesUploadResponse
            Successful Response

        Examples
        --------
        from sarvamai import SarvamAI

        client = SarvamAI(
            api_subscription_key="YOUR_API_SUBSCRIPTION_KEY",
        )
        client.speech_to_text_translate_job.get_upload_links(
            job_id="job_id",
            files=["files"],
        )
        r0   r8   r$   r&   r   get_upload_linksr,   r   r0   r8   r$   r&   r.   r   r   r   r;         'z/SpeechToTextTranslateJobClient.get_upload_linksc                C   r(   )a  
        Start a speech to text bulk job V1

        Parameters
        ----------
        job_id : str

        files : typing.Sequence[str]

        ptu_id : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        FilesDownloadResponse
            Successful Response

        Examples
        --------
        from sarvamai import SarvamAI

        client = SarvamAI(
            api_subscription_key="YOUR_API_SUBSCRIPTION_KEY",
        )
        client.speech_to_text_translate_job.get_download_links(
            job_id="job_id",
            files=["files"],
        )
        r9   r   get_download_linksr,   r<   r   r   r   r?      r=   z1SpeechToTextTranslateJobClient.get_download_linkssaaras:v2.5Fmodelwith_diarizationpromptnum_speakersc                 C   s*   | j t||||d||d}t|j| dS )aZ  
        Create a new Speech-to-Text-Translate bulk job.

        Parameters
        ----------
        model : typing.Optional[SpeechToTextTranslateModel], default="saaras:v2.5"
            The model to use for speech-to-text translation.

        with_diarization : typing.Optional[bool], default=False
            Whether to enable speaker diarization (i.e., distinguishing who is speaking).

        prompt : typing.Optional[str], default=None
            An optional prompt to guide the transcription and translation model.

        num_speakers : typing.Optional[int], default=None
            The number of distinct speakers in the input audio, if known.

        callback : typing.Optional[BulkJobCallbackParams], default=OMIT
            Optional callback configuration to receive job completion events via webhook.

        request_options : typing.Optional[RequestOptions], default=None
            Optional configuration for request timeout, retries, etc.

        Returns
        -------
        SpeechToTextTranslateJob
            A handle to the newly created Speech-to-Text-Translate job.
        rC   rA   rB   rD   r'   r%   r&   r0   client)r+   r   r   r0   r   rA   rB   rC   rD   r%   r&   responser   r   r   
create_job   s   %
z)SpeechToTextTranslateJobClient.create_jobc                 C   s   t || dS )am  
        Get an existing Speech-to-Text-Translate job handle by job ID.

        Parameters
        ----------
        job_id : str
            The job ID of the previously created Speech-to-Text-Translate job.

        Returns
        -------
        SpeechToTextTranslateJob
            A job handle which can be used to check status or retrieve results.
        rG   )r   r   r0   r   r   r   get_job"  s   z&SpeechToTextTranslateJobClient.get_job)__name__
__module____qualname__r   r   propertyr   r!   OMITr   typingOptionalintr   r   r   r+   strr   r2   r6   Sequencer
   r;   r	   r?   r   boolr   rK   rM   r   r   r   r   r      s    
.
%
,
1
.
1r   c                   @   s  e Zd ZdefddZedefddZdeddd	e	d
e
je de
je de
je def
ddZdddede
je defddZdddded
e
je de
je defddZddddede
je d
e
je de
je def
ddZddddede
je d
e
je de
je def
ddZddddedfdedede
je d e
je de
je de
je dd!fd"d#Zdedd!fd$d%ZdS )&#AsyncSpeechToTextTranslateJobClientr   c                C   r   r   )r   r   r   r   r   r   r   5  r   z,AsyncSpeechToTextTranslateJobClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawSpeechToTextTranslateJobClient
        r   r    r   r   r   r!   8  r"   z5AsyncSpeechToTextTranslateJobClient.with_raw_responseNr#   r'   r$   r%   r&   c                   "   | j j||||dI dH }|jS )a  
        Get a job uuid, and storage folder details for speech to text tranlsate bulk job v1

        Parameters
        ----------
        job_parameters : SpeechToTextTranslateJobParametersParams
            Job Parameters for the bulk job

        ptu_id : typing.Optional[int]

        callback : typing.Optional[BulkJobCallbackParams]
            Parameters for callback URL

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        BulkJobInitResponseV1
            Successful Response

        Examples
        --------
        import asyncio

        from sarvamai import AsyncSarvamAI

        client = AsyncSarvamAI(
            api_subscription_key="YOUR_API_SUBSCRIPTION_KEY",
        )


        async def main() -> None:
            await client.speech_to_text_translate_job.initialise(
                job_parameters={},
            )


        asyncio.run(main())
        r)   Nr*   r-   r   r   r   r+   C  s
   0z.AsyncSpeechToTextTranslateJobClient.initialiser/   r0   c                   s   | j j||dI dH }|jS )a  
        Get the status of a speech to text translate bulk job V1

        Parameters
        ----------
        job_id : str
            The unique identifier of the job

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        JobStatusV1Response
            Successful Response

        Examples
        --------
        import asyncio

        from sarvamai import AsyncSarvamAI

        client = AsyncSarvamAI(
            api_subscription_key="YOUR_API_SUBSCRIPTION_KEY",
        )


        async def main() -> None:
            await client.speech_to_text_translate_job.get_status(
                job_id="job_id",
            )


        asyncio.run(main())
        r/   Nr1   r3   r   r   r   r2   x  s   &z.AsyncSpeechToTextTranslateJobClient.get_statusr4   c                   s    | j j|||dI dH }|jS )a  
        Start a speech to text translate bulk job V1

        Parameters
        ----------
        job_id : str
            The unique identifier of the job

        ptu_id : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        JobStatusV1Response
            Successful Response

        Examples
        --------
        import asyncio

        from sarvamai import AsyncSarvamAI

        client = AsyncSarvamAI(
            api_subscription_key="YOUR_API_SUBSCRIPTION_KEY",
        )


        async def main() -> None:
            await client.speech_to_text_translate_job.start(
                job_id="job_id",
            )


        asyncio.run(main())
        r4   Nr5   r7   r   r   r   r6     s   ,z)AsyncSpeechToTextTranslateJobClient.startr8   c                   rZ   )a*  
        Start a speech to text bulk job V1

        Parameters
        ----------
        job_id : str

        files : typing.Sequence[str]

        ptu_id : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        FilesUploadResponse
            Successful Response

        Examples
        --------
        import asyncio

        from sarvamai import AsyncSarvamAI

        client = AsyncSarvamAI(
            api_subscription_key="YOUR_API_SUBSCRIPTION_KEY",
        )


        async def main() -> None:
            await client.speech_to_text_translate_job.get_upload_links(
                job_id="job_id",
                files=["files"],
            )


        asyncio.run(main())
        r9   Nr:   r<   r   r   r   r;     
   /z4AsyncSpeechToTextTranslateJobClient.get_upload_linksc                   rZ   )a.  
        Start a speech to text bulk job V1

        Parameters
        ----------
        job_id : str

        files : typing.Sequence[str]

        ptu_id : typing.Optional[int]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        FilesDownloadResponse
            Successful Response

        Examples
        --------
        import asyncio

        from sarvamai import AsyncSarvamAI

        client = AsyncSarvamAI(
            api_subscription_key="YOUR_API_SUBSCRIPTION_KEY",
        )


        async def main() -> None:
            await client.speech_to_text_translate_job.get_download_links(
                job_id="job_id",
                files=["files"],
            )


        asyncio.run(main())
        r9   Nr>   r<   r   r   r   r?     r[   z6AsyncSpeechToTextTranslateJobClient.get_download_linksr@   FrA   rB   rC   rD   r   c                    s2   | j t||||d||dI dH }t|j| dS )aN  
        Create a new Speech-to-Text-Translate bulk job.

        Parameters
        ----------
        model : typing.Optional[SpeechToTextTranslateModel], default="saaras:v2.5"
            The model to use for speech-to-text translation.
        
        with_diarization : typing.Optional[bool], default=False
            Whether to enable speaker diarization (i.e., distinguishing who is speaking).

        prompt : typing.Optional[str], default=None
            An optional prompt to guide the transcription and translation model.

        num_speakers : typing.Optional[int], default=None
            The number of distinct speakers in the input audio, if known.

        callback : typing.Optional[BulkJobCallbackParams], default=OMIT
            Optional callback configuration to receive job completion events via webhook.

        request_options : typing.Optional[RequestOptions], default=None
            Optional configuration for request timeout, retries, etc.

        Returns
        -------
        AsyncSpeechToTextTranslateJob
            A handle to the newly created job.
        rE   rF   NrG   )r+   r   r   r0   rI   r   r   r   rK   8  s   %
z.AsyncSpeechToTextTranslateJobClient.create_jobc                    s   t || dS )ar  
        Get an existing Speech-to-Text-Translate job handle by job ID.

        Parameters
        ----------
        job_id : str
            The job ID of the previously created speech-to-text-translate job.

        Returns
        -------
        AsyncSpeechToTextTranslateJob
            A job handle which can be used to check status or retrieve results.
        rG   )r   rL   r   r   r   rM   i  s   z+AsyncSpeechToTextTranslateJobClient.get_job)rN   rO   rP   r   r   rQ   r   r!   rR   r   rS   rT   rU   r   r   r   r+   rV   r   r2   r6   rW   r
   r;   r	   r?   r   rX   rK   rM   r   r   r   r   rY   4  s    
6
-
4
9
6
1rY   )rS   core.client_wrapperr   r   core.request_optionsr   requests.bulk_job_callbackr   0requests.speech_to_text_translate_job_parametersr    types.bulk_job_init_response_v_1r   types.files_download_responser	   types.files_upload_responser
   types.job_status_v_1_responser   $types.speech_to_text_translate_modelr   
raw_clientr   r   jobr   r   castAnyrR   r   rY   r   r   r   r   <module>   s"     !