o
    Üj  ã                   @   sê   d dl mZ d dlmZ d dlmZ d dlZd dlmZm	Z	 d dl
mZ d dlmZ d dlmZ eƒ Zeejd	d
d�Zg d¢Zejeeddgdgd� ejedd� ejddgd�dd„ ƒZejddgd�dd„ ƒZe d¡dd„ ƒZdS )é    )ÚFastAPI)Ú
api_router)Úget_settingsN)ÚcoordinatorÚcontext_protocol)Úinit_agents)Úinit_chat_agent)ÚCORSMiddlewarez9AI Assistant for Sustainable Agriculture (Baramati Focus)z0.1.0)ÚtitleÚdescriptionÚversion)	zhttp://localhost:5173zhttp://localhost:3000zhttp://127.0.0.1:5173zhttp://localhost:5182zhttp://95.111.228.198:5173zhttp://95.111.228.198:4173zhttp://95.111.228.198:9092zhttp://95.111.228.198zhttps://404-snowy.vercel.appTÚ*)Úallow_originsÚallow_credentialsÚallow_methodsÚallow_headersz/api/v1)Úprefixú/ÚRoot)Útagsc                   Ã   ó
   �ddiS )NÚmessagezWelcome to the CropPilot API!© r   r   r   ú+/var/www/html/CropPilot/backend/app/main.pyÚ	read_root:   ó   €r   z/healthÚHealthc                   Ã   r   )NÚstatusÚokr   r   r   r   r   Úhealth_check?   r   r   Ústartupc                  Ã   sš   �t dƒ tjrtjdkrt dƒ tjrtjdkrt dƒ t dt› �ƒ t dƒ tƒ } |  ¡ I d H  t dƒ tƒ }t d	ƒ t d
ƒ t 	dddddœ¡ d S )NzStarting up CropPilot API...ÚYOUR_GEMINI_API_KEY_NOT_SETz2STARTUP WARNING: Gemini API key is not configured!ÚYOUR_GROQ_API_KEY_NOT_SETz0STARTUP WARNING: Groq API key is not configured!zCORS allowed origins: z"Initializing multi-agent system...z!Initializing AI chat assistant...zAI chat assistant initializedzMulti-agent system initializedÚsupported_languagesÚEnglishÚHindiÚMarathi)ÚenÚhiÚmr)
ÚprintÚsettingsÚGEMINI_API_KEYÚGROQ_API_KEYÚoriginsr   Ústartr   r   Úset_context)ÚcoordÚ
chat_agentr   r   r   Ústartup_eventD   s&   €ýr3   )Úfastapir   Úapp.api.apir   Úapp.core.configr   ÚasyncioÚapp.core.multi_agentr   r   Úapp.core.agentsr   Úapp.core.chat_agentr   Úfastapi.middleware.corsr	   r+   ÚPROJECT_NAMEÚappr.   Úadd_middlewareÚinclude_routerÚgetr   r   Úon_eventr3   r   r   r   r   Ú<module>   s:    ý
û


