fix(llm): 修复知识库问答中页面内容换行符问题

- 在提取页面内容后,添加了替换换行符的代码
- 将 pageContent 中的 \n 和 \r 替换为空字符串,避免在返回结果中显示换行符
This commit is contained in:
Liuyang 2025-03-05 17:15:46 +08:00
parent 511b99fe62
commit 35e19396e1

View File

@ -603,6 +603,7 @@ public class ConversationServiceImpl implements ConversationService {
// 提取页面内容
JSONObject content = firstResult.getJSONObject(0);
String pageContent = content.getString("page_content");
pageContent = pageContent.replace("\n", "").replace("\r", "");
log.info("{} 内容: {}", "[KnowledgeBase]", JSON.toJSONString(pageContent));
JSONObject metadata = content.getJSONObject("metadata");