新增AI云文档目录表、AI云文件表
This commit is contained in:
@@ -12,10 +12,12 @@ import com.gxwebsoft.ai.constants.KnowledgeBaseConstants;
|
||||
import com.gxwebsoft.ai.dto.KnowledgeBaseRequest;
|
||||
import com.gxwebsoft.ai.factory.KnowledgeBaseClientFactory;
|
||||
import com.gxwebsoft.ai.service.KnowledgeBaseService;
|
||||
import com.gxwebsoft.ai.util.AiCloudKnowledgeBaseUtil;
|
||||
import com.gxwebsoft.ai.util.KnowledgeBaseUploader;
|
||||
import com.gxwebsoft.ai.util.KnowledgeBaseUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -156,5 +158,18 @@ public class KnowledgeBaseServiceImpl implements KnowledgeBaseService {
|
||||
throw new RuntimeException("上传文档到知识库失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Async
|
||||
@Override
|
||||
public void submitDocuments(String kbId, String fileId) {
|
||||
String workspaceId = config.getWorkspaceId();
|
||||
try {
|
||||
Client client = clientFactory.createClient();
|
||||
AiCloudKnowledgeBaseUtil.submitIndexAddDocumentsJob(client, workspaceId, kbId, fileId);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("添加文档到知识库失败: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user