o
    Ci@                  7   @  s  d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlm	Z	m
Z
 d dlZd dlZd dlmZ d dlmZmZmZmZmZmZmZmZmZmZmZmZmZmZ d dlmZm Z  d dl!m"Z"m#Z# e$e%e& Z'e$e%e& Z(e$e%e& Z)e$e%e& Z*e$dd	 e& D Z+e$eZ,d
Z-e.dZ/dddZ0ej1ddidej2dddej3de4dddd ej3d!e5d"d#dd ej3d$e4dd%d&ej3d'e5dd(d&ej3d)dd*d+d,ej3d-d.dd/ej6dd0d1ej3d2d3dd4d5ej3d6d7dd8d5ej3d9e7d:dd;d<ej3d=de5d>d?ej3d@e+dAdBdd ej3dCe(dAdDdd ej3dEe)dAdFdd ej3dGe5dHdIdd ej3dJe5dKdLdd ej3dMe7dNdOdd ej3dPe7dNdQdd ej3dRe8ddSdd ej3dTe*dAdUdd ej3dVe,dAdWdd ej3dXej6dd0ddYdd ej3dZej6dd0dd[dd ej3d\e'dd]dd ej3d^ddd_d,ej3d`dddad,ej3dbdddcd,ej3ddddded,ej3dfdddgd,ej3dhe4ddid&ej3dje4dkdld&ej3dme5ddnd&ej3doe5dpdqd&ej3dre5ddsd&ej3dte5dudvdd ej3dwe5ddxd&ej3dye4ddzdd ej3d{e4dd|dd ej3d}e4dd~dd ej3de5e5eddd ej3de5e5ej9ddd ej3de4dddd ej3de4dddd ej3ddddd5ej3dde0d*dddej3ddkdddej3dde5ddd&ej3ddd*dddddd˄Z:dd"dddAdAdAdHdKdNdNddAdAd*dddd:ddedddddddkddpdduddddeej9dddddd*dd̜.dddلZ;e<dkre:  dS dS )    )annotationsN)AnyCallable)ASGIApplication)HTTP_PROTOCOLS
INTERFACESLIFESPAN
LOG_LEVELSLOGGING_CONFIGLOOP_SETUPSSSL_PROTOCOL_VERSIONWS_PROTOCOLSConfigHTTPProtocolTypeInterfaceTypeLifespanTypeLoopSetupTypeWSProtocolType)ServerServerState)ChangeReloadMultiprocessc                 C  s   g | ]}|d kr|qS )none ).0keyr   r   d/var/www/html/fyndo/python/python_agents/rag_suite/venv/lib/python3.10/site-packages/uvicorn/main.py
<listcomp>&       r      uvicorn.errorctxclick.Contextparamclick.ParametervalueboolreturnNonec                 C  s>   |r| j rd S tdtjt t t f  | 	  d S )Nz#Running uvicorn %s with %s %s on %s)
resilient_parsingclickechouvicorn__version__platformpython_implementationpython_versionsystemexit)r!   r#   r%   r   r   r   print_version.   s   
	r3   auto_envvar_prefixUVICORN)context_settingsappUVICORN_APP)envvarz--hostz	127.0.0.1zBind socket to this host.T)typedefaulthelpshow_defaultz--porti@  zABind socket to this port. If 0, an available port will be picked.z--udszBind to a UNIX domain socket.)r:   r;   r<   z--fdz)Bind to socket from this file descriptor.z--reloadFzEnable auto-reload.)is_flagr;   r<   z--reload-dirreload_dirszRSet reload directories explicitly, instead of using the current working directory.)exists)multipler<   r:   z--reload-includereload_includeszSet glob patterns to include while watching for files. Includes '*.py' by default; these defaults can be overridden with `--reload-exclude`. This option has no effect unless watchfiles is installed.)rA   r<   z--reload-excludereload_excludeszSet glob patterns to exclude while watching for files. Includes '.*, .py[cod], .sw.*, ~*' by default; these defaults can be overridden with `--reload-include`. This option has no effect unless watchfiles is installed.z--reload-delayg      ?zTDelay between previous and next check if application needs to be. Defaults to 0.25s.)r:   r;   r=   r<   z	--workersz~Number of worker processes. Defaults to the $WEB_CONCURRENCY environment variable if available, or 1. Not valid with --reload.)r;   r:   r<   z--loopautozEvent loop implementation.z--httpzHTTP protocol implementation.z--wsz"WebSocket protocol implementation.z--ws-max-sizei   z#WebSocket max size message in bytesz--ws-max-queue    z2The maximum length of the WebSocket message queue.z--ws-ping-intervalg      4@z#WebSocket ping interval in seconds.z--ws-ping-timeoutz"WebSocket ping timeout in seconds.z--ws-per-message-deflatez)WebSocket per-message-deflate compressionz
--lifespanzLifespan implementation.z--interfacez:Select ASGI3, ASGI2, or WSGI as the application interface.z
--env-filezEnvironment configuration file.z--log-configzBLogging configuration file. Supported formats: .ini, .json, .yaml.z--log-levelzLog level. [default: info]z--access-log/--no-access-logzEnable/Disable access log.z--use-colors/--no-use-colorsz!Enable/Disable colorized logging.z"--proxy-headers/--no-proxy-headerszdEnable/Disable X-Forwarded-Proto, X-Forwarded-For, X-Forwarded-Port to populate remote address info.z"--server-header/--no-server-headerz%Enable/Disable default Server header.z--date-header/--no-date-headerz#Enable/Disable default Date header.z--forwarded-allow-ipszComma separated list of IPs to trust with proxy headers. Defaults to the $FORWARDED_ALLOW_IPS environment variable if available, or '127.0.0.1'.z--root-path zLSet the ASGI 'root_path' for applications submounted below a given URL path.z--limit-concurrencyz^Maximum number of concurrent connections or tasks to allow, before issuing HTTP 503 responses.z	--backlogi   z0Maximum number of connections to hold in backlogz--limit-max-requestszEMaximum number of requests to service before terminating the process.z--timeout-keep-alive   zLClose Keep-Alive connections if no new data is received within this timeout.z--timeout-graceful-shutdownz8Maximum number of seconds to wait for graceful shutdown.z--ssl-keyfilezSSL key filez--ssl-certfilezSSL certificate filez--ssl-keyfile-passwordzSSL keyfile passwordz--ssl-versionz,SSL version to use (see stdlib ssl module's)z--ssl-cert-reqsz@Whether client certificate is required (see stdlib ssl module's)z--ssl-ca-certszCA certificates filez--ssl-ciphersTLSv1z(Ciphers to use (see stdlib ssl module's)z--headerheaderszASpecify custom default HTTP response headers as a Name:Value pairz	--versionz%Display the uvicorn version and exit.)r>   callbackexpose_valueis_eagerr<   z	--app-dirzuLook for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.)r;   r=   r<   z--h11-max-incomplete-event-sizeh11_max_incomplete_event_sizezFFor h11, the maximum number of bytes to buffer of an incomplete event.z	--factoryzFTreat APP as an application factory, i.e. a () -> <ASGI app> callable.)r>   r;   r<   r=   strhostportintudsfdloopr   httpr   wsr   ws_max_sizews_max_queuews_ping_intervalfloatws_ping_timeoutws_per_message_deflatelifespanr   	interfacer   reload	list[str]reload_delayworkersenv_file
log_config	log_level
access_logproxy_headersserver_headerdate_headerforwarded_allow_ips	root_pathlimit_concurrencybackloglimit_max_requeststimeout_keep_alivetimeout_graceful_shutdown
int | Nonessl_keyfilessl_certfilessl_keyfile_passwordssl_versionssl_cert_reqsssl_ca_certsssl_ciphers
use_colorsapp_dirfactoryc/           /      C  s  t | fi d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d u r5tn|d|d|d|d|d|pGd d|pLd d|pd d|d|d|d|d|d|d|d|d|d | d!|!d"|"d#|#d$|$d%|%d&|&d'|'d(|(d)|)d*d+d, |*D d-|+d.|.d/|,d0|- d S d|d|d|d|d|d|d|d|d|d | d!|!d"|"d#|#d$|$d%|%d&|&d'|'d(|(d)|)d*d+d, |*D d-|+d.|.d/|,d0|- d S )1NrO   rP   rR   rS   rT   rU   rV   rW   rX   rY   r[   r\   r]   rc   rd   re   rf   r^   r_   r?   rB   rC   ra   rb   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rr   rs   rt   ru   rv   rw   rx   rI   c                 S  s   g | ]}| d dqS ):   )split)r   headerr   r   r   r     r   zmain.<locals>.<listcomp>ry   r{   rz   rM   )runr
   )/r7   rO   rP   rR   rS   rT   rU   rV   rW   rX   rY   r[   r\   r]   r^   r_   r?   rB   rC   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rr   rs   rt   ru   rv   rw   rx   rI   ry   rz   rM   r{   r   r   r   main=   s,    g	
 !"#$%&'()*+,-./ !"#$%&'()*+,-./r   ).rO   rP   rR   rS   rT   rU   rV   rW   rX   rY   r[   r\   r]   r^   r_   r?   rB   rC   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rr   rs   rt   ru   rv   rw   rx   rI   ry   rz   r{   rM   *ASGIApplication | Callable[..., Any] | str
str | None)type[asyncio.Protocol] | HTTPProtocolType'type[asyncio.Protocol] | WSProtocolTypefloat | Nonelist[str] | str | Nonestr | os.PathLike[str] | Nonedict[str, Any] | str | Nonestr | int | Nonelist[tuple[str, str]] | Nonebool | Nonec       .   3      C  s   |,d urt jd|, t| fi d|d|d|d|d|d|d|d	|d
|	d|
d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d |d!| d"|!d#|"d$|#d%|$d&|%d'|&d(|'d)|(d*|)d+|*d,|+d-|-d.|.}/t|/d/}0|/js|/jd0krt| tst	
d1}1|1d2 t d0 |/jr|/ }2t|/|0j|2gd3  n|/jd0kr|/ }2t|/|0j|2gd3  n|0  |/jrtj|/jrt|/j |0js
|/js|/jd0krt t d S d S d S d S )4Nr   rO   rP   rR   rS   rT   rU   rV   rW   rX   rY   r[   r\   r]   r^   r_   r?   rB   rC   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rr   rs   rt   ru   rv   rw   rx   rI   ry   r{   rM   )configr}   r    zRYou must pass the application as an import string to enable 'reload' or 'workers'.)targetsockets)syspathinsertr   r   r_   rb   
isinstancerN   logging	getLoggerwarningr2   should_reloadbind_socketr   r   r   rR   osr@   removestartedSTARTUP_FAILURE)3r7   rO   rP   rR   rS   rT   rU   rV   rW   rX   rY   r[   r\   r]   r^   r_   r?   rB   rC   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rr   rs   rt   ru   rv   rw   rx   rI   ry   rz   r{   rM   r   serverloggersockr   r   r   r     s   2	
 !"#$%&'()*+,-.
0


r   __main__)r!   r"   r#   r$   r%   r&   r'   r(   )`r7   rN   rO   rN   rP   rQ   rR   rN   rS   rQ   rT   r   rU   r   rV   r   rW   rQ   rX   rQ   rY   rZ   r[   rZ   r\   r&   r]   r   r^   r   r_   r&   r?   r`   rB   r`   rC   r`   ra   rZ   rb   rQ   rc   rN   rd   rN   re   rN   rf   r&   rg   r&   rh   r&   ri   r&   rj   rN   rk   rN   rl   rQ   rm   rQ   rn   rQ   ro   rQ   rp   rq   rr   rN   rs   rN   rt   rN   ru   rQ   rv   rQ   rw   rN   rx   rN   rI   r`   ry   r&   rz   rN   rM   rq   r{   r&   r'   r(   )`r7   r   rO   rN   rP   rQ   rR   r   rS   rq   rT   r   rU   r   rV   r   rW   rQ   rX   rQ   rY   r   r[   r   r\   r&   r]   r   r^   r   r_   r&   r?   r   rB   r   rC   r   ra   rZ   rb   rq   rc   r   rd   r   re   r   rf   r&   rg   r&   rh   r&   ri   r&   rj   r   rk   rN   rl   rq   rm   rQ   rn   rq   ro   rQ   rp   rq   rr   r   rs   r   rt   r   ru   rQ   rv   rQ   rw   r   rx   rN   rI   r   ry   r   rz   r   r{   r&   rM   rq   r'   r(   )=
__future__r   asyncior   r   r.   sslr   typingr   r   r*   r,   uvicorn._typesr   uvicorn.configr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   uvicorn.serverr   r   uvicorn.supervisorsr   r   ChoicelistkeysLEVEL_CHOICESHTTP_CHOICES
WS_CHOICESLIFESPAN_CHOICESLOOP_CHOICESINTERFACE_CHOICESr   r   r   r3   commandargumentoptionrN   rQ   PathrZ   r&   	CERT_NONEr   r   __name__r   r   r   r   <module>   s   @



	


lg
~
