o
    +i{                     @  sL   d Z ddlmZ ddlZddlZddlmZ	 ddd	ZdddZ
d	dgZdS )ziPublic UUID v7 helpers.

These helpers expose utilities for generating UUID v7 identifiers in user code.
    )annotationsN   )uuid7return
_uuid.UUIDc                   C  s   t  S )zfGenerate a random UUID v7.

    Returns:
        uuid.UUID: A random, RFC 9562-compliant UUID v7.
    )_uuid7 r   r   K/var/www/html/psymed-ai/venv/lib/python3.10/site-packages/langsmith/uuid.pyr      s   r   dt_dt.datetimec                 C  s2   | j du r| jtjjd} t|  d }t|S )zGenerate 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
   nanosecondsr   r   r	   uuid7_from_datetime   s   
	r   )r   r   )r
   r   r   r   )__doc__
__future__r   datetimer   uuid_uuid_internal._uuidr   r   r   __all__r   r   r   r	   <module>   s    

	