
    	`i                       d dl mZ d dlZd dlmZmZmZmZ ddl	m
ZmZmZ erd dlmZmZmZmZmZ d dlmZ dZd	 Zd
 Zdddd'dZ ed          Zedddd(d            Zedddd d)d$            Zedddd d*d%            Zeddd d&ZdS )+    )annotationsN)TYPE_CHECKINGAnyTypeVaroverload   )DecodeErrorconvertto_builtins)CallableLiteralOptionalTypeUnion)Buffer)encodedecodec                     t           S N)__all__     `/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/msgspec/yaml.py__dir__r      s    Nr   c                T    	 dd l }|S # t          $ r t          d|  d          d w xY w)Nr   z`msgspec.yaml.z` requires PyYAML be installed.

Please either `pip` or `conda` install it as follows:

  $ python -m pip install pyyaml  # using pip
  $ conda install pyyaml          # or using conda)yamlImportError)namer   s     r   _import_pyyamlr      se    
     AT A A A
 

 	s    ')enc_hookorderobjr   r    Optional[Callable[[Any], Any]]r!   (Literal[None, 'deterministic', 'sorted']returnbytesc                   t          d          }t          |d|j                  }|                    t	          | t
          j        t
          j        f||          gd|dd          S )a4  Serialize an object as YAML.

    Parameters
    ----------
    obj : Any
        The object to serialize.
    enc_hook : callable, optional
        A callable to call for objects that aren't supported msgspec types.
        Takes the unsupported object and should return a supported object, or
        raise a ``NotImplementedError`` if unsupported.
    order : {None, 'deterministic', 'sorted'}, optional
        The ordering to use when encoding unordered compound types.

        - ``None``: All objects are encoded in the most efficient manner
          matching their in-memory representations. The default.
        - `'deterministic'`: Unordered collections (sets, dicts) are sorted to
          ensure a consistent output between runs. Useful when
          comparison/hashing of the encoded binary output is necessary.
        - `'sorted'`: Like `'deterministic'`, but *all* object-like types
          (structs, dataclasses, ...) are also sorted by field name before
          encoding. This is slower than `'deterministic'`, but may produce more
          human-readable output.

    Returns
    -------
    data : bytes
        The serialized object.

    Notes
    -----
    This function requires that the third-party `PyYAML library
    <https://pyyaml.org/>`_ is installed.

    See Also
    --------
    decode
    r   CSafeDumper)builtin_typesr    r!   zutf-8TF)encodingDumperallow_unicode	sort_keys)r   getattr
SafeDumperdump_all_to_builtins	_datetimedatetimedate)r"   r    r!   r   r+   s        r   r   r   '   s{    V (##DT=$/::F==(19>B!	  	
     r   TT)strictdec_hookbufUnion[Buffer, str]r6   boolr7   $Optional[Callable[[type, Any], Any]]c                   d S r   r   )r8   r6   r7   s      r   r   r   i   s	     	Dr   .)typer6   r7   Union[bytes, str]r=   Type[T]c                   d S r   r   r8   r=   r6   r7   s       r   r   r   s   	     	Dr   c                   d S r   r   rA   s       r   r   r   ~   rB   r   c                  t          d          }t          |d|j                  }t          | t          t
          f          st          t          |                     } 	 |                    | |          }n/# |j        $ r"}t          t	          |                    dd}~ww xY w|t          u r|S t          ||t          j        t          j        f||          S )a  Deserialize an object from YAML.

    Parameters
    ----------
    buf : bytes-like or str
        The message to decode.
    type : type, optional
        A Python type (in type annotation form) to decode the object as. If
        provided, the message will be type checked and decoded as the specified
        type. Defaults to `Any`, in which case the message will be decoded
        using the default YAML types.
    strict : bool, optional
        Whether type coercion rules should be strict. Setting to False enables
        a wider set of coercion rules from string to non-string types for all
        values. Default is True.
    dec_hook : callable, optional
        An optional callback for handling decoding custom types. Should have
        the signature ``dec_hook(type: Type, obj: Any) -> Any``, where ``type``
        is the expected message type, and ``obj`` is the decoded representation
        composed of only basic YAML types. This hook should transform ``obj``
        into type ``type``, or raise a ``NotImplementedError`` if unsupported.

    Returns
    -------
    obj : Any
        The deserialized object.

    Notes
    -----
    This function requires that the third-party `PyYAML library
    <https://pyyaml.org/>`_ is installed.

    See Also
    --------
    encode
    r   CSafeLoaderN)r)   r6   r7   )r   r.   
SafeLoader
isinstancestrr&   
memoryviewload	YAMLError_DecodeErrorr   _convertr2   r3   r4   )r8   r=   r6   r7   r   Loaderr"   excs           r   r   r      s    J (##DT=$/::FcC<(( %JsOO$$/iiV$$> / / /3s88$$$./ s{{
 )9>:   s   A6 6
B" BB")r"   r   r    r#   r!   r$   r%   r&   )r8   r9   r6   r:   r7   r;   r%   r   )
r8   r>   r=   r?   r6   r:   r7   r;   r%   r5   )
r8   r>   r=   r   r6   r:   r7   r;   r%   r   )
__future__r   r3   r2   typingr   r   r   r    r	   rL   r
   rM   r   r1   r   r   r   r   r   typing_extensionsr   r   r   r   r   r5   r   r   r   r   <module>rT      s   " " " " " "     8 8 8 8 8 8 8 8 8 8 8 8           )??????????????((((((     " 046:	< < < < < <~ GCLL 
 59		 	 	 	 	 
	 
 59	 	 	 	 	 
	 
 59	 	 	 	 	 
	 D4 8 8 8 8 8 8 8r   