Skip to content

armgit / dify

Public Imported from GitHub
0

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.

chore: drop unnecessary | None on LLMError and Mail.send (#36147)

BrianWang1990b9e31303886a
diff --git a/api/core/errors/error.py b/api/core/errors/error.py
index 8c1ba98ae11..826a5ebae54 100644
--- a/api/core/errors/error.py
+++ b/api/core/errors/error.py
@@ -1,9 +1,9 @@
class LLMError(ValueError):
"""Base class for all LLM exceptions."""
- description: str | None = None
+ description: str = ""
- def __init__(self, description: str | None = None):
+ def __init__(self, description: str = ""):
self.description = description
diff --git a/api/extensions/ext_mail.py b/api/extensions/ext_mail.py
index 042bf8cc475..ed30e946787 100644
--- a/api/extensions/ext_mail.py
+++ b/api/extensions/ext_mail.py
@@ -67,7 +67,7 @@ class Mail:
case _:
raise ValueError(f"Unsupported mail type {mail_type}")
- def send(self, to: str, subject: str, html: str, from_: str | None = None):
+ def send(self, to: str, subject: str, html: str, from_: str = ""):
if not self._client:
raise ValueError("Mail client is not initialized")