o
    ưi                     @   s  d dl mZ d dlZd dlmZ d dlmZ ddlm	Z	m
Z
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 ddlmZ dedee fddZejddej dddddddd dej dddddd ej d!d"dd#d$ej!d%ej"dedee d&dfd'd(Z#e#$ ej!d%ej"fd)d*Ze#%e
 e#%e e#%e e#%e e#%e e#%e e#%e e#%e e#%e e#%e e&d+kre#  dS dS ),    )OptionalN)version)HealthManagementClient   )get_stored_api_keyloginlogoutwhoami)chat)credentials)http)keys)models)teams)users)interactive_shellbase_urlapi_keyc              
   C   s   t dt  | rt d|   zt| |d}| }|r*t d|  W dS t d W dS  tyL } zt d|  W Y d}~dS d}~ww )z"Print CLI and server version info.zLiteLLM Proxy CLI Version: zLiteLLM Proxy Server URL: )r   r   zLiteLLM Proxy Server Version: z+LiteLLM Proxy Server Version: (unavailable)z#Could not retrieve server version: N)clickZecholitellm_versionr   Zget_server_version	Exception)r   r   Zhealth_clientZserver_versione r   T/home/app/Keep/.python/lib/python3.10/site-packages/litellm/proxy/client/cli/main.pyprint_version   s   r   T)Zinvoke_without_commandz	--versionz-vFz7Show the LiteLLM Proxy CLI and server version and exit.c                 C   s4   |r| j st| jdpd| jdp|  S d S )Nr   http://localhost:4000r   )Zresilient_parsingr   paramsgetexit)ctxparamvaluer   r   r   <lambda>+   s   
r"   )Zis_flagZis_eagerZexpose_valuehelpcallbackz
--base-urlZLITELLM_PROXY_URLr   z$Base URL of the LiteLLM proxy server)envvarshow_envvardefaultr#   z	--api-keyZLITELLM_PROXY_API_KEYzAPI key for authentication)r%   r&   r#   r   returnc                 C   sF   |  t |du rt }|| jd< || jd< | jdu r!t|  dS dS )z4LiteLLM Proxy CLI - Manage your LiteLLM proxy serverNr   r   )Zensure_objectdictr   objZinvoked_subcommandr   )r   r   r   r   r   r   cli'   s   



r+   c                 C   s   t | jd| jd dS )z.Show the LiteLLM Proxy CLI and server version.r   r   N)r   r*   r   )r   r   r   r   r   Q   s   r   __main__)'typingr   r   Zlitellm._versionr   r   Zlitellm.proxy.client.healthr   Zcommands.authr   r   r   r	   Zcommands.chatr
   Zcommands.credentialsr   Zcommands.httpr   Zcommands.keysr   Zcommands.modelsr   Zcommands.teamsr   Zcommands.usersr   Z	interfacer   strr   groupoptionZpass_contextContextr+   commandZadd_command__name__r   r   r   r   <module>   sf   

*










