feat: rag的api
This commit is contained in:
34
ai-rag-api/src/main/java/com/storm/dev/api/IRAGService.java
Normal file
34
ai-rag-api/src/main/java/com/storm/dev/api/IRAGService.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package com.storm.dev.api;
|
||||
|
||||
import com.storm.dev.api.response.Response;
|
||||
import org.springframework.ai.chat.ChatResponse;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: lyd
|
||||
* @date: 2026/1/14 23:41
|
||||
*/
|
||||
public interface IRAGService {
|
||||
/**
|
||||
* 获取标签列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Response<List<String>> queryRagTagList();
|
||||
|
||||
/**
|
||||
* 上传知识库
|
||||
*
|
||||
* @param ragTag
|
||||
* @param files
|
||||
* @return
|
||||
*/
|
||||
Response<String> uploadFile(String ragTag, List<MultipartFile> files);
|
||||
|
||||
ChatResponse generateStreamRag(String model, String ragTag, String message);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.storm.dev.api.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Response<T> implements Serializable {
|
||||
|
||||
private String code;
|
||||
private String info;
|
||||
private T data;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user