Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor: split changes for api/libs/helper.py (#29875)
Asuka Minato95a2b3d08837
diff --git a/api/libs/helper.py b/api/libs/helper.pyindex 4a7afe0bda3..74e1808e499 100644--- a/api/libs/helper.py+++ b/api/libs/helper.py@@ -11,6 +11,7 @@ from collections.abc import Generator, Mappingfrom datetime import datetimefrom hashlib import sha256from typing import TYPE_CHECKING, Annotated, Any, Optional, Union, cast+from uuid import UUIDfrom zoneinfo import available_timezonesfrom flask import Response, stream_with_context@@ -119,6 +120,19 @@ def uuid_value(value: Any) -> str:raise ValueError(error)+def normalize_uuid(value: str | UUID) -> str:+ if not value:+ return ""++ try:+ return uuid_value(value)+ except ValueError as exc:+ raise ValueError("must be a valid UUID") from exc+++UUIDStrOrEmpty = Annotated[str, AfterValidator(normalize_uuid)]++def alphanumeric(value: str):# check if the value is alphanumeric and underlinedif re.match(r"^[a-zA-Z0-9_]+$", value):