�
���g� � � � d dl mZ d dlmZmZmZmZmZ d dlm Z d dl
Z
edd�� � Z G d� d ee � � Z G d
� dee � � Z
dS )� )�abstractmethod)�Any�Dict�Generic�Protocol�TypeVar)�SelfN�TT)� covariantc � � e Zd ZdZdefd�Zededefd�� � Zde ee
f fd�Zede ee
f defd�� � Zd 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 )�clsr s r �
from_json_strzJSONSerializable.from_json_str � � � �r c � � dS )�5Serializes the object to a JSON compatible dictionaryNr r s r �to_jsonzJSONSerializable.to_json r r �json_mapc � � dS r r �r r! s r � from_jsonzJSONSerializable.from_json r r N)
�__name__�
__module__�__qualname__�__doc__�strr �classmethodr r r r r r$ r r r r
r
s� � � � � � �H�H��S� � � � � ��S� �T� � � � �[����c�3�h�� � � � � ���c�3�h�� �D� � � � �[�� � r r
c � � e Zd ZdZdefd�Zdeeef fd�Ze defd�� � Z
ee deeef defd�� � � � Z
dS ) �BaseModelJSONSerializablezCA mixin for BaseModels that allows a class to be serialized to JSONr c �* � | � � � S )r )�model_dump_jsonr s r r z%BaseModelJSONSerializable.to_json_str"