Merge pull request #1218 from xinnan-tech/hot-fix

update:优化未开启记忆的聊天记录按钮样式
This commit is contained in:
欣南科技
2025-05-13 11:21:13 +08:00
committed by GitHub
3 changed files with 21 additions and 2 deletions
@@ -27,6 +27,9 @@ public class AgentDTO {
@Schema(description = "大语言模型名称", example = "llm_model_01")
private String llmModelName;
@Schema(description = "记忆模型ID", example = "mem_model_01")
private String memModelId;
@Schema(description = "角色设定参数", example = "你是一个专业的客服助手,负责回答用户问题并提供帮助")
private String systemPrompt;
@@ -102,6 +102,9 @@ public class AgentServiceImpl extends BaseServiceImpl<AgentDao, AgentEntity> imp
// 获取 LLM 模型名称
dto.setLlmModelName(modelConfigService.getModelNameById(agent.getLlmModelId()));
// 获取记忆模型名称
dto.setMemModelId(agent.getMemModelId());
// 获取 TTS 音色名称
dto.setTtsVoiceName(timbreModelService.getTimbreNameById(agent.getTtsVoiceId()));
+15 -2
View File
@@ -26,8 +26,12 @@
<div class="settings-btn" @click="handleDeviceManage">
设备管理({{ device.deviceCount }})
</div>
<div class="settings-btn" @click="handleChatHistory">
聊天记录
<div class="settings-btn" @click="handleChatHistory"
:class="{ 'disabled-btn': device.memModelId === 'Memory_nomem' }">
<el-tooltip v-if="device.memModelId === 'Memory_nomem'" content="未开启记忆" placement="top">
<span>聊天记录</span>
</el-tooltip>
<span v-else>聊天记录</span>
</div>
</div>
<div class="version-info">
@@ -77,6 +81,9 @@ export default {
this.$router.push({ path: '/device-management', query: { agentId: this.device.agentId } });
},
handleChatHistory() {
if (this.device.memModelId === 'Memory_nomem') {
return
}
this.$emit('chat-history', { agentId: this.device.agentId, agentName: this.device.agentName })
}
}
@@ -120,6 +127,12 @@ export default {
color: #979db1;
font-weight: 400;
}
.disabled-btn {
background: #e6e6e6;
color: #999;
cursor: not-allowed;
}
</style>
<style>