|
|
|
@ -135,7 +135,7 @@ public class MaxKbImpl {
|
|
|
|
|
* @param documentId 文档id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static com.alibaba.fastjson.JSONObject delDocument(String authCode, String zskId, String documentId) {
|
|
|
|
|
public static JSONObject delDocument(String authCode, String zskId, String documentId) {
|
|
|
|
|
String url = baseUrl + "/api/dataset/" + zskId + "/document/" + documentId + "?dep=[object+Object]&__v_isRef=true&__v_isShallow=false&_rawValue=false&_value=false";
|
|
|
|
|
HttpResponse response = HttpRequest.delete(url)
|
|
|
|
|
.header("Accept", "application/json, text/plain, */*")
|
|
|
|
@ -146,7 +146,7 @@ public class MaxKbImpl {
|
|
|
|
|
.header("Content-Type", "application/json")
|
|
|
|
|
.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36")
|
|
|
|
|
.execute();
|
|
|
|
|
return com.alibaba.fastjson.JSONObject.parseObject(response.body());
|
|
|
|
|
return JSONObject.parseObject(response.body());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -158,9 +158,9 @@ public class MaxKbImpl {
|
|
|
|
|
* @param documentId 文档id
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public static com.alibaba.fastjson.JSONObject generateQuestion(String authCode, String zskId, String modelId, String documentId) {
|
|
|
|
|
public static JSONObject generateQuestion(String authCode, String zskId, String modelId, String documentId) {
|
|
|
|
|
String url = baseUrl + "/api/dataset/" + zskId + "/document/batch_generate_related";
|
|
|
|
|
com.alibaba.fastjson.JSONObject jo = new com.alibaba.fastjson.JSONObject();
|
|
|
|
|
JSONObject jo = new JSONObject();
|
|
|
|
|
jo.put("model_id", modelId);
|
|
|
|
|
jo.put("prompt", "内容:{data}\\n\\n请总结上面的内容,并根据内容总结生成 5 个问题。\\n回答要求:\\n- 请只输出问题;\\n- 请将每个问题放置<question></question>标签中。");
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
@ -174,7 +174,7 @@ public class MaxKbImpl {
|
|
|
|
|
.header("Connection", "keep-alive")
|
|
|
|
|
.header("Content-Type", "application/json")
|
|
|
|
|
.body(jo.toJSONString()).execute();
|
|
|
|
|
return com.alibaba.fastjson.JSONObject.parseObject(response.body());
|
|
|
|
|
return JSONObject.parseObject(response.body());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|