Merge remote-tracking branch 'xnjz/master'
This commit is contained in:
commit
fa2d624618
@ -169,6 +169,15 @@ public class HttpUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static String getBody(String url, Map<String, String> headers,String body) {
|
||||
try (HttpResponse response = HttpRequest.get(url)
|
||||
.addHeaders(headers)
|
||||
.body(body)
|
||||
.execute()) {
|
||||
return response.body();
|
||||
}
|
||||
}
|
||||
|
||||
public static String del(String url, Map<String, String> headers) {
|
||||
try (HttpResponse response = HttpRequest.delete(url)
|
||||
.addHeaders(headers)
|
||||
|
@ -4,6 +4,7 @@ package cn.iocoder.yudao.module.llm.service.http;
|
||||
import cn.iocoder.yudao.framework.common.util.http.HttpUtils;
|
||||
import cn.iocoder.yudao.module.llm.framework.backend.config.LLMBackendProperties;
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.RagEmbedReqVo;
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.RagQueryMultipleReqVo;
|
||||
import cn.iocoder.yudao.module.llm.service.http.vo.RagQueryReqVo;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
||||
@ -76,9 +77,9 @@ public class RagHttpService {
|
||||
/**
|
||||
* 支持多个文件id查询向量
|
||||
*/
|
||||
public String ragQueryMultiple(Map<String, String> headers){
|
||||
public String ragQueryMultiple(Map<String, String> headers, RagQueryMultipleReqVo ragQueryReqVo){
|
||||
String ragQueryMultiple = llmBackendProperties.getRagQueryMultiple();
|
||||
String res = HttpUtils.get(ragQueryMultiple, headers);
|
||||
String res = HttpUtils.getBody(ragQueryMultiple, headers, JSON.toJSONString(ragQueryReqVo));
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.llm.service.http.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class RagQueryMultipleReqVo {
|
||||
|
||||
private String query;
|
||||
|
||||
private List<String> file_ids;
|
||||
|
||||
private Integer k;
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user