o
    i)                     @   s   d dl Z ddlmZmZ ddlm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 e e jdZG dd dZG dd dZdS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions   )AsyncRawBatchesClientRawBatchesClient)Batch)CancelBatchResponse)CreateBatchResponse)GetBatchResponse)ListBatchesResponse.c                   @      e Zd ZdefddZedefddZdddddd	ej	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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S )BatchesClient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/batches/client.py__init__      zBatchesClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawBatchesClient
        r   r   r   r   r   with_raw_response      	zBatchesClient.with_raw_responseN	page_size
page_tokenorder_byrequest_optionsr!   r"   r#   r$   c                C   s   | j j||||d}|jS )a  
        List the batches for the current user

        Parameters
        ----------
        page_size : typing.Optional[int]
            The maximum number of batches to return. The service may return fewer than
            this value.
            If unspecified, at most 50 batches will be returned.
            The maximum value is 1000; values above 1000 will be coerced to 1000.

        page_token : typing.Optional[str]
            A page token, received from a previous `ListBatches` call.
            Provide this to retrieve the subsequent page.

        order_by : typing.Optional[str]
            Batches can be ordered by creation time or last updated time.
            Use `created_at` for creation time or `updated_at` for last updated time.

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

        Returns
        -------
        ListBatchesResponse
            A successful response.

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

        client = Client(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )
        client.batches.list()
        r    r   listdatar   r!   r"   r#   r$   	_responser   r   r   r&   !   s   -zBatchesClient.listr$   requestc                C      | j j||d}|jS )a  
        Creates and executes a batch from an uploaded dataset of requests

        Parameters
        ----------
        request : Batch

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

        Returns
        -------
        CreateBatchResponse
            A successful response.

        Examples
        --------
        from cohere import Client
        from cohere.batches import Batch

        client = Client(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )
        client.batches.create(
            request=Batch(
                name="name",
                input_dataset_id="input_dataset_id",
                model="model",
            ),
        )
        r+   r$   r   creater'   r   r+   r$   r)   r   r   r   r/   S   s   !zBatchesClient.createidc                C   r,   )a.  
        Retrieves a batch

        Parameters
        ----------
        id : str
            The batch ID.

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

        Returns
        -------
        GetBatchResponse
            A successful response.

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

        client = Client(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )
        client.batches.retrieve(
            id="id",
        )
        r*   r   retriever'   r   r1   r$   r)   r   r   r   r3   w      zBatchesClient.retrievec                C   r,   )a:  
        Cancels an in-progress batch

        Parameters
        ----------
        id : str
            The batch ID.

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

        Returns
        -------
        CancelBatchResponse
            A successful response.

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

        client = Client(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )
        client.batches.cancel(
            id="id",
        )
        r*   r   cancelr'   r4   r   r   r   r7      r5   zBatchesClient.cancel)__name__
__module____qualname__r   r   propertyr   r   typingOptionalintstrr   r   r&   r	   r   r/   r   r3   r
   r7   r   r   r   r   r      s,    
"2"$& r   c                   @   r   )AsyncBatchesClientr   c                C   r   r   )r   r   r   r   r   r   r      r   zAsyncBatchesClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawBatchesClient
        r   r   r   r   r   r      r   z$AsyncBatchesClient.with_raw_responseNr    r!   r"   r#   r$   c                   s"   | j j||||dI dH }|jS )a  
        List the batches for the current user

        Parameters
        ----------
        page_size : typing.Optional[int]
            The maximum number of batches to return. The service may return fewer than
            this value.
            If unspecified, at most 50 batches will be returned.
            The maximum value is 1000; values above 1000 will be coerced to 1000.

        page_token : typing.Optional[str]
            A page token, received from a previous `ListBatches` call.
            Provide this to retrieve the subsequent page.

        order_by : typing.Optional[str]
            Batches can be ordered by creation time or last updated time.
            Use `created_at` for creation time or `updated_at` for last updated time.

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

        Returns
        -------
        ListBatchesResponse
            A successful response.

        Examples
        --------
        import asyncio

        from cohere import AsyncClient

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


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


        asyncio.run(main())
        r    Nr%   r(   r   r   r   r&      s
   5zAsyncBatchesClient.listr*   r+   c                      | j j||dI dH }|jS )a  
        Creates and executes a batch from an uploaded dataset of requests

        Parameters
        ----------
        request : Batch

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

        Returns
        -------
        CreateBatchResponse
            A successful response.

        Examples
        --------
        import asyncio

        from cohere import AsyncClient
        from cohere.batches import Batch

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


        async def main() -> None:
            await client.batches.create(
                request=Batch(
                    name="name",
                    input_dataset_id="input_dataset_id",
                    model="model",
                ),
            )


        asyncio.run(main())
        r-   Nr.   r0   r   r   r   r/     s   +zAsyncBatchesClient.creater1   c                   rA   )a  
        Retrieves a batch

        Parameters
        ----------
        id : str
            The batch ID.

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

        Returns
        -------
        GetBatchResponse
            A successful response.

        Examples
        --------
        import asyncio

        from cohere import AsyncClient

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


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


        asyncio.run(main())
        r*   Nr2   r4   r   r   r   r3   /     %zAsyncBatchesClient.retrievec                   rA   )a  
        Cancels an in-progress batch

        Parameters
        ----------
        id : str
            The batch ID.

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

        Returns
        -------
        CancelBatchResponse
            A successful response.

        Examples
        --------
        import asyncio

        from cohere import AsyncClient

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


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


        asyncio.run(main())
        r*   Nr6   r4   r   r   r   r7   W  rB   zAsyncBatchesClient.cancel)r8   r9   r:   r   r   r;   r   r   r<   r=   r>   r?   r   r   r&   r	   r   r/   r   r3   r
   r7   r   r   r   r   r@      s:    
;
".&(r@   )r<   core.client_wrapperr   r   core.request_optionsr   
raw_clientr   r   types.batchr	   types.cancel_batch_responser
   types.create_batch_responser   types.get_batch_responser   types.list_batches_responser   castAnyOMITr   r@   r   r   r   r   <module>   s    '