§
    ~Štj3  ã                  ó^   — d Z ddlmZ ddlZddlZddlmZ	 ddlm
Z dd	„Zdd„Zdd„Zg d¢ZdS )ziPublic UUID v7 helpers.

These helpers expose utilities for generating UUID v7 identifiers in user code.
é    )ÚannotationsNé   )Úuuid7)Úuuid7_deterministicÚreturnú
_uuid.UUIDc                 ó   — t          ¦   «         S )zfGenerate a random UUID v7.

    Returns:
        uuid.UUID: A random, RFC 9562-compliant UUID v7.
    )Ú_uuid7© ó    úL/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/langsmith/uuid.pyr   r      s   € õ ‰8Œ8€Or   Údtú_dt.datetimec                óÀ   — | j         €%|                      t          j        j        ¬¦  «        } t          |                      ¦   «         dz  ¦  «        }t          |¦  «        S )z×Generate a UUID v7 from a datetime.

    Args:
        dt: A timezone-aware datetime. If naive, it is treated as UTC.

    Returns:
        uuid.UUID: A UUID v7 whose timestamp corresponds to the provided time.
    N)Útzinfoi Êš;)r   ÚreplaceÚ_dtÚtimezoneÚutcÚintÚ	timestampr
   )r   Únanosecondss     r   Úuuid7_from_datetimer      sL   € ð 
„yÐØ�ZŠZ�sœ|Ô/ˆZÑ0Ô0ˆÝ�b—l’l‘n”n }Ñ4Ñ5Ô5€KÝ�+ÑÔÐr   Úrun_idú_uuid.UUID | strÚproject_nameÚstrc                óä   — t          |t          ¦  «        r|st          d¦  «        ‚t          j        t          | ¦  «        ¦  «        }|j        dk    rt          d¦  «        ‚t          ||¦  «        S )a‹  Compute the run ID used for a secondary tracing replica.

    Args:
        run_id: The original UUID v7 run ID.
        project_name: The secondary replica's destination project name.

    Returns:
        uuid.UUID: The run ID used in the secondary replica destination.

    Raises:
        ValueError: If ``run_id`` is not UUID v7, or if ``project_name`` is
            empty or invalid.
    z'project_name must be a non-empty stringé   zrun_id must be a UUID v7)Ú
isinstancer   Ú
ValueErrorÚ_uuidÚUUIDÚversionÚ_uuid7_deterministic)r   r   Úparsed_run_ids      r   Ú$compute_run_id_for_secondary_replicar'   '   sp   € õ  �l¥CÑ(Ô(ð D°ð DÝÐBÑCÔCÐCå”J�s 6™{œ{Ñ+Ô+€MØÔ Ò!Ð!ÝÐ3Ñ4Ô4Ð4Ý ¨|Ñ<Ô<Ð<r   )r'   r   r   )r   r   )r   r   r   r   )r   r   r   r   r   r   )Ú__doc__Ú
__future__r   Údatetimer   Úuuidr"   Ú_internal._uuidr   r
   r   r%   r   r'   Ú__all__r   r   r   ú<module>r.      s­   ððð ð
 #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø Ð Ð Ð à ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø HÐ HÐ HÐ HÐ HÐ Hðð ð ð ðð ð ð ð=ð =ð =ð =ð2 SÐ
RÐ
R€€€r   