feat: 后台添加大模型配置管理页面
- 新增 /admin/llm_config 页面 - 支持配置API地址、Key、模型名称、参数 - 支持测试连接和恢复默认配置 - 配置保存到数据库,翻译服务动态读取 - 所有后台页面侧边栏添加入口
This commit is contained in:
@@ -274,6 +274,13 @@ class TranslationTask:
|
||||
|
||||
# 启动翻译线程
|
||||
def run_translation():
|
||||
# 动态获取LLM配置
|
||||
if app:
|
||||
with app.app_context():
|
||||
from admin import get_llm_config
|
||||
llm_config = get_llm_config()
|
||||
config['LLM_CONFIG'] = llm_config
|
||||
|
||||
service = TranslationService(config)
|
||||
task['status'] = 'processing'
|
||||
task['started_at'] = datetime.now().isoformat()
|
||||
|
||||
Reference in New Issue
Block a user