mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 15:13:55 +08:00
格式调整
This commit is contained in:
+5
-8
@@ -371,12 +371,12 @@ public class ConfigServiceImpl implements ConfigService {
|
||||
Map<String, Object> result,
|
||||
boolean isCache) {
|
||||
Map<String, String> selectedModule = new HashMap<>();
|
||||
|
||||
|
||||
String[] modelTypes = { "VAD", "ASR", "TTS", "Memory", "Intent", "LLM", "VLLM" };
|
||||
String[] modelIds = { vadModelId, asrModelId, ttsModelId, memModelId, intentModelId, llmModelId, vllmModelId };
|
||||
String intentLLMModelId = null;
|
||||
String memLocalShortLLMModelId = null;
|
||||
|
||||
|
||||
for (int i = 0; i < modelIds.length; i++) {
|
||||
if (modelIds[i] == null) {
|
||||
continue;
|
||||
@@ -390,17 +390,14 @@ public class ConfigServiceImpl implements ConfigService {
|
||||
// 复制一份配置,避免修改原始数据
|
||||
JSONObject configJsonCopy = new JSONObject(model.getConfigJson());
|
||||
|
||||
// 对敏感数据进行隐藏处理
|
||||
JSONObject maskedConfigJson = SensitiveDataUtils.maskSensitiveFields(configJsonCopy);
|
||||
|
||||
typeConfig.put(model.getId(), maskedConfigJson);
|
||||
typeConfig.put(model.getId(), configJsonCopy);
|
||||
|
||||
}
|
||||
result.put(modelTypes[i], typeConfig);
|
||||
|
||||
|
||||
selectedModule.put(modelTypes[i], model.getId());
|
||||
}
|
||||
|
||||
|
||||
result.put("selected_module", selectedModule);
|
||||
if (StringUtils.isNotBlank(prompt)) {
|
||||
prompt = prompt.replace("{{assistant_name}}", StringUtils.isBlank(assistantName) ? "小智" : assistantName);
|
||||
|
||||
+2
-2
@@ -138,7 +138,7 @@ public class ModelConfigServiceImpl extends BaseServiceImpl<ModelConfigDao, Mode
|
||||
throw new RenException(ErrorCode.INVALID_LLM_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 再更新供应器提供的模型
|
||||
ModelConfigEntity modelConfigEntity = ConvertUtils.sourceToTarget(modelConfigBodyDTO, ModelConfigEntity.class);
|
||||
modelConfigEntity.setId(id);
|
||||
@@ -175,7 +175,7 @@ public class ModelConfigServiceImpl extends BaseServiceImpl<ModelConfigDao, Mode
|
||||
public ModelConfigDTO add(String modelType, String provideCode, ModelConfigBodyDTO modelConfigBodyDTO) {
|
||||
// 先验证有没有供应器
|
||||
if (StringUtils.isBlank(modelType) || StringUtils.isBlank(provideCode)) {
|
||||
throw new RenException("modelType和provideCode不能为空");
|
||||
throw new RenException(ErrorCode.MODEL_TYPE_PROVIDE_CODE_NOT_NULL);
|
||||
}
|
||||
List<ModelProviderDTO> providerList = modelProviderService.getList(modelType, provideCode);
|
||||
if (CollectionUtil.isEmpty(providerList)) {
|
||||
|
||||
Reference in New Issue
Block a user