mirror of
https://github.com/langgenius/dify.git
synced 2026-01-03 21:17:09 +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
|