Ë
    oPêjI"  ã                  óT  — d Z ddlmZ ddlmZ ddlmZmZ ddlm	Z	m
Z
mZmZmZ ddlmZ ddlmZmZ dd	lmZ dd
lmZmZ ddlmZmZ e	r7ddlmZ ddlmZ ddlm Z   edeef¬«       G d„ dejB                  «      «       Z"nejB                  Z"dZ# ed«      Z$ G d„ deee$   e"¬«      Z%y)z%RootModel class and type definitions.é    )Úannotations)ÚCallable)ÚcopyÚdeepcopy)ÚTYPE_CHECKINGÚAnyÚGenericÚLiteralÚTypeVar)ÚPydanticUndefined)ÚSelfÚdataclass_transformé   )ÚPydanticUserError)Ú_model_constructionÚ_repr)Ú	BaseModelÚ_object_setattr)ÚField)ÚPrivateAttr)ÚIncExF)Úkw_only_defaultÚfield_specifiersc                  ó   — e Zd Zy)Ú_RootModelMetaclassN)Ú__name__Ú
__module__Ú__qualname__© ó    úX/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/pydantic/root_model.pyr   r      s   „ ØCFr    r   )Ú	RootModelÚRootModelRootTypec                  ó  ‡ — e Zd ZU dZdZdZdZded<   ˆ fd„Ze	fdd„Z
de
_        eddˆ fd„«       Zdd	„Zdd
„Zdd„Zddd„Zer1dddddddddddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdˆ fd„Zdd„Zˆ xZS )r"   a»  !!! abstract "Usage Documentation"
        [`RootModel` and Custom Root Types](../concepts/models.md#rootmodel-and-custom-root-types)

    A Pydantic `BaseModel` for the root object of the model.

    Attributes:
        root: The root object of the model.
        __pydantic_root_model__: Whether the model is a RootModel.
        __pydantic_private__: Private fields in the model.
        __pydantic_extra__: Extra fields in the model.

    TNr#   Úrootc                óx   •— | j                   j                  d«      }|�t        dd¬«      ‚t        ‰| �  di |¤Ž y )NÚextraz<`RootModel` does not support setting `model_config['extra']`zroot-model-extra)Úcoder   )Úmodel_configÚgetr   ÚsuperÚ__init_subclass__)ÚclsÚkwargsr'   Ú	__class__s      €r!   r,   zRootModel.__init_subclass__6   sD   ø€ Ø× Ñ ×$Ñ$ WÓ-ˆØÐÜ#ØNÐUgôð ô 	‰Ñ!Ñ+ FÓ+r    c               óp   — d}|r|t         urt        d«      ‚|}| j                  j                  || ¬«       y )NTz_"RootModel.__init__" accepts either a single positional argument or arbitrary keyword arguments)Úself_instance)r   Ú
ValueErrorÚ__pydantic_validator__Úvalidate_python)Úselfr%   ÚdataÚ__tracebackhide__s       r!   Ú__init__zRootModel.__init__>   sD   € Ø ÐÙØÔ,Ñ,Ü Øuóð ð ˆDØ×#Ñ#×3Ñ3°DÈÐ3ÕMr    c                ó&   •— t         ‰| �  ||¬«      S )aS  Create a new model using the provided root object and update fields set.

        Args:
            root: The root object of the model.
            _fields_set: The set of fields to be updated.

        Returns:
            The new model.

        Raises:
            NotImplemented: If the model is not a subclass of `RootModel`.
        )r%   Ú_fields_set)r+   Úmodel_construct)r-   r%   r:   r/   s      €r!   r;   zRootModel.model_constructJ   s   ø€ ô ‰wÑ&¨D¸kÐ&ÓJÐJr    c                ó4   — | j                   | j                  dœS )N©Ú__dict__Ú__pydantic_fields_set__r=   ©r5   s    r!   Ú__getstate__zRootModel.__getstate__Z   s   € àŸ™Ø'+×'CÑ'Cñ
ð 	
r    c                óD   — t        | d|d   «       t        | d|d   «       y )Nr?   r>   )r   )r5   Ústates     r!   Ú__setstate__zRootModel.__setstate__`   s&   € Ü˜Ð7¸Ð?XÑ9YÔZÜ˜˜j¨%°
Ñ*;Õ<r    c                óø   — t        | «      }|j                  |«      }t        | j                  «      }t        | j                  d   «      |d<   t	        |d|«       t	        |dt        | j
                  «      «       |S )z$Returns a shallow copy of the model.r%   r>   r?   )ÚtypeÚ__new__r   r>   r   r?   )r5   r-   ÚmÚnew_dicts       r!   Ú__copy__zRootModel.__copy__d   sh   € ä�4‹jˆØ�K‰K˜ÓˆÜ˜Ÿ™Ó&ˆÜ §¡¨fÑ 5Ó6ˆ�ÑÜ˜˜: xÔ0Ü˜Ð4´d¸4×;WÑ;WÓ6XÔYØˆr    c                óæ   — |€i }t        | «      }|j                  |«      }||t        | «      <   t        |dt	        | j
                  |¬«      «       t        |dt        | j                  «      «       |S )z!Returns a deep copy of the model.r>   )Úmemor?   )rF   rG   Úidr   r   r>   r   r?   )r5   rL   r-   rH   s       r!   Ú__deepcopy__zRootModel.__deepcopy__n   sf   € àˆ<ØˆDÜ�4‹jˆØ�K‰K˜ÓˆØˆŒR�‹X‰Ü˜˜:¤x°·±ÀDÔ'IÔJô 	˜Ð4´d¸4×;WÑ;WÓ6XÔYØˆr    ÚpythonF)ÚmodeÚincludeÚexcludeÚcontextÚby_aliasÚexclude_unsetÚexclude_defaultsÚexclude_noneÚexclude_computed_fieldsÚ
round_tripÚwarningsÚfallbackÚserialize_as_anyÚpolymorphic_serializationc                ó   — y)a�  !!! abstract "Usage Documentation"
                [`model_dump`](../concepts/serialization.md#python-mode)

            Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

            Args:
                mode: The mode in which `to_python` should run.
                    If mode is 'json', the output will only contain JSON serializable types.
                    If mode is 'python', the output may contain non-JSON-serializable Python objects.
                include: A set of fields to include in the output.
                exclude: A set of fields to exclude from the output.
                context: Additional context to pass to the serializer.
                by_alias: Whether to use the field's alias in the dictionary key if defined.
                exclude_unset: Whether to exclude fields that have not been explicitly set.
                exclude_defaults: Whether to exclude fields that are set to their default value.
                exclude_none: Whether to exclude fields that have a value of `None`.
                exclude_computed_fields: Whether to exclude computed fields.
                    While this can be useful for round-tripping, it is usually recommended to use the dedicated
                    `round_trip` parameter instead.
                round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T].
                warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors,
                    "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError].
                fallback: A function to call when an unknown value is encountered. If not provided,
                    a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised.
                serialize_as_any: Whether to serialize fields with duck-typing serialization behavior.
                polymorphic_serialization: Whether to use model and dataclass polymorphic serialization for this call.

            Returns:
                A dictionary representation of the model.
            Nr   )r5   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   s                  r!   Ú
model_dumpzRootModel.model_dumpƒ   s   € ð` r    c                ó¸   •— t        |t        «      st        S | j                  d   j                  |j                  d   j                  k(  xr t
        ‰| �  |«      S ©Nr%   )Ú
isinstancer"   ÚNotImplementedÚ__pydantic_fields__Ú
annotationr+   Ú__eq__)r5   Úotherr/   s     €r!   rf   zRootModel.__eq__µ   sW   ø€ Ü˜%¤Ô+Ü!Ð!Ø×'Ñ'¨Ñ/×:Ñ:¸e×>WÑ>WØñ?
ç
‰*ñò /ä™™¨Ó.ð	/r    c              #  ó,   K  — d| j                   f–— y ­wra   )r%   r@   s    r!   Ú__repr_args__zRootModel.__repr_args__¼   s   è ø€ Ø�d—i‘iÐÓùs   ‚)r%   r#   ÚreturnÚNone)N)r%   r#   r:   zset[str] | Nonerj   r   )rj   údict[Any, Any])rC   rl   rj   rk   )rj   r   )rL   zdict[int, Any] | Nonerj   r   )rP   zLiteral['json', 'python'] | strrQ   úIncEx | NonerR   rm   rS   z
Any | NonerT   úbool | NonerU   ÚboolrV   ro   rW   ro   rX   ro   rY   ro   rZ   z'bool | Literal['none', 'warn', 'error']r[   zCallable[[Any], Any] | Noner\   ro   r]   rn   rj   r   )rg   r   rj   ro   )rj   z_repr.ReprArgs)r   r   r   Ú__doc__Ú__pydantic_root_model__Ú__pydantic_private__Ú__pydantic_extra__Ú__annotations__r,   r   r8   Ú__pydantic_base_init__Úclassmethodr;   rA   rD   rJ   rN   r   r_   rf   ri   Ú__classcell__)r/   s   @r!   r"   r"   "   s<  ø… ñð #ÐØÐØÐà
Óô,ð 5Fô Nð '+€HÔ#àõKó ðKó
ó=óôñ ð 5=Ø$(Ø$(Ø"&Ø$(Ø"'Ø%*Ø!&Ø,1Ø$Ø@DØ48Ø%*Ø59ñ!0	ð 2ð0	ð "ð	0	ð
 "ð0	ð  ð0	ð "ð0	ð  ð0	ð #ð0	ð ð0	ð &*ð0	ð ð0	ð >ð0	ð 2ð0	ð #ð0	ð  (3ð!0	ð" ó#0	õd/÷ r    r"   )Ú	metaclassN)&rp   Ú
__future__r   Ú_annotationsÚcollections.abcr   r   r   Útypingr   r   r	   r
   r   Úpydantic_corer   Útyping_extensionsr   r   Ú r   Ú	_internalr   r   Úmainr   r   Úfieldsr   ÚPydanticModelFieldr   ÚPydanticModelPrivateAttrr   ÚModelMetaclassr   Ú__all__r#   r"   r   r    r!   ú<module>r‡      s“   ðÙ +å 2å $ß ß @Õ @å +ß 7å ß 1ß ,áÝ3Ý?Ýñ
 ¨ÐBTÐVnÐAoÔpÜFÐ1×@Ñ@ÓFó qÙFà-×<Ñ<Ðà
€áÐ/Ó0Ð ô[ �	˜7Ð#4Ñ5ÐATö [ r    