fix:修复qq号为int的问题,修复部分多行配置问题,修复多语言prompt问题

This commit is contained in:
SengokuCola
2026-05-05 00:32:49 +08:00
parent 94a0cb3a62
commit 4641fa1a15
17 changed files with 164 additions and 55 deletions

View File

@@ -132,6 +132,11 @@ def _toml_to_plain_dict(obj: Any) -> Any:
def _coerce_numeric_value(value: Any, target_type: Any) -> Any:
"""根据配置字段类型,把旧 WebUI 可能写入的数字字符串还原为数字。"""
if target_type is str:
if isinstance(value, (int, float)):
return str(value)
return value
if target_type is int:
if isinstance(value, str):
try: