diff --git a/app/core/constants.py b/app/core/constants.py
index cbdfb8f..5b44a54 100644
--- a/app/core/constants.py
+++ b/app/core/constants.py
@@ -15,12 +15,12 @@ DEFAULT_MAX_TOKENS = 8192
DEFAULT_TOP_P = 0.9
DEFAULT_TOP_K = 40
DEFAULT_FILTER_MODELS = [
- "gemini-1.0-pro-vision-latest",
- "gemini-pro-vision",
- "chat-bison-001",
- "text-bison-001",
- "embedding-gecko-001"
- ]
+ "gemini-1.0-pro-vision-latest",
+ "gemini-pro-vision",
+ "chat-bison-001",
+ "text-bison-001",
+ "embedding-gecko-001",
+]
DEFAULT_CREATE_IMAGE_MODEL = "imagen-3.0-generate-002"
# 图像生成相关常量
@@ -38,14 +38,14 @@ DEFAULT_STREAM_LONG_TEXT_THRESHOLD = 50
DEFAULT_STREAM_CHUNK_SIZE = 5
# 正则表达式模式
-IMAGE_URL_PATTERN = r'!\[(.*?)\]\((.*?)\)'
-DATA_URL_PATTERN = r'data:([^;]+);base64,(.+)'
+IMAGE_URL_PATTERN = r"!\[(.*?)\]\((.*?)\)"
+DATA_URL_PATTERN = r"data:([^;]+);base64,(.+)"
# Audio/Video Settings
SUPPORTED_AUDIO_FORMATS = ["wav", "mp3", "flac", "ogg"]
SUPPORTED_VIDEO_FORMATS = ["mp4", "mov", "avi", "webm"]
MAX_AUDIO_SIZE_BYTES = 50 * 1024 * 1024 # Example: 50MB limit for Base64 payload
-MAX_VIDEO_SIZE_BYTES = 200 * 1024 * 1024 # Example: 200MB limit
+MAX_VIDEO_SIZE_BYTES = 200 * 1024 * 1024 # Example: 200MB limit
# Optional: Define MIME type mappings if needed, or handle directly in converter
AUDIO_FORMAT_TO_MIMETYPE = {
@@ -63,28 +63,50 @@ VIDEO_FORMAT_TO_MIMETYPE = {
}
GEMINI_2_FLASH_EXP_SAFETY_SETTINGS = [
- {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "OFF"},
- {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "OFF"},
- {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "OFF"},
- {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "OFF"},
- {"category": "HARM_CATEGORY_CIVIC_INTEGRITY", "threshold": "OFF"},
- ]
+ {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "OFF"},
+ {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "OFF"},
+ {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "OFF"},
+ {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "OFF"},
+ {"category": "HARM_CATEGORY_CIVIC_INTEGRITY", "threshold": "OFF"},
+]
DEFAULT_SAFETY_SETTINGS = [
- {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "OFF"},
- {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "OFF"},
- {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "OFF"},
- {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "OFF"},
- {"category": "HARM_CATEGORY_CIVIC_INTEGRITY", "threshold": "BLOCK_NONE"},
- ]
+ {"category": "HARM_CATEGORY_HARASSMENT", "threshold": "OFF"},
+ {"category": "HARM_CATEGORY_HATE_SPEECH", "threshold": "OFF"},
+ {"category": "HARM_CATEGORY_SEXUALLY_EXPLICIT", "threshold": "OFF"},
+ {"category": "HARM_CATEGORY_DANGEROUS_CONTENT", "threshold": "OFF"},
+ {"category": "HARM_CATEGORY_CIVIC_INTEGRITY", "threshold": "BLOCK_NONE"},
+]
TTS_VOICE_NAMES = [
- "Zephyr", "Puck", "Charon", "Kore",
- "Fenrir", "Leda", "Orus", "Aoede",
- "Callirhoe", "Autonoe", "Enceladus", "Iapetus",
- "Umbriel", "Algieba", "Despina", "Erinome",
- "Algenib", "Rasalgethi", "Laomedeia", "Achernar",
- "Alnilam", "Schedar", "Gacrux", "Pulcherrima",
- "Achird", "Zubenelgenubi", "Vindemiatrix", "Sadachbia",
- "Sadaltager", "Sulafat"
-]
\ No newline at end of file
+ "Zephyr",
+ "Puck",
+ "Charon",
+ "Kore",
+ "Fenrir",
+ "Leda",
+ "Orus",
+ "Aoede",
+ "Callirrhoe",
+ "Autonoe",
+ "Enceladus",
+ "Iapetus",
+ "Umbriel",
+ "Algieba",
+ "Despina",
+ "Erinome",
+ "Algenib",
+ "Rasalgethi",
+ "Laomedeia",
+ "Achernar",
+ "Alnilam",
+ "Schedar",
+ "Gacrux",
+ "Pulcherrima",
+ "Achird",
+ "Zubenelgenubi",
+ "Vindemiatrix",
+ "Sadachbia",
+ "Sadaltager",
+ "Sulafat",
+]
diff --git a/app/service/files/files_service.py b/app/service/files/files_service.py
index 39c2ba0..c33ede4 100644
--- a/app/service/files/files_service.py
+++ b/app/service/files/files_service.py
@@ -113,7 +113,7 @@ class FilesService:
try:
request_data = json.loads(body)
display_name = request_data.get("displayName", "")
- except:
+ except Exception:
pass
# 從 upload URL 中提取 upload_id
import urllib.parse
diff --git a/app/templates/config_editor.html b/app/templates/config_editor.html
index e2854e3..a8a4ff1 100644
--- a/app/templates/config_editor.html
+++ b/app/templates/config_editor.html
@@ -1618,7 +1618,7 @@ endblock %} {% block head_extra_styles %}
-
+