
    .`ir                     l    d Z ddlZddlmZ ddlmZmZ ddlmZ ddl	m
Z
  e
e          Zdeddfd	ZdS )
zBOffline FastAPI documentation support for air-gapped environments.    N)FastAPI)get_swagger_ui_html#get_swagger_ui_oauth2_redirect_html)StaticFiles)init_loggerappreturnc                 *    t           j        dd          }|t          |dd          sdS t          j        t                    j        dz  }|                                st                              d|           dS  	                    dt          t          |                    d	                                d
d           fd            }                      j        d          d             }t                              d           dS )z/Attach offline docs router if enabled via args.argsNenable_offline_docsFstaticzEStatic directory not found at %s. Offline docs will not be available.z/static)	directory)namez/docs)include_in_schemac                  T   K   t           j         j        dz    j        dd          S )Nz - Swagger UIz/static/swagger-ui-bundle.jsz/static/swagger-ui.css)openapi_urltitleoauth2_redirect_urlswagger_js_urlswagger_css_url)r   r   r   swagger_ui_oauth2_redirect_url)r   s   /home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/vllm/entrypoints/serve/instrumentator/offline_docs.pycustom_swagger_ui_htmlz-attach_router.<locals>.custom_swagger_ui_html$   s9      ")o- # B94
 
 
 	
    c                  "   K   t                      S )N)r    r   r   swagger_ui_redirectz*attach_router.<locals>.swagger_ui_redirect.   s      2444r   z9Offline documentation enabled with vendored static assets)getattrstatepathlibPath__file__parentexistsloggerwarningmountr   strgetr   info)r   r   
static_dirr   r   s   `    r   attach_routerr,      s'   39fd++D|74)>FF|h''.9J S	
 	
 	
 	IIis:???hIOOOWWWW..
 
 
 
 /.
 	WWS/5WII5 5 JI5 KKKLLLLLr   )__doc__r    fastapir   fastapi.openapi.docsr   r   fastapi.staticfilesr   vllm.loggerr   __name__r%   r,   r   r   r   <module>r3      s    I H               , + + + + + # # # # # #	X		Mw M4 M M M M M Mr   