o
    iH                     @   sx   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mZ G d
d dZG dd dZdS )    N   )AsyncClientWrapperSyncClientWrapper)RequestOptions)CompatibleEndpoint)GetModelResponse)ListModelsResponse   )AsyncRawModelsClientRawModelsClientc                   @      e Zd ZdefddZ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ddde	j
e de	j
e de	j
e de	j
e d
e	j
e defddZdS )ModelsClientclient_wrapperc                C      t |d| _d S N)r   )r   _raw_clientselfr    r   Z/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/cohere/models/client.py__init__      zModelsClient.__init__returnc                 C      | j S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawModelsClient
        r   r   r   r   r   with_raw_response      	zModelsClient.with_raw_responseNrequest_optionsmodelr   c                C   s   | j j||d}|jS )a0  
        Returns the details of a model, provided its name.

        Parameters
        ----------
        model : str

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

        Returns
        -------
        GetModelResponse
            OK

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

        client = Client(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )
        client.models.get(
            model="command-a-03-2025",
        )
        r   r   getdatar   r    r   	_responser   r   r   r"      s   zModelsClient.get	page_size
page_tokenendpointdefault_onlyr   r'   r(   r)   r*   c                C   s   | j j|||||d}|jS )a  
        Returns a list of models available for use.

        Parameters
        ----------
        page_size : typing.Optional[float]
            Maximum number of models to include in a page
            Defaults to `20`, min value of `1`, max value of `1000`.

        page_token : typing.Optional[str]
            Page token provided in the `next_page_token` field of a previous response.

        endpoint : typing.Optional[CompatibleEndpoint]
            When provided, filters the list of models to only those that are compatible with the specified endpoint.

        default_only : typing.Optional[bool]
            When provided, filters the list of models to only the default model to the endpoint. This parameter is only valid when `endpoint` is provided.

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

        Returns
        -------
        ListModelsResponse
            OK

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

        client = Client(
            client_name="YOUR_CLIENT_NAME",
            token="YOUR_TOKEN",
        )
        client.models.list()
        r&   r   listr#   r   r'   r(   r)   r*   r   r%   r   r   r   r,   ;   s   -zModelsClient.list)__name__
__module____qualname__r   r   propertyr   r   strtypingOptionalr   r   r"   floatr   boolr   r,   r   r   r   r   r      s.    "
"r   c                   @   r   )AsyncModelsClientr   c                C   r   r   )r
   r   r   r   r   r   r   s   r   zAsyncModelsClient.__init__r   c                 C   r   )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawModelsClient
        r   r   r   r   r   r   v   r   z#AsyncModelsClient.with_raw_responseNr   r    r   c                   s   | j j||dI dH }|jS )a  
        Returns the details of a model, provided its name.

        Parameters
        ----------
        model : str

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

        Returns
        -------
        GetModelResponse
            OK

        Examples
        --------
        import asyncio

        from cohere import AsyncClient

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


        async def main() -> None:
            await client.models.get(
                model="command-a-03-2025",
            )


        asyncio.run(main())
        r   Nr!   r$   r   r   r   r"      s   $zAsyncModelsClient.getr&   r'   r(   r)   r*   c                   s$   | j j|||||dI dH }|jS )a  
        Returns a list of models available for use.

        Parameters
        ----------
        page_size : typing.Optional[float]
            Maximum number of models to include in a page
            Defaults to `20`, min value of `1`, max value of `1000`.

        page_token : typing.Optional[str]
            Page token provided in the `next_page_token` field of a previous response.

        endpoint : typing.Optional[CompatibleEndpoint]
            When provided, filters the list of models to only those that are compatible with the specified endpoint.

        default_only : typing.Optional[bool]
            When provided, filters the list of models to only the default model to the endpoint. This parameter is only valid when `endpoint` is provided.

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

        Returns
        -------
        ListModelsResponse
            OK

        Examples
        --------
        import asyncio

        from cohere import AsyncClient

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


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


        asyncio.run(main())
        r&   Nr+   r-   r   r   r   r,      s   5zAsyncModelsClient.list)r.   r/   r0   r   r   r1   r
   r   r2   r3   r4   r   r   r"   r5   r   r6   r   r,   r   r   r   r   r7   r   s.    "
*r7   )r3   core.client_wrapperr   r   core.request_optionsr   types.compatible_endpointr   types.get_model_responser   types.list_models_responser   
raw_clientr
   r   r   r7   r   r   r   r   <module>   s   e