fix:智能体名称 (#749)

This commit is contained in:
hrz
2025-04-12 18:58:10 +08:00
committed by GitHub
parent 5d69ba0796
commit 2626e1ebf0
4 changed files with 43 additions and 28 deletions
@@ -60,6 +60,7 @@ public class ConfigServiceImpl implements ConfigService {
// 构建模块配置
buildModuleConfig(
agent.getAgentName(),
agent.getSystemPrompt(),
null,
agent.getVadModelId(),
@@ -122,6 +123,7 @@ public class ConfigServiceImpl implements ConfigService {
// 构建模块配置
buildModuleConfig(
agent.getAgentName(),
agent.getSystemPrompt(),
voice,
agent.getVadModelId(),
@@ -216,6 +218,7 @@ public class ConfigServiceImpl implements ConfigService {
* @param result 结果Map
*/
private void buildModuleConfig(
String assistantName,
String prompt,
String voice,
String vadModelId,
@@ -248,6 +251,9 @@ public class ConfigServiceImpl implements ConfigService {
selectedModule.put(modelTypes[i], model.getId());
}
result.put("selected_module", selectedModule);
if (StringUtils.isNotBlank(prompt)) {
prompt = prompt.replace("{{assistant_name}}", "小智");
}
result.put("prompt", prompt);
}
}
@@ -32,7 +32,7 @@ INSERT INTO `sys_params` (id, param_code, param_value, value_type, param_type, r
INSERT INTO `sys_params` (id, param_code, param_value, value_type, param_type, remark) VALUES (301, 'delete_audio', 'true', 'boolean', 1, '是否删除使用后的音频文件');
INSERT INTO `sys_params` (id, param_code, param_value, value_type, param_type, remark) VALUES (302, 'close_connection_no_voice_time', '120', 'number', 1, '无语音输入断开连接时间(秒)');
INSERT INTO `sys_params` (id, param_code, param_value, value_type, param_type, remark) VALUES (303, 'tts_timeout', '10', 'number', 1, 'TTS请求超时时间(秒)');
INSERT INTO `sys_params` (id, param_code, param_value, value_type, param_type, remark) VALUES (304, 'enable_wakeup_words_response_cache', 'true', 'boolean', 1, '是否开启唤醒词加速');
INSERT INTO `sys_params` (id, param_code, param_value, value_type, param_type, remark) VALUES (304, 'enable_wakeup_words_response_cache', 'false', 'boolean', 1, '是否开启唤醒词加速');
INSERT INTO `sys_params` (id, param_code, param_value, value_type, param_type, remark) VALUES (305, 'enable_greeting', 'true', 'boolean', 1, '是否开启开场回复');
INSERT INTO `sys_params` (id, param_code, param_value, value_type, param_type, remark) VALUES (306, 'enable_stop_tts_notify', 'false', 'boolean', 1, '是否开启结束提示音');
INSERT INTO `sys_params` (id, param_code, param_value, value_type, param_type, remark) VALUES (307, 'stop_tts_notify_voice', 'config/assets/tts_notify.mp3', 'string', 1, '结束提示音文件路径');
@@ -45,9 +45,9 @@ databaseChangeLog:
encoding: utf8
path: classpath:db/changelog/202504112044.sql
- changeSet:
id: 202504112057
id: 202504112058
author: John
changes:
- sqlFile:
encoding: utf8
path: classpath:db/changelog/202504112057.sql
path: classpath:db/changelog/202504112058.sql
+34 -25
View File
@@ -19,7 +19,8 @@
:header-cell-class-name="headerCellClassName">
<el-table-column label="选择" type="selection" align="center" width="120"></el-table-column>
<el-table-column label="参数编码" prop="paramCode" align="center"></el-table-column>
<el-table-column label="参数值" prop="paramValue" align="center"></el-table-column>
<el-table-column label="参数值" prop="paramValue" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="备注" prop="remark" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
@@ -61,7 +62,8 @@
</div>
<!-- 新增/编辑参数对话框 -->
<param-dialog :title="dialogTitle" :visible.sync="dialogVisible" :form="paramForm" @submit="handleSubmit" @cancel="dialogVisible = false"/>
<param-dialog :title="dialogTitle" :visible.sync="dialogVisible" :form="paramForm" @submit="handleSubmit"
@cancel="dialogVisible = false" />
<div class="copyright">©2025 xiaozhi-esp32-server</div>
</div>
@@ -509,36 +511,43 @@ export default {
}
@media (min-width: 1144px) {
.table_bottom {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 40px;
}
.table_bottom {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 40px;
}
:deep(.transparent-table) {
.el-table__body tr {
td {
padding-top: 16px;
padding-bottom: 16px;
}
:deep(.transparent-table) {
.el-table__body tr {
td {
padding-top: 16px;
padding-bottom: 16px;
}
& + tr {
margin-top: 10px;
}
&+tr {
margin-top: 10px;
}
}
}
}
}
:deep(.el-table .el-button--text) {
color: #7079aa;
}
:deep(.el-table .el-button--text:hover) {
:deep(.el-table .el-button--text) {
color: #7079aa;
}
:deep(.el-table .el-button--text:hover) {
color: #5a64b5;
}
}
.el-button--success {
.el-button--success {
background: #5bc98c;
color: white;
}
}
:deep(.el-table .cell) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>