Ë
    tPêjs	  ã                   ó<   — d dl mZmZ d dlZddlmZ  G d„ d«      Zy)é    )ÚAnyÚFinalNé   )ÚUnauthorizedErrorc                   óz   — e Zd Zd
dededz  defd„Zdeeef   fd„Zddede	eee
f      ej                  z  fd	„Zy)ÚModelGroupsManagementClientNÚbase_urlÚapi_keyÚtimeoutc                 óL   — |j                  d«      | _        || _        || _        y)af  
        Initialize the ModelGroupsManagementClient.

        Args:
            base_url (str): The base URL of the LiteLLM proxy server (e.g., "http://localhost:8000")
            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)
        ú/N)ÚrstripÚ	_base_urlÚ_api_keyÚ_timeout)Úselfr	   r
   r   s       úf/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/proxy/client/model_groups.pyÚ__init__z$ModelGroupsManagementClient.__init__	   s"   € ð "Ÿ™¨Ó-ˆŒØˆŒØˆ�ó    Úreturnc                 óF   — i }| j                   rd| j                   › �|d<   |S )z¬
        Get the headers for API requests, including authorization if api_key is set.

        Returns:
            Dict[str, str]: Headers to use for API requests
        zBearer ÚAuthorization)r   )r   Úheaderss     r   Ú_get_headersz(ModelGroupsManagementClient._get_headers   s*   € ð ˆØ�=Š=Ø)0°·±°Ð'@ˆG�OÑ$Øˆr   Úreturn_requestc                 óÎ  — | j                   › d�}t        j                  d|| j                  «       ¬«      }|r|S t        j                  «       }	 |j                  |j                  «       | j                  ¬«      }|j                  «        |j                  «       d   S # t        j                  j                  $ r*}|j                  j                  dk(  rt        |«      ‚‚ d}~ww xY w)aG  
        Get detailed information about all model groups from the server.

        Args:
            return_request (bool): If True, returns the prepared request object instead of executing it

        Returns:
            Union[List[Dict[str, Any]], requests.Request]: Either a list of model group information dictionaries
            or a prepared request object if return_request is True

        Raises:
            UnauthorizedError: If the request fails with a 401 status code
            requests.exceptions.RequestException: If the request fails with any other error
        z/model_group/infoÚGET)r   )r   Údatai‘  N)r   ÚrequestsÚRequestr   ÚSessionÚsendÚpreparer   Úraise_for_statusÚjsonÚ
exceptionsÚ	HTTPErrorÚresponseÚstatus_coder   )r   r   ÚurlÚrequestÚsessionr(   Úes          r   Úinfoz ModelGroupsManagementClient.info"   sÆ   € ð Ÿ™Ð'Ð'8Ð9ˆÜ!×)Ñ)¨%°¸d×>OÑ>OÓ>QÔRˆáØˆNô "×)Ñ)Ó+ˆð	Ø%Ÿl™l¨7¯?©?Ó+<ÀdÇmÁm˜lÓTˆHØ×%Ñ%Ô'Ø—=‘=“? 6Ñ*Ð*øÜ×"Ñ"×,Ñ,ò 	Ø�z‰z×%Ñ%¨Ò,Ü'¨Ó*Ð*Øûð	ús   ÁAB ÂC$Â:%CÃC$)Né   )F)Ú__name__Ú
__module__Ú__qualname__ÚstrÚintr   Údictr   ÚboolÚlistr   r   r    r.   © r   r   r   r      s_   „ ñ  ð  ¨s°T©zð  È3ó  ð
˜d 3¨ 8™nó 
ñ 4ð °D¸¸cÀ3¸h¹Ñ4HÈ8×K[ÑK[Ñ4[ô r   r   )Útypingr   r   r   r&   r   r   r8   r   r   ú<module>r:      s   ðß ã å )÷8ò 8r   