mirror of
https://github.com/langgenius/dify.git
synced 2025-12-13 11:21:26 +00:00
13 lines
232 B
Python
13 lines
232 B
Python
import uuid
|
|
|
|
|
|
def is_valid_uuid(uuid_str: str | None) -> bool:
|
|
if uuid_str is None or len(uuid_str) == 0:
|
|
return False
|
|
try:
|
|
|
|
uuid.UUID(uuid_str)
|
|
return True
|
|
except Exception:
|
|
return False
|