mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-30 03:33:56 +08:00
fix:设置默认记忆不是【无记忆】时,默认chatHistoryConf=2
This commit is contained in:
+16
-1
@@ -395,7 +395,22 @@ public class AgentServiceImpl extends BaseServiceImpl<AgentDao, AgentEntity> imp
|
|||||||
entity.setIntentModelId(template.getIntentModelId());
|
entity.setIntentModelId(template.getIntentModelId());
|
||||||
entity.setSystemPrompt(template.getSystemPrompt());
|
entity.setSystemPrompt(template.getSystemPrompt());
|
||||||
entity.setSummaryMemory(template.getSummaryMemory());
|
entity.setSummaryMemory(template.getSummaryMemory());
|
||||||
entity.setChatHistoryConf(template.getChatHistoryConf());
|
|
||||||
|
// 根据记忆模型类型设置默认的chatHistoryConf值
|
||||||
|
if (template.getMemModelId() != null) {
|
||||||
|
if (template.getMemModelId().equals("Memory_mem0ai")
|
||||||
|
|| template.getMemModelId().equals("Memory_mem_local_short")) {
|
||||||
|
// 当记忆模型是Memory_mem0ai或Memory_mem_local_short时,默认chatHistoryConf设为2
|
||||||
|
entity.setChatHistoryConf(2);
|
||||||
|
} else if (template.getMemModelId().equals("Memory_nomem")) {
|
||||||
|
entity.setChatHistoryConf(0);
|
||||||
|
} else {
|
||||||
|
entity.setChatHistoryConf(template.getChatHistoryConf());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
entity.setChatHistoryConf(template.getChatHistoryConf());
|
||||||
|
}
|
||||||
|
|
||||||
entity.setLangCode(template.getLangCode());
|
entity.setLangCode(template.getLangCode());
|
||||||
entity.setLanguage(template.getLanguage());
|
entity.setLanguage(template.getLanguage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -604,15 +604,14 @@ export default {
|
|||||||
if (type === "Intent" && value !== "Intent_nointent") {
|
if (type === "Intent" && value !== "Intent_nointent") {
|
||||||
this.fetchAllFunctions();
|
this.fetchAllFunctions();
|
||||||
}
|
}
|
||||||
if (type === "Memory" && value === "Memory_nomem") {
|
if (type === "Memory") {
|
||||||
this.form.chatHistoryConf = 0;
|
if (value === "Memory_nomem") {
|
||||||
}
|
this.form.chatHistoryConf = 0;
|
||||||
if (
|
} else if (value === "Memory_mem0ai" || value === "Memory_mem_local_short") {
|
||||||
type === "Memory" &&
|
this.form.chatHistoryConf = 2;
|
||||||
value !== "Memory_nomem" &&
|
} else if (this.form.chatHistoryConf === 0 || this.form.chatHistoryConf === null) {
|
||||||
(this.form.chatHistoryConf === 0 || this.form.chatHistoryConf === null)
|
this.form.chatHistoryConf = 2;
|
||||||
) {
|
}
|
||||||
this.form.chatHistoryConf = 2;
|
|
||||||
}
|
}
|
||||||
if (type === "LLM") {
|
if (type === "LLM") {
|
||||||
// 当LLM类型改变时,更新意图识别选项的可见性
|
// 当LLM类型改变时,更新意图识别选项的可见性
|
||||||
|
|||||||
Reference in New Issue
Block a user