refactor(module-llm):优化知识库查询代码

-将 jsonArray1 的类型从 JSONArray改为 com.alibaba.fastjson.JSONArray,避免类型转换错误
- 优化代码格式,提高可读性
This commit is contained in:
sunxiqing 2025-03-05 10:51:09 +08:00
parent 129aa3a366
commit 7a8eabe745

View File

@ -377,7 +377,7 @@ public class ConversationServiceImpl implements ConversationService {
String result = HttpUtils.post(llmBackendProperties.getEmbedQuery(), null, JSON.toJSONString(knowledgeRagEmbedQueryVO));
com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray(result);
if (jsonArray != null && !jsonArray.isEmpty()) {
JSONArray jsonArray1 = (JSONArray) jsonArray.get(0);
com.alibaba.fastjson.JSONArray jsonArray1 = (com.alibaba.fastjson.JSONArray) jsonArray.get(0);
JSONObject jsonObject = (JSONObject) jsonArray1.get(0);
knowledgeBase.append(jsonObject.get("page_content"));
}