mirror of
https://github.com/langgenius/dify.git
synced 2025-07-30 04:45:43 +00:00

Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: Yeuoly <admin@srmxy.cn>
12 lines
231 B
Python
12 lines
231 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
|