o
    ưi                     @   s2   d dl mZmZmZ ddlmZ G dd dZdS )    )OptionalDictAny   )
HTTPClientc                   @   sT   e Zd ZdZddedee defddZd	eee	f fd
dZ
d	ee fddZdS )HealthManagementClientzW
    Client for interacting with the health endpoints of the LiteLLM proxy server.
    N   base_urlapi_keytimeoutc                 C   s   t |||d| _dS )aa  
        Initialize the HealthManagementClient.

        Args:
            base_url (str): The base URL of the LiteLLM proxy server (e.g., "http://localhost:4000")
            api_key (Optional[str]): API key for authentication. If provided, it will be sent as a Bearer token.
            timeout (int): Request timeout in seconds (default: 30)
        )r	   r
   r   N)r   _http)selfr	   r
   r    r   R/home/app/Keep/.python/lib/python3.10/site-packages/litellm/proxy/client/health.py__init__   s   	zHealthManagementClient.__init__returnc                 C   s   | j ddS )a4  
        Check the readiness of the LiteLLM proxy server.

        Returns:
            Dict[str, Any]: The readiness status and details from the server.

        Raises:
            requests.exceptions.RequestException: If the request fails
            ValueError: If the response is not valid JSON
        GETz/health/readiness)r   request)r   r   r   r   get_readiness   s   z$HealthManagementClient.get_readinessc                 C   s   |   }|dS )z
        Get the LiteLLM server version from the readiness endpoint.

        Returns:
            Optional[str]: The server version if available, otherwise None.
        Zlitellm_version)r   get)r   Z	readinessr   r   r   get_server_version    s   
z)HealthManagementClient.get_server_version)Nr   )__name__
__module____qualname____doc__strr   intr   r   r   r   r   r   r   r   r   r      s
    r   N)typingr   r   r   http_clientr   r   r   r   r   r   <module>   s    