§
    *`ƒiÝ  ã                   óf   — d Z ddlmZ ddlmZ defd„Zdeddfd	„Zed
efd„¦   «         Zde	fd„Z
dS )z"Global configuration for XGrammar.é    )Úcontextmanageré   )Ú_coreÚreturnc                  ó>   — t           j                             ¦   «         S )a¾  Get the maximum allowed recursion depth. The depth is shared per process.

    The maximum recursion depth is determined in the following order:

    1. Manually set via :py:func:`set_max_recursion_depth`
    2. ``XGRAMMAR_MAX_RECURSION_DEPTH`` environment variable (if set and is a valid integer <= 1,000,000)
    3. Default value of 10,000

    Returns
    -------
    max_recursion_depth : int
        The maximum allowed recursion depth.
    )r   ÚconfigÚget_max_recursion_depth© ó    úc/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/xgrammar/config.pyr	   r	      s   € õ Œ<×/Ò/Ñ1Ô1Ð1r   Úmax_recursion_depthNc                 óD   — t           j                             | ¦  «         dS )zØSet the maximum allowed recursion depth. The depth is shared per process. This method is
    thread-safe.

    Parameters
    ----------
    max_recursion_depth : int
        The maximum allowed recursion depth.
    N)r   r   Úset_max_recursion_depth)r   s    r   r   r      s!   € õ 
„L×(Ò(Ð)<Ñ=Ô=Ð=Ð=Ð=r   Ú
temp_depthc              #   ó”   K  — t          ¦   «         }t          | ¦  «         	 dV — t          |¦  «         dS # t          |¦  «         w xY w)zòA context manager for temporarily setting recursion depth.

    Examples
    --------
    >>> with recursion_depth(1000):
    ...     # recursion depth is 1000 here
    ...     pass
    >>> # recursion depth is restored to original value
    N)r	   r   )r   Ú
prev_depths     r   r   r   %   sX   è è € õ )Ñ*Ô*€JÝ˜JÑ'Ô'Ð'ð,Øˆˆˆå 
Ñ+Ô+Ð+Ð+Ð+øÕ 
Ñ+Ô+Ð+Ð+øøøs	   ¡6 ¶Ac                  ó>   — t           j                             ¦   «         S )zªGet the serialization version number. The current version is "v4".

    Returns
    -------
    serialization_version : str
        The serialization version number.
    )r   r   Úget_serialization_versionr
   r   r   r   r   8   s   € õ Œ<×1Ò1Ñ3Ô3Ð3r   )Ú__doc__Ú
contextlibr   Úbaser   Úintr	   r   r   Ústrr   r
   r   r   ú<module>r      s¸   ðØ (Ð (à %Ð %Ð %Ð %Ð %Ð %à Ð Ð Ð Ð Ð ð2 ð 2ð 2ð 2ð 2ð"	>°ð 	>¸ð 	>ð 	>ð 	>ð 	>ð ð, Cð ,ð ,ð ,ñ „ð,ð$4 3ð 4ð 4ð 4ð 4ð 4ð 4r   