fix: correct model type mappings and improve system setting persistence (#16501)

This commit is contained in:
euvre
2026-07-13 16:42:55 +08:00
committed by GitHub
parent d35e957252
commit 3bfad1f00e
44 changed files with 238 additions and 150 deletions
+2 -2
View File
@@ -610,9 +610,9 @@ def _load_chat_routes_unit_module(monkeypatch):
class _StubLLMType(str, Enum):
CHAT = "chat"
IMAGE2TEXT = "image2text"
VISION = "vision"
RERANK = "rerank"
SPEECH2TEXT = "speech2text"
ASR = "asr"
TTS = "tts"
class _StubRetCode(int, Enum):
@@ -651,7 +651,7 @@ def _load_user_app(monkeypatch):
settings_mod.EMBEDDING_MDL = "embd-mdl"
settings_mod.ASR_MDL = "asr-mdl"
settings_mod.PARSERS = []
settings_mod.IMAGE2TEXT_MDL = "img-mdl"
settings_mod.VISION_MDL = "img-mdl"
settings_mod.RERANK_MDL = "rerank-mdl"
settings_mod.REGISTER_ENABLED = True
monkeypatch.setitem(sys.modules, "common.settings", settings_mod)
@@ -1402,7 +1402,7 @@ def _load_chat_routes_unit_module(monkeypatch):
monkeypatch.setitem(sys.modules, "common.settings", settings_mod)
constants_mod = ModuleType("common.constants")
constants_mod.LLMType = SimpleNamespace(CHAT="chat", IMAGE2TEXT="image2text", RERANK="rerank", SPEECH2TEXT="speech2text", TTS="tts")
constants_mod.LLMType = SimpleNamespace(CHAT="chat", VISION="vision", RERANK="rerank", ASR="asr", TTS="tts")
constants_mod.RetCode = SimpleNamespace(SUCCESS=0, DATA_ERROR=102, OPERATING_ERROR=103, AUTHENTICATION_ERROR=109)
constants_mod.StatusEnum = SimpleNamespace(VALID=SimpleNamespace(value="1"), INVALID=SimpleNamespace(value="0"))
from common.constants import MAXIMUM_PAGE_NUMBER as _MPN, MAXIMUM_TASK_PAGE_NUMBER as _MTPN