o
    ß­já  ã                   @   sÌ   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	 zd d	l
Z
W n eyA   d	Z
Y nw zd d	lZW n eyS   d	ZY nw G d
d„ deƒZG dd„ deƒZd	S )é    )ÚAny)ÚFileResponse)ÚHTMLResponse)ÚJSONResponse)ÚPlainTextResponse)ÚRedirectResponse)ÚResponse)ÚStreamingResponseNc                   @   ó"   e Zd ZdZdedefdd„ZdS )ÚUJSONResponsez÷
    JSON response using the high-performance ujson library to serialize data to JSON.

    Read more about it in the
    [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
    ÚcontentÚreturnc                 C   s$   t d usJ dƒ‚t j|dd� d¡S )Nz,ujson must be installed to use UJSONResponseF)Úensure_asciizutf-8)ÚujsonÚdumpsÚencode©Úselfr   © r   úN/var/www/html/CropPilot/venv/lib/python3.10/site-packages/fastapi/responses.pyÚrender   s   zUJSONResponse.renderN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úbytesr   r   r   r   r   r      ó    r   c                   @   r
   )ÚORJSONResponsezø
    JSON response using the high-performance orjson library to serialize data to JSON.

    Read more about it in the
    [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
    r   r   c                 C   s&   t d usJ dƒ‚t j|t jt jB d�S )Nz.orjson must be installed to use ORJSONResponse)Úoption)Úorjsonr   ÚOPT_NON_STR_KEYSÚOPT_SERIALIZE_NUMPYr   r   r   r   r   ,   s   ÿzORJSONResponse.renderNr   r   r   r   r   r   $   r   r   )Útypingr   Ústarlette.responsesr   r   r   r   r   r   r	   r   ÚImportErrorr    r   r   r   r   r   r   Ú<module>   s(    ÿÿ