mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
update:修复智能体选择的模型不存在导致的500错误 #1752
This commit is contained in:
parent
708621cbed
commit
d9f4fa41b7
1 changed files with 21 additions and 15 deletions
|
|
@ -298,14 +298,20 @@ public class ConfigServiceImpl implements ConfigService {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ModelConfigEntity model = modelConfigService.getModelById(modelIds[i], isCache);
|
ModelConfigEntity model = modelConfigService.getModelById(modelIds[i], isCache);
|
||||||
|
if (model == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Map<String, Object> typeConfig = new HashMap<>();
|
Map<String, Object> typeConfig = new HashMap<>();
|
||||||
if (model.getConfigJson() != null) {
|
if (model.getConfigJson() != null) {
|
||||||
typeConfig.put(model.getId(), model.getConfigJson());
|
typeConfig.put(model.getId(), model.getConfigJson());
|
||||||
// 如果是TTS类型,添加private_voice属性
|
// 如果是TTS类型,添加private_voice属性
|
||||||
if ("TTS".equals(modelTypes[i])) {
|
if ("TTS".equals(modelTypes[i])) {
|
||||||
if (voice != null) ((Map<String, Object>) model.getConfigJson()).put("private_voice", voice);
|
if (voice != null)
|
||||||
if (referenceAudio != null) ((Map<String, Object>) model.getConfigJson()).put("ref_audio", referenceAudio);
|
((Map<String, Object>) model.getConfigJson()).put("private_voice", voice);
|
||||||
if (referenceText != null) ((Map<String, Object>) model.getConfigJson()).put("ref_text", referenceText);
|
if (referenceAudio != null)
|
||||||
|
((Map<String, Object>) model.getConfigJson()).put("ref_audio", referenceAudio);
|
||||||
|
if (referenceText != null)
|
||||||
|
((Map<String, Object>) model.getConfigJson()).put("ref_text", referenceText);
|
||||||
}
|
}
|
||||||
// 如果是Intent类型,且type=intent_llm,则给他添加附加模型
|
// 如果是Intent类型,且type=intent_llm,则给他添加附加模型
|
||||||
if ("Intent".equals(modelTypes[i])) {
|
if ("Intent".equals(modelTypes[i])) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue