ó
     :h˜  ã                   óx   • S SK JrJrJr  S SKJrJr  S SKJr  \" 5       r	\	R                  S\SS9S\4S j5       rg	)
é    )Ú	APIRouterÚDependsÚHTTPException)Ú
YieldInputÚYieldPredictionResponse)Úget_yield_estimatez/predictéÈ   )Úresponse_modelÚstatus_codeÚyield_inputc              ƒ   óú   #   •  [        U 5      I Sh  v•N nUR                  S5      (       a
  [        SUS9e[        US9$  N-! [         a  nUeSnAf[         a  n[        SU 35        [        SSS9eSnAff = f7f)	zA
Receives farm details and returns an AI-based yield prediction.
NzError:i÷  )r   Údetail)Úprediction_textz'Unexpected error in /predict endpoint: iô  zHAn internal server error occurred while generating the yield prediction.)r   Ú
startswithr   r   Ú	ExceptionÚprint)r   r   Úhttp_excÚes       ÚN/home/sneha/Desktop/shweta/404/404/backend/app/api/endpoints/yield_endpoint.pyÚpredict_farm_yieldr   	   s�   é € ðAä 2°;Ó ?×?ˆð ×%Ñ% h×/Ñ/ä¨C¸ÑHÐHô '°ÑGÐGñ @øô ó àˆûÜó AäÐ7¸°sÐ;Ô<Ü¨Ð6~ñ  Að  	AûðAüsC   ‚A;„A ’A “,A ¿A;Á A Á
A8ÁAÁA8ÁA3Á3A8Á8A;N)Úfastapir   r   r   Úapp.models.yield_modelr   r   Úapp.core.ai_servicesr   ÚrouterÚpostr   © ó    r   Ú<module>r      sF   ðß 5Ñ 5ç Få 3á	‹€à‡�ˆZÐ(?ÈS€ÐQðAØóAó RñAr   