� g\�g>� �x�dZddlmZddlZddlZddlZddlmZm Z m Z m Z m Z m Z mZddlmZddlmZmZmZddlmZmZmZmZdd lmZdd lmZdd lmZdd l m!Z!dd l"m#Z#m$Z$m%Z%er ddl&m'Z'ddl(m)Z)dZ*e d��Z+ej,dkreeej-e#e%f���eddddddddddd� dHd(�����Z.eej-e#e%f���eddddddddddd� dId,�����Z.n`eej-e#e%f���eddddddddd-�dJd.�����Z.eej-e#e%f���eddddddddd-�dKd/�����Z.eej-e#e%f��� dLddddddddddd� dMd2���Z.ee/��Z0d3ej,cxkrd4krnndNd9�Z1e1ej2_3ddd:dd;�dOdC�Z4dPdG�Z5dS)Qz7Provide an enhanced dataclass that performs validation.�)� annotationsN)� TYPE_CHECKING�Any�Callable�Generic�NoReturn�TypeVar�overload)�warn)�Literal� TypeGuard�dataclass_transform�)�_config� _decorators�_namespace_utils� _typing_extra)� _dataclasses)�getattr_migration)� ConfigDict)�PydanticUserError)�Field� FieldInfo� PrivateAttr)�PydanticDataclass)�MappingNamespace)� dataclass�rebuild_dataclass�_T��� )�field_specifiersFT.� �init�repr�eq�order� unsafe_hash�frozen�config�validate_on_init�kw_only�slotsr%�Literal[False]r&�boolr'r(r)r*r+� ConfigDict | type[object] | Noner,� bool | Noner-r.�return�-Callable[[type[_T]], type[PydanticDataclass]]c ��dS�N�r$s �d/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/pydantic/dataclasses.pyrrs �� ���_cls�type[_T]�type[PydanticDataclass]c ��dSr6r7) r:r%r&r'r(r)r*r+r,r-r.s r8rr/s ��#&�#r9�r%r&r'r(r)r*r+r,c��dSr6r7r>s r8rrBs �� �r9c��dSr6r7) r:r%r&r'r(r)r*r+r,s r8rrQs ��#&�#r9�type[_T] | None�GCallable[[type[_T]], type[PydanticDataclass]] | type[PydanticDataclass]c �������� � �|dus Jd���|dus Jd���tjdkr| | d�� ni� dd �� d���� � ���fd � } |�| n | |��S)a�Usage docs: https://docs.pydantic.dev/2.10/concepts/dataclasses/ A decorator used to create a Pydantic-enhanced dataclass, similar to the standard Python `dataclass`, but with added validation. This function should be used similarly to `dataclasses.dataclass`. Args: _cls: The target `dataclass`. init: Included for signature compatibility with `dataclasses.dataclass`, and is passed through to `dataclasses.dataclass` when appropriate. If specified, must be set to `False`, as pydantic inserts its own `__init__` function. repr: A boolean indicating whether to include the field in the `__repr__` output. eq: Determines if a `__eq__` method should be generated for the class. order: Determines if comparison magic methods should be generated, such as `__lt__`, but not `__eq__`. unsafe_hash: Determines if a `__hash__` method should be included in the class, as in `dataclasses.dataclass`. frozen: Determines if the generated class should be a 'frozen' `dataclass`, which does not allow its attributes to be modified after it has been initialized. If not set, the value from the provided `config` argument will be used (and will default to `False` otherwise). config: The Pydantic config to use for the `dataclass`. validate_on_init: A deprecated parameter included for backwards compatibility; in V2, all Pydantic dataclasses are validated on init. kw_only: Determines if `__init__` method parameters must be specified by keyword only. Defaults to `False`. slots: Determines if the generated class should be a 'slots' `dataclass`, which does not allow the addition of new attributes after instantiation. Returns: A decorator that accepts a class as its argument and returns a Pydantic `dataclass`. Raises: AssertionError: Raised if `init` is not `False` or `validate_on_init` is `False`. Fz7pydantic.dataclasses.dataclass only supports init=Falsez-validate_on_init=False is no longer supportedr )r-r.�cls� type[Any]r3�Nonec ��|jD]�}t|dg��}|D]�}t||d��}t|t��s�)d|i}tjdkr |jrd|d<|jdur |j|d<t||tj di|����|j � d���i|_ |||j |<����dS) aMake sure that stdlib `dataclasses` understands `Field` kwargs like `kw_only` To do that, we simply change `x: int = pydantic.Field(..., kw_only=True)` into `x: int = dataclasses.field(default=pydantic.Field(..., kw_only=True), kw_only=True)` �__annotations__N�defaultr Tr-r&r7)�__mro__�getattr� isinstancer�sys� version_infor-r&�setattr� dataclasses�field�__dict__�getrH)rD�annotation_clsr� field_name� field_value� field_argss r8�make_pydantic_fields_compatiblez2dataclass.<locals>.make_pydantic_fields_compatible�s��"�k� J� J�N�"�.�2C�R�H�H�K�)� J� J� �%�c�:�t�<�<� �!�+�y�9�9���%.�{�#;� ��#�w�.�.�;�3F�.�,0�J�y�)��#�4�/�/�)4�)9�J�v�&���Z��):�)H�)H�Z�)H�)H�I�I�I��<�#�#�$5�6�6�>�*,�C�'�2=�j�2I��#�J�/�/�- J�  J� Jr9r<c ���ddlm}||��rtd|j�d�d����|}t d�|jD����}|s2� �0t |d ��r td |j�d �td � ��� �� nt|d d��}tj |��}tj �|��}|j}t!j|��rLd}|f}t%|t&��rt&|j} || fz}t+j|j|��}�|��� �*� } |jr td|j�d�td � ��n |jpd} t1j|fd�� ��| d����}||_||_|j|_|j|_d|_t!j||d���|S)z�Create a Pydantic dataclass from a regular dataclass. Args: cls: The class to create the Pydantic dataclass from. Returns: A Pydantic dataclass. r)�is_model_classz(Cannot create a Pydantic dataclass from z" as it is already a Pydantic modelzdataclass-on-model)�codec3�>K�|]}tj|��V��dSr6)rP� is_dataclass)�.0�bases r8� <genexpr>z6dataclass.<locals>.create_dataclass.<locals>.<genexpr>�s-���� Z� Z�D��!9�$�!?�!?� Z� Z� Z� Z� Z� Zr9N�__pydantic_config__z[`config` is set via both the `dataclass` decorator and `__pydantic_config__` for dataclass zK. The `config` specification from `dataclass` decorator will take priority.�)�category� stacklevelzN`frozen` is set via both the `dataclass` decorator and `config` for dataclass zW.This is not recommended. The `frozen` specification on `dataclass` will take priority.FT)r%r&r'r(r)r*)� raise_errors)�_internal._utilsrZr�__name__�any� __bases__�hasattrr � UserWarningrKr� ConfigWrapperr�DecoratorInfos�build�__doc__�_pydantic_dataclasses�is_builtin_dataclass� issubclassr�__parameters__�types� new_classr*rPr�__pydantic_decorators__� __module__� __qualname__�__pydantic_complete__�complete_dataclass)rDrZ� original_cls�has_dataclass_base� config_dict�config_wrapper� decorators� original_doc�bases� generic_base�frozen_r+r'r*�kwargsrXr(r&r)s ��������r8�create_dataclassz#dataclass.<locals>.create_dataclass�s���� 5�4�4�4�4�4� �>�#� � � �#�k�3�<�k�k�k�)���� � � �!� Z� Z�C�M� Z� Z� Z�Z�Z��!� �f�&8�W�S�J_�=`�=`�&8� �]�nq�nz�]�]�]�$��  � � � �!'� 2�f�f���EZ�\`�8a�8a� � �.�{�;�;�� �/�5�5�c�:�:� � �{� � � 5�c� :� :� 7� �L� �F�E��#�w�'�'� 0�&�s�'9�:� ����/���/�#�,��6�6�C�'�'��,�,�,� � ��G��$� ��m�eh�eq�m�m�m�(� � �����%�+�4�u�G��#� �  �����#��  �  ��  �  ��'1��#�"�� �%�0���'�4���$)��!� �0��n�SX�Y�Y�Y�Y�� r9N)rDrEr3rF)rDrEr3r<)rMrN)r:r%r&r'r(r)r*r+r,r-r.r�r�rXs `````` @@r8rras�����������\ �5�=�=�=�S�=�=�=� �5� (� (� (�*Y� (� (� (� ��7�"�"�$�u�5�5�����!J�!J�!J�!J�F[�[�[�[�[�[�[�[�[�[�[�[�[�z $�|� � �1A�1A�$�1G�1G�Gr9)r!�)r!� �argsrr�rc� �td���)a9This function does nothing but raise an error that is as similar as possible to what you'd get if you were to try calling `InitVar[int]()` without this monkeypatch. The whole purpose is just to ensure typing._type_check does not error if the type hint evaluates to `InitVar[<parameter>]`. z 'InitVar' object is not callable)� TypeError)r�r�s r8� _call_initvarr� s�� �:�;�;�;r9rb)�forcere�_parent_namespace_depth�_types_namespacerDr�rer��intr��MappingNamespace | Nonec�$�|s |jrdSd|jvrt|d��|�|}n!|dkrtj|d���pi}ni}t j|���}tj|tj |j d���||d� ��S) axTry to rebuild the pydantic-core schema for the dataclass. This may be necessary when one of the annotations is a ForwardRef which could not be resolved during the initial attempt to build the schema, and automatic rebuilding fails. This is analogous to `BaseModel.model_rebuild`. Args: cls: The class to rebuild the pydantic-core schema for. force: Whether to force the rebuilding of the schema, defaults to `False`. raise_errors: Whether to raise errors, defaults to `True`. _parent_namespace_depth: The depth level of the parent namespace, defaults to 2. _types_namespace: The types namespace, defaults to `None`. Returns: Returns `None` if the schema is already "complete" and rebuilding was not required. If rebuilding _was_ required, returns `True` if rebuilding was successful, otherwise `False`. N�__pydantic_core_schema__rT)� parent_depthr�)�parent_namespaceF)�check)re� ns_resolver� _force_build) ryrR�delattrr�parent_frame_namespacer� NsResolverrprzrrlra)rDr�rer�r�� rebuild_nsr�s r8rr*s���4 ��S�.���t�!�S�\�1�1���/�0�0�0��#�%� � � �1� $� $�"�9�G^�fj�k�k�k�q�oq� � �� �"�-�#����K� !� 3� ���c�5�U�C�C�C�!�� � � � � r9�class_rE�"TypeGuard[type[PydanticDataclass]]c�`� d|jvotj|��S#t$rYdSwxYw)z�Whether a class is a pydantic dataclass. Args: class_: The class. Returns: `True` if the class is a pydantic dataclass, `False` otherwise. �__pydantic_validator__F)rRrPr]�AttributeError)r�s r8�is_pydantic_dataclassr�bsG���'�6�?�:�_�{�?W�X^�?_�?_�_�� �����u�u����s �� -�-)r%r/r&r0r'r0r(r0r)r0r*r0r+r1r,r2r-r0r.r0r3r4)r:r;r%r/r&r0r'r0r(r0r)r0r*r2r+r1r,r2r-r0r.r0r3r<)r%r/r&r0r'r0r(r0r)r0r*r2r+r1r,r2r3r4)r:r;r%r/r&r0r'r0r(r0r)r0r*r2r+r1r,r2r3r<r6)r:rAr%r/r&r0r'r0r(r0r)r0r*r2r+r1r,r2r-r0r.r0r3rB)r�rr�rr3r) rDr<r�r0rer0r�r�r�r�r3r2)r�rEr3r�)6ro� __future__r� _annotationsrPrMrt�typingrrrrrr r �warningsr �typing_extensionsr r r� _internalrrrrrrp� _migrationrr+r�errorsr�fieldsrrr�_internal._dataclassesr�_internal._namespace_utilsr�__all__rrNrQrrg� __getattr__r��InitVar�__call__rr�r7r9r8�<module>r�sD��=�=�2�2�2�2�2�2����� � � � � � � � �U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�������E�E�E�E�E�E�E�E�E�E�L�L�L�L�L�L�L�L�L�L�L�L�<�<�<�<�<�<�)�)�)�)�)�)�������%�%�%�%�%�%�1�1�1�1�1�1�1�1�1�1��=�9�9�9�9�9�9�<�<�<�<�<�<� *�� �W�T�]�]����w�����;�+<�e�[�*Q�R�R�R� � %����!��37�(,���  �  �  �  �  ��X�S�R�  ���;�+<�e�[�*Q�R�R�R� � %����!�"�37�(,��� &� &� &� &� &��X�S�R� &� &�"��;�+<�e�[�*Q�R�R�R� � %����!�"�37�(,�  �  �  �  �  ��X�S�R�  ���;�+<�e�[�*Q�R�R�R� � %����!�"�37�(,� &� &� &� &� &��X�S�R� &���{�'8�%��&M�N�N�N� �uH�!������/3�$(���uH�uH�uH�uH�uH�O�N�uH�p ���)�)� � �S� �'�'�'�'��'�'�'�'�'�<�<�<�<�$1�K�� � ��#$�04� 5�5�5�5�5�5�p � � � � � r9
Memory