diff --git a/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentPluginMappingServiceImpl.java b/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentPluginMappingServiceImpl.java index fe197fbc..6d839d9c 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentPluginMappingServiceImpl.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/agent/service/impl/AgentPluginMappingServiceImpl.java @@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import xiaozhi.common.utils.JsonUtils; import xiaozhi.modules.agent.dao.AgentPluginMappingMapper; import xiaozhi.modules.agent.entity.AgentPluginMapping; @@ -27,6 +28,7 @@ import xiaozhi.modules.model.service.ModelConfigService; */ @Service @RequiredArgsConstructor +@Slf4j public class AgentPluginMappingServiceImpl extends ServiceImpl implements AgentPluginMappingService { private final AgentPluginMappingMapper agentPluginMappingMapper; diff --git a/main/manager-api/src/main/java/xiaozhi/modules/knowledge/dao/KnowledgeBaseDao.java b/main/manager-api/src/main/java/xiaozhi/modules/knowledge/dao/KnowledgeBaseDao.java index 7f94b0af..b9a8aa0c 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/knowledge/dao/KnowledgeBaseDao.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/knowledge/dao/KnowledgeBaseDao.java @@ -1,6 +1,7 @@ package xiaozhi.modules.knowledge.dao; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import xiaozhi.common.dao.BaseDao; import xiaozhi.modules.knowledge.entity.KnowledgeBaseEntity; @@ -11,4 +12,11 @@ import xiaozhi.modules.knowledge.entity.KnowledgeBaseEntity; @Mapper public interface KnowledgeBaseDao extends BaseDao { + /** + * 根据知识库ID删除相关的插件映射记录 + * + * @param knowledgeBaseId 知识库ID + */ + void deletePluginMappingByKnowledgeBaseId(@Param("knowledgeBaseId") String knowledgeBaseId); + } \ No newline at end of file diff --git a/main/manager-api/src/main/java/xiaozhi/modules/knowledge/service/impl/KnowledgeBaseServiceImpl.java b/main/manager-api/src/main/java/xiaozhi/modules/knowledge/service/impl/KnowledgeBaseServiceImpl.java index b56923de..8fb770c7 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/knowledge/service/impl/KnowledgeBaseServiceImpl.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/knowledge/service/impl/KnowledgeBaseServiceImpl.java @@ -314,6 +314,12 @@ public class KnowledgeBaseServiceImpl extends BaseServiceImpl 0 ? "成功" : "失败"); } diff --git a/main/manager-api/src/main/resources/db/changelog/202511131020.sql b/main/manager-api/src/main/resources/db/changelog/202511131020.sql deleted file mode 100644 index 1d19240d..00000000 --- a/main/manager-api/src/main/resources/db/changelog/202511131020.sql +++ /dev/null @@ -1,11 +0,0 @@ -UPDATE `ai_model_config` SET -`doc_link` = 'https://github.com/infiniflow/ragflow/blob/main/README_zh.md', -`remark` = '详细部署教程参考:https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/docs/ragflow-integration.md -部署成功,注冊登录后,点击右上角头像,获得RAGFlow的API KEY和API服务器地址。使用RAGFlow前请在Model Provider中添加模型和设置默认模型。' WHERE `id` = 'RAG_RAGFlow'; - -update `ai_model_config` set `model_name` = '外挂的大模型意图识别' where `id` = 'Intent_intent_llm'; -update `ai_model_config` set `model_name` = '大模型自主函数调用' where `id` = 'Intent_function_call'; - -update `ai_model_provider` set `name` = '外挂的大模型意图识别' , `fields` = '[{"key":"llm","label":"引用的LLM模型","type":"string"}]' where id = 'SYSTEM_Intent_intent_llm'; -update `ai_model_provider` set `name` = '大模型自主函数调用' where id = 'SYSTEM_Intent_function_call'; - diff --git a/main/manager-api/src/main/resources/db/changelog/202511131023.sql b/main/manager-api/src/main/resources/db/changelog/202511131023.sql new file mode 100644 index 00000000..4efb1212 --- /dev/null +++ b/main/manager-api/src/main/resources/db/changelog/202511131023.sql @@ -0,0 +1,62 @@ +UPDATE `ai_model_config` SET +`doc_link` = 'https://github.com/infiniflow/ragflow/blob/main/README_zh.md', +`remark` = '详细部署教程参考:https://github.com/xinnan-tech/xiaozhi-esp32-server/blob/main/docs/ragflow-integration.md +部署成功,注冊登录后,点击右上角头像,获得RAGFlow的API KEY和API服务器地址。使用RAGFlow前请在Model Provider中添加模型和设置默认模型。' WHERE `id` = 'RAG_RAGFlow'; + +update `ai_model_config` set `model_name` = '外挂的大模型意图识别' where `id` = 'Intent_intent_llm'; +update `ai_model_config` set `model_name` = '大模型自主函数调用' where `id` = 'Intent_function_call'; +update `ai_model_config` set `model_name` = '百炼智能体应用' where `id` = 'LLM_AliAppLLM'; + +update `ai_model_provider` set `name` = '外挂的大模型意图识别' , `fields` = '[{"key":"llm","label":"引用的LLM模型","type":"string"}]' where id = 'SYSTEM_Intent_intent_llm'; +update `ai_model_provider` set `name` = '大模型自主函数调用' where id = 'SYSTEM_Intent_function_call'; + +UPDATE ai_model_config set model_name = 'Linkerai(流式)' where id = 'TTS_LinkeraiTTS'; +UPDATE ai_model_config set model_name = '火山引擎(流式)' where id = 'TTS_HuoshanDoubleStreamTTS'; +UPDATE ai_model_config set model_name = '阿里百炼(流式)' where id = 'TTS_AliBLStreamTTS'; +UPDATE ai_model_config set model_name = '科大讯飞(流式)' where id = 'TTS_XunFeiStreamTTS'; +UPDATE ai_model_config set model_name = 'Minimax(流式)' where id = 'TTS_MinimaxStreamTTS'; +UPDATE ai_model_config set model_name = '阿里云(流式)' where id = 'TTS_AliyunStreamTTS'; +UPDATE ai_model_config set model_name = 'PaddleSpeech(流式)' where id = 'TTS_PaddleSpeechTTS'; +UPDATE ai_model_config set model_name = 'IndexTTS(流式)' where id = 'TTS_IndexStreamTTS'; + +update ai_model_config SET sort = 2 where id = 'TTS_LinkeraiTTS'; +update ai_model_config SET sort = 3 where id = 'TTS_HuoshanDoubleStreamTTS'; +update ai_model_config SET sort = 4 where id = 'TTS_AliBLStreamTTS'; +update ai_model_config SET sort = 5 where id = 'TTS_XunFeiStreamTTS'; +update ai_model_config SET sort = 6 where id = 'TTS_MinimaxStreamTTS'; +update ai_model_config SET sort = 7 where id = 'TTS_AliyunStreamTTS'; +update ai_model_config SET sort = 8 where id = 'TTS_IndexStreamTTS'; +update ai_model_config SET sort = 9 where id = 'TTS_PaddleSpeechTTS'; +update ai_model_config SET sort = 10 where id = 'TTS_DoubaoTTS'; +update ai_model_config SET sort = 11 where id = 'TTS_TencentTTS'; +update ai_model_config SET sort = 12 where id = 'TTS_AliyunTTS'; +update ai_model_config SET sort = 13 where id = 'TTS_OpenAITTS'; +update ai_model_config SET sort = 14 where id = 'TTS_CosyVoiceSiliconflow'; +update ai_model_config SET sort = 15 where id = 'TTS_CozeCnTTS'; +update ai_model_config SET sort = 16 where id = 'TTS_FishSpeech'; +update ai_model_config SET sort = 17 where id = 'TTS_GPT_SOVITS_V3'; +update ai_model_config SET sort = 18 where id = 'TTS_GPT_SOVITS_V2'; +update ai_model_config SET sort = 19 where id = 'TTS_TTS302AI'; +update ai_model_config SET sort = 20 where id = 'TTS_GizwitsTTS'; +update ai_model_config SET sort = 21 where id = 'TTS_VolcesAiGatewayTTS'; +update ai_model_config SET sort = 22 where id = 'TTS_ACGNTTS'; +update ai_model_config SET sort = 23 where id = 'TTS_CustomTTS'; + +UPDATE ai_model_config set model_name = '讯飞语音识别(流式)' where id = 'ASR_XunfeiStream'; +UPDATE ai_model_config set model_name = 'Qwen3Flash语音识别' where id = 'ASR_Qwen3Flash'; + +update ai_model_config SET sort = 2 where id = 'ASR_FunASRServer'; +update ai_model_config SET sort = 3 where id = 'ASR_XunfeiStream'; +update ai_model_config SET sort = 4 where id = 'ASR_AliyunStreamASR'; +update ai_model_config SET sort = 5 where id = 'ASR_DoubaoStreamASR'; +update ai_model_config SET sort = 6 where id = 'ASR_TencentASR'; +update ai_model_config SET sort = 7 where id = 'ASR_BaiduASR'; +update ai_model_config SET sort = 8 where id = 'ASR_DoubaoASR'; +update ai_model_config SET sort = 9 where id = 'ASR_AliyunASR'; +update ai_model_config SET sort = 10 where id = 'ASR_SherpaASR'; +update ai_model_config SET sort = 11 where id = 'ASR_OpenaiASR'; +update ai_model_config SET sort = 12 where id = 'ASR_GroqASR'; +update ai_model_config SET sort = 13 where id = 'ASR_VoskASR'; +update ai_model_config SET sort = 14 where id = 'ASR_Qwen3Flash'; + +UPDATE ai_model_config SET config_json='{\"type\": \"openai\", \"base_url\": \"https://ark.cn-beijing.volces.com/api/v3\", \"model_name\": \"doubao-1-5-pro-32k-250115\", \"api_key\": \"你的api_key\"}' where id = 'LLM_DoubaoLLM' AND config_json LIKE '%你的api_key"%'; \ No newline at end of file diff --git a/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml b/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml index c6f1a44e..3c14eb7f 100755 --- a/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml @@ -417,9 +417,9 @@ databaseChangeLog: encoding: utf8 path: classpath:db/changelog/202510251150.sql - changeSet: - id: 202511131020 + id: 202511131023 author: hrz changes: - sqlFile: encoding: utf8 - path: classpath:db/changelog/202511131020.sql \ No newline at end of file + path: classpath:db/changelog/202511131023.sql diff --git a/main/manager-api/src/main/resources/mapper/knowledge/KnowledgeBaseDao.xml b/main/manager-api/src/main/resources/mapper/knowledge/KnowledgeBaseDao.xml new file mode 100644 index 00000000..e85a9674 --- /dev/null +++ b/main/manager-api/src/main/resources/mapper/knowledge/KnowledgeBaseDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + DELETE FROM ai_agent_plugin_mapping + WHERE plugin_id = #{knowledgeBaseId} + + + \ No newline at end of file diff --git a/main/manager-web/src/components/KnowledgeBaseDialog.vue b/main/manager-web/src/components/KnowledgeBaseDialog.vue index a9ce84b5..6e72d2da 100644 --- a/main/manager-web/src/components/KnowledgeBaseDialog.vue +++ b/main/manager-web/src/components/KnowledgeBaseDialog.vue @@ -6,7 +6,7 @@ + type="textarea" :rows="4" maxlength="300" show-word-limit>