|
|
@@ -147,6 +147,7 @@ public class SmsbDifyDatasetsFileServiceImpl implements ISmsbDifyDatasetsFileSer
|
|
|
// 发送请求
|
|
|
HttpResponse response = HttpRequest.post(requestUrl)
|
|
|
.header("Authorization", "Bearer " + datasetsApiKey)
|
|
|
+ .header("User-Agent","PostmanRuntime/7.26.8")
|
|
|
.form("data", requestBody)
|
|
|
.form("file", new File(tempLocalPath))
|
|
|
.execute();
|
|
|
@@ -259,7 +260,8 @@ public class SmsbDifyDatasetsFileServiceImpl implements ISmsbDifyDatasetsFileSer
|
|
|
// 1、 发送请求,请求删除知识库
|
|
|
String requestUrl = difyUrl + API_DATASETS_COMMON + "/" + datasetDifyId + "/documents/" + difyId;
|
|
|
HttpRequest request = HttpRequest.delete(requestUrl)
|
|
|
- .header("Authorization", "Bearer " + datasetsApiKey);
|
|
|
+ .header("Authorization", "Bearer " + datasetsApiKey)
|
|
|
+ .header("User-Agent","PostmanRuntime/7.26.8");
|
|
|
HttpResponse response = request.execute();
|
|
|
if (!response.isOk()) {
|
|
|
continue;
|
|
|
@@ -279,7 +281,8 @@ public class SmsbDifyDatasetsFileServiceImpl implements ISmsbDifyDatasetsFileSer
|
|
|
public boolean syncFileList(String datasetsDifyId) {
|
|
|
String requestUrl = difyUrl + API_DATASETS_COMMON + "/" + datasetsDifyId + "/documents?page=1&limit=100";
|
|
|
HttpRequest request = HttpRequest.get(requestUrl)
|
|
|
- .header("Authorization", "Bearer " + datasetsApiKey);
|
|
|
+ .header("Authorization", "Bearer " + datasetsApiKey)
|
|
|
+ .header("User-Agent","PostmanRuntime/7.26.8");
|
|
|
HttpResponse response = request.execute();
|
|
|
if (!response.isOk()) {
|
|
|
return false;
|