代码提交

topo_dev
liu 9 months ago
parent 3a7054ad0b
commit 266c704e37

@ -2,16 +2,32 @@ package com.supervision.chat.client;
import com.supervision.chat.client.dto.CreateBaseDTO;
import com.supervision.chat.client.dto.LangChainChatRes;
import org.springframework.core.io.Resource;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;
@HttpExchange
public interface LangChainChatService {
@PostExchange(url = "create_knowledge_base", contentType = "application/json")
@PostExchange(url = "create_knowledge_base", contentType = MediaType.APPLICATION_JSON_VALUE)
LangChainChatRes chat(@RequestBody CreateBaseDTO createBaseDTO);
@PostExchange(url = "upload_docs", contentType = MediaType.MULTIPART_FORM_DATA_VALUE)
void uploadFile(@RequestPart String knowledge_base_name,
@RequestPart Resource files,
@RequestPart String to_vector_store,
@RequestPart String override,
@RequestPart String not_refresh_vs_cache,
@RequestPart Integer chunk_size,
@RequestPart Integer chunk_overlap,
@RequestPart String zh_title_enhance,
@RequestPart String text_splitter_type,
@RequestPart String docs);
}

@ -293,6 +293,11 @@ public class ModelCaseServiceImpl extends ServiceImpl<ModelCaseMapper, ModelCase
atomic.setRecord("无");
}
}
record.setRecord("无");
// 遍历,atomic的record字段存在不为空,且不是无的,如果有,就是有
if (atomics.stream().anyMatch(atomic -> StrUtil.isNotBlank(atomic.getRecord()) && !StrUtil.equals("无", atomic.getRecord()))) {
record.setRecord("有");
}
record.setChildren(atomics);
}
iPage.setRecords(records);

Loading…
Cancel
Save