� ���g����ddlmZddlmZmZmZmZmZddlm Z ddl Z edd���Z Gd�d ee ��Z Gd �d ee ��Z dS) �)�abstractmethod)�Any�Dict�Generic�Protocol�TypeVar)�SelfN�TT)� covariantc��eZdZdZdefd�Zededefd���Zde ee ffd�Z ede ee fdefd���Z d S) �JSONSerializablez>A generic interface for objects that can be serialized to JSON�returnc��dS)�Serializes the object to JSONN���selfs �^/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/chromadb/serde.py� to_json_strzJSONSerializable.to_json_str ��� ���json_strc��dS�z!Deserializes the object from JSONNr)�clsrs r� from_json_strzJSONSerializable.from_json_str� �� �rc��dS)�5Serializes the object to a JSON compatible dictionaryNrrs r�to_jsonzJSONSerializable.to_jsonrr�json_mapc��dSrr�rr!s r� from_jsonzJSONSerializable.from_jsonrrN) �__name__� __module__� __qualname__�__doc__�strr� classmethodr rrrr r$rrrr r s�������H�H� �S� � � � �� �S� �T� � � ��[� � ��c�3�h�� � � � �� ��c�3�h�� �D� � � ��[� � � rr c��eZdZdZdefd�Zdeeeffd�Ze defd���Z e e deeefde fd�����Z dS) �BaseModelJSONSerializablezCA mixin for BaseModels that allows a class to be serialized to JSONrc�*�|���S)r)�model_dump_jsonrs rrz%BaseModelJSONSerializable.to_json_str"s���#�#�%�%�%rc�N�tj|�����S)r)�json�loadsr.rs rr z!BaseModelJSONSerializable.to_json&s���z�$�.�.�0�0�1�1�1rc��dS)zDAbstract method that should be implemented to dump the model to JSONNrrs rr.z)BaseModelJSONSerializable.model_dump_json*s �� �rr!c��dSrrr#s rr$z#BaseModelJSONSerializable.from_json/s �� �rN)r%r&r'r(r)rrrr rr.r*r r$rrrr,r,s�������M�M�&�S�&�&�&�&�2��c�3�h��2�2�2�2�� �� � � ��^� ��� ��c�3�h�� �A� � � ��^��[� � � rr,)�abcr�typingrrrrr�typing_extensionsr r0r r r,rrr�<module>r7s���������8�8�8�8�8�8�8�8�8�8�8�8�8�8�"�"�"�"�"�"� � � � � �G�C�4� � � �� � � � � �x��{� � � �, � � � � ��� � � � � � r
Memory