o
    i%8                     @   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mZ d
dlmZ e e jdZG dd dZG dd dZdS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)CreateEmbedJobResponse)EmbedInputType)EmbedJob)EmbeddingType)ListEmbedJobResponse   )AsyncRawEmbedJobsClientRawEmbedJobsClient)CreateEmbedJobRequestTruncate.c                   @      e Zd ZdefddZedefddZddd	ej	e
 defd
dZeeedddedededej	e dej	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ed	ej	e
 ddfddZdS )EmbedJobsClientclient_wrapperc                C      t |d| _d S N)r   )r   _raw_clientselfr    r   ^/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/cohere/embed_jobs/client.py__init__      zEmbedJobsClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawEmbedJobsClient
        r   r   r   r   r   with_raw_response      	z!EmbedJobsClient.with_raw_responseNrequest_optionsr"   c                C   s   | j j|d}|jS )a!  
        The list embed job endpoint allows users to view all embed jobs history for that specific user.

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

        Returns
        -------
        ListEmbedJobResponse
            OK

        Examples
        --------
        from cohere import Client

        client = Client(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )
        client.embed_jobs.list()
        r!   r   listdatar   r"   	_responser   r   r   r$   "   s   zEmbedJobsClient.listnameembedding_typestruncater"   model
dataset_id
input_typer)   r*   r+   c          	   	   C   s    | j j|||||||d}|jS )a
  
        This API launches an async Embed job for a [Dataset](https://docs.cohere.com/docs/datasets) of type `embed-input`. The result of a completed embed job is new Dataset of type `embed-output`, which contains the original text entries and the corresponding embeddings.

        Parameters
        ----------
        model : str
            ID of the embedding model.

            Available models and corresponding embedding dimensions:

            - `embed-english-v3.0` : 1024
            - `embed-multilingual-v3.0` : 1024
            - `embed-english-light-v3.0` : 384
            - `embed-multilingual-light-v3.0` : 384

        dataset_id : str
            ID of a [Dataset](https://docs.cohere.com/docs/datasets). The Dataset must be of type `embed-input` and must have a validation status `Validated`

        input_type : EmbedInputType

        name : typing.Optional[str]
            The name of the embed job.

        embedding_types : typing.Optional[typing.Sequence[EmbeddingType]]
            Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.

            * `"float"`: Use this when you want to get back the default float embeddings. Valid for all models.
            * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for v3 and newer model versions.
            * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for v3 and newer model versions.
            * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for v3 and newer model versions.
            * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for v3 and newer model versions.

        truncate : typing.Optional[CreateEmbedJobRequestTruncate]
            One of `START|END` to specify how the API will handle inputs longer than the maximum token length.

            Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.

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

        Returns
        -------
        CreateEmbedJobResponse
            OK

        Examples
        --------
        from cohere import Client

        client = Client(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )
        client.embed_jobs.create(
            model="model",
            dataset_id="dataset_id",
            input_type="search_document",
        )
        r,   r-   r.   r)   r*   r+   r"   r   creater%   	r   r,   r-   r.   r)   r*   r+   r"   r'   r   r   r   r1   =   s   F	zEmbedJobsClient.createidc                C      | j j||d}|jS )aa  
        This API retrieves the details about an embed job started by the same user.

        Parameters
        ----------
        id : str
            The ID of the embed job to retrieve.

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

        Returns
        -------
        EmbedJob
            OK

        Examples
        --------
        from cohere import Client

        client = Client(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )
        client.embed_jobs.get(
            id="id",
        )
        r!   r   getr%   r   r3   r"   r'   r   r   r   r6      s   zEmbedJobsClient.getc                C   r4   )a$  
        This API allows users to cancel an active embed job. Once invoked, the embedding process will be terminated, and users will be charged for the embeddings processed up to the cancellation point. It's important to note that partial results will not be available to users after cancellation.

        Parameters
        ----------
        id : str
            The ID of the embed job to cancel.

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

        Returns
        -------
        None

        Examples
        --------
        from cohere import Client

        client = Client(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )
        client.embed_jobs.cancel(
            id="id",
        )
        r!   r   cancelr%   r7   r   r   r   r9      s   zEmbedJobsClient.cancel)__name__
__module____qualname__r   r   propertyr   r   typingOptionalr   r
   r$   OMITstrr   Sequencer	   r   r   r1   r   r6   r9   r   r   r   r   r      s8    
!	

"Q& r   c                   @   r   )AsyncEmbedJobsClientr   c                C   r   r   )r   r   r   r   r   r   r      r   zAsyncEmbedJobsClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawEmbedJobsClient
        r   r   r   r   r   r      r    z&AsyncEmbedJobsClient.with_raw_responseNr!   r"   c                   s   | j j|dI dH }|jS )a  
        The list embed job endpoint allows users to view all embed jobs history for that specific user.

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

        Returns
        -------
        ListEmbedJobResponse
            OK

        Examples
        --------
        import asyncio

        from cohere import AsyncClient

        client = AsyncClient(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.embed_jobs.list()


        asyncio.run(main())
        r!   Nr#   r&   r   r   r   r$      s    zAsyncEmbedJobsClient.listr(   r,   r-   r.   r)   r*   r+   c          	   	      s(   | j j|||||||dI dH }|jS )a*  
        This API launches an async Embed job for a [Dataset](https://docs.cohere.com/docs/datasets) of type `embed-input`. The result of a completed embed job is new Dataset of type `embed-output`, which contains the original text entries and the corresponding embeddings.

        Parameters
        ----------
        model : str
            ID of the embedding model.

            Available models and corresponding embedding dimensions:

            - `embed-english-v3.0` : 1024
            - `embed-multilingual-v3.0` : 1024
            - `embed-english-light-v3.0` : 384
            - `embed-multilingual-light-v3.0` : 384

        dataset_id : str
            ID of a [Dataset](https://docs.cohere.com/docs/datasets). The Dataset must be of type `embed-input` and must have a validation status `Validated`

        input_type : EmbedInputType

        name : typing.Optional[str]
            The name of the embed job.

        embedding_types : typing.Optional[typing.Sequence[EmbeddingType]]
            Specifies the types of embeddings you want to get back. Not required and default is None, which returns the Embed Floats response type. Can be one or more of the following types.

            * `"float"`: Use this when you want to get back the default float embeddings. Valid for all models.
            * `"int8"`: Use this when you want to get back signed int8 embeddings. Valid for v3 and newer model versions.
            * `"uint8"`: Use this when you want to get back unsigned int8 embeddings. Valid for v3 and newer model versions.
            * `"binary"`: Use this when you want to get back signed binary embeddings. Valid for v3 and newer model versions.
            * `"ubinary"`: Use this when you want to get back unsigned binary embeddings. Valid for v3 and newer model versions.

        truncate : typing.Optional[CreateEmbedJobRequestTruncate]
            One of `START|END` to specify how the API will handle inputs longer than the maximum token length.

            Passing `START` will discard the start of the input. `END` will discard the end of the input. In both cases, input is discarded until the remaining input is exactly the maximum input token length for the model.

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

        Returns
        -------
        CreateEmbedJobResponse
            OK

        Examples
        --------
        import asyncio

        from cohere import AsyncClient

        client = AsyncClient(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.embed_jobs.create(
                model="model",
                dataset_id="dataset_id",
                input_type="search_document",
            )


        asyncio.run(main())
        r/   Nr0   r2   r   r   r   r1      s   N	zAsyncEmbedJobsClient.creater3   c                      | j j||dI dH }|jS )a  
        This API retrieves the details about an embed job started by the same user.

        Parameters
        ----------
        id : str
            The ID of the embed job to retrieve.

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

        Returns
        -------
        EmbedJob
            OK

        Examples
        --------
        import asyncio

        from cohere import AsyncClient

        client = AsyncClient(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.embed_jobs.get(
                id="id",
            )


        asyncio.run(main())
        r!   Nr5   r7   r   r   r   r6   Y  s   %zAsyncEmbedJobsClient.getc                   rD   )a  
        This API allows users to cancel an active embed job. Once invoked, the embedding process will be terminated, and users will be charged for the embeddings processed up to the cancellation point. It's important to note that partial results will not be available to users after cancellation.

        Parameters
        ----------
        id : str
            The ID of the embed job to cancel.

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from cohere import AsyncClient

        client = AsyncClient(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.embed_jobs.cancel(
                id="id",
            )


        asyncio.run(main())
        r!   Nr8   r7   r   r   r   r9     s   $zAsyncEmbedJobsClient.cancel)r:   r;   r<   r   r   r=   r   r   r>   r?   r   r
   r$   r@   rA   r   rB   r	   r   r   r1   r   r6   r9   r   r   r   r   rC      s8    
)	

"Y&(rC   )r>   core.client_wrapperr   r   core.request_optionsr   types.create_embed_job_responser   types.embed_input_typer   types.embed_jobr   types.embedding_typer	   types.list_embed_job_responser
   
raw_clientr   r   'types.create_embed_job_request_truncater   castAnyr@   r   rC   r   r   r   r   <module>   s    <