Commit a1e01f79 authored by alex yao's avatar alex yao

fix:【【POE】-【首页】移除插件后更新发布,首页的插件仍可以使用】 --bug=1009895

parent b9bc3a01
......@@ -99,11 +99,14 @@ public class BizAgentApplicationPublishConvert {
model.setTemperature(entity.getTemperature());
if (ArrayUtils.isNotEmpty(entity.getUnitIds())) {
model.setUnitIds(JsonUtil.toJson(entity.getUnitIds()));
} else {
model.setUnitIds(JsonUtil.toJson(new ArrayList<>()));
}
if (ObjectUtil.isNotEmpty(entity.getVoiceConfig())) {
model.setVoiceConfig(JsonUtils.serialize(entity.getVoiceConfig()));
} else {
model.setVoiceConfig(null);
}
model.setIsDeleted(entity.getIsDeleted());
model.setCreator(entity.getCreator());
model.setCreatedTime(entity.getCreatedTime());
......
......@@ -39,7 +39,7 @@ public class DocumentUnderstandIngFunction extends AbstractLargeModelFunction {
"## 用户问题\n" +
"${question}";
private final String DESC = "长文档内容理解,支持信息检索、摘要总结、文本分析能力。";
private final String DESC = "仅支持文档doc、docx、pdf、txt、md、xlsx、csv、xls,解析长文档内容理解,支持信息检索、摘要总结、文本分析能力,不可解析网页";
private final FunctionLLMConfig functionLLMConfig = new FunctionLLMConfig
.FunctionLLMConfigBuilder()
......@@ -61,8 +61,12 @@ public class DocumentUnderstandIngFunction extends AbstractLargeModelFunction {
String question = jsonObject.getString("question");
String fileUrl = jsonObject.getString("file_url");
File file = DocumentLoad.downloadURLDocument(fileUrl);
String documentContent = DocumentLoad.documentToText(file);
String documentContent;
try {
documentContent = DocumentLoad.documentToText(file);
} catch (Exception e) {
documentContent = StringUtils.EMPTY;
}
Message message = new Message();
message.setRole("user");
message.setContent(TEMPLATE.replace("${document_content}", documentContent).replace("${question}", question));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment