refactor: 移除LLM旧兼容入口并统一scene单路由
变更项: 1. LLMRegistry 仅保留 scene 入口,删除 backend_name/backend_ref/scene_ref 等兼容解析分支,未声明 scene 时仅保留直连配置。 2. Dify/GlobalNews/GameTask 插件初始化改为仅传 scene,不再拼接 backend/provider/url 等旧兼容字段。 3. 清理插件配置冗余:dify/global_news/game_task/douyu 的 config.toml 删除 backend 字段,统一由 scene 映射后端。 4. 后台 system API 调整为严格模式:插件依赖扫描仅采集 scene;scene 保存时必须绑定有效 backend。 5. 后台页面去除拓扑中的配置Backend冗余列,并新增前端校验,禁止提交空场景或未绑定后端。
This commit is contained in:
@@ -78,15 +78,9 @@ class GlobalNewsPlugin(MessagePluginInterface):
|
||||
self.enable = plugin_config.get("enable", True)
|
||||
llm_config = plugin_config.get("llm", {}) or {}
|
||||
if not llm_config:
|
||||
# 严格场景路由:仅由 scene 决定使用哪个后端。
|
||||
llm_config = {
|
||||
# 场景路由优先,便于后台统一切换新闻分析后端。
|
||||
"scene": plugin_config.get("scene", ""),
|
||||
"backend": plugin_config.get("backend", ""),
|
||||
"provider": "dify",
|
||||
"mode": "chat",
|
||||
"authorization": plugin_config.get("authorization", ""),
|
||||
"url": plugin_config.get("url", ""),
|
||||
"response_mode": "blocking",
|
||||
}
|
||||
self.llm_client = UnifiedLLMClient(llm_config)
|
||||
self.LOG.debug(f"[{self.name}] 插件初始化完成,指令:{self._commands}")
|
||||
|
||||
Reference in New Issue
Block a user