refactor(module-llm):优化知识库查询代码
-将 jsonArray1 的类型从 JSONArray改为 com.alibaba.fastjson.JSONArray,避免类型转换错误 - 优化代码格式,提高可读性
This commit is contained in:
parent
129aa3a366
commit
7a8eabe745
@ -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"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user