[前端+后端+RAG] 检索范围切换(当前文件/整个知识库);联网搜索功能(SearXNG);搜索结果带网络链接;修复RAG检索source格式不匹配bug
This commit is contained in:
@@ -247,6 +247,7 @@ public class SmartChatController extends BaseController {
|
||||
}
|
||||
|
||||
talkDto.setKnowledgeBaseNameList(knowledgeBaseNameList);
|
||||
talkDto.setWebSearch(smartChatQueryDto.getWebSearch());
|
||||
|
||||
talkDto.setQuery(chatMessages.getContent().replaceAll("\n", ""));
|
||||
talkDto.setStream(true);
|
||||
|
||||
@@ -35,4 +35,7 @@ public class SmartChatQueryDto {
|
||||
/* 用户请求类型 **/
|
||||
private Integer chatType;
|
||||
|
||||
/* 是否开启联网搜索 **/
|
||||
private Boolean webSearch;
|
||||
|
||||
}
|
||||
|
||||
@@ -46,6 +46,10 @@ public class SmartChatSelfDto {
|
||||
/* 用户请求类型 **/
|
||||
private Integer chatType;
|
||||
|
||||
/* 是否开启联网搜索 **/
|
||||
@JsonProperty("web_search")
|
||||
private Boolean webSearch;
|
||||
|
||||
public String toJsonString() {
|
||||
StringBuffer str = new StringBuffer();
|
||||
extracted(knowledgeBaseNameList, str);
|
||||
@@ -63,7 +67,7 @@ public class SmartChatSelfDto {
|
||||
", \"fileNames\":" + fileNameList +
|
||||
", \"quote\":\"" + ReplaceUtils.replaceHiddenChars(quote) + '\"' +
|
||||
", \"prompt_name\":\"" + promptName + '\"' +
|
||||
// ", \"use_model_self_response\":\"" + "False" + '\"' +
|
||||
", \"web_search\":" + (webSearch != null && webSearch ? "true" : "false") +
|
||||
'}';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user