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