litellm/litellm/_uuid.py
yujonglee ebf829c2fa
fix: support Python 3.15 (#48359)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-26 16:00:11 +00:00

19 lines
373 B
Python

"""
Internal unified UUID helper.
Uses fastuuid where supported and the standard library on Python 3.15+.
"""
import sys
import uuid as _uuid
if sys.version_info < (3, 15):
import fastuuid as _uuid
# Expose a module-like alias so callers can use: uuid.uuid4()
uuid = _uuid
def uuid4():
"""Return a UUID4 using the selected backend."""
return uuid.uuid4()