You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fu-hsi-service/src/main/java/com/supervision/chat/client/LangChainChatService.java

77 lines
3.3 KiB
Java

9 months ago
package com.supervision.chat.client;
import com.supervision.chat.client.dto.CreateBaseDTO;
9 months ago
import com.supervision.chat.client.dto.DeleteFileDTO;
9 months ago
import com.supervision.chat.client.dto.LangChainChatRes;
import com.supervision.chat.client.dto.chat.ChatReqDTO;
import com.supervision.chat.client.dto.chat.ChatResDTO;
import com.supervision.common.domain.R;
9 months ago
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
9 months ago
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.service.annotation.GetExchange;
9 months ago
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;
import java.util.List;
9 months ago
@HttpExchange
public interface LangChainChatService {
9 months ago
/**
*
* @param createBaseDTO
* @return
*/
@PostExchange(url = "/knowledge_base/create_knowledge_base", contentType = MediaType.APPLICATION_JSON_VALUE)
9 months ago
LangChainChatRes createBase(@RequestBody CreateBaseDTO createBaseDTO);
9 months ago
9 months ago
/**
*
* @param knowledge_base_name
* @param files ,multipartFile
* @param text_splitter_type
* @param to_vector_store true
* @param override false
* @param not_refresh_vs_cache false
* @param chunk_size 250
* @param chunk_overlap 50
* @param zh_title_enhance false
* @param docs {"test.txt":[{"page_content":"custom doc","metadata":{},"type":"Document"}]}
* @return
*/
@PostExchange(url = "/knowledge_base/upload_docs", contentType = MediaType.MULTIPART_FORM_DATA_VALUE)
9 months ago
LangChainChatRes uploadFile(@RequestPart String knowledge_base_name,
@RequestPart MultipartFile files,
@RequestPart String text_splitter_type,
9 months ago
@RequestPart Boolean to_vector_store,
@RequestPart Boolean override,
@RequestPart Boolean not_refresh_vs_cache,
9 months ago
@RequestPart Integer chunk_size,
@RequestPart Integer chunk_overlap,
9 months ago
@RequestPart Boolean zh_title_enhance,
9 months ago
@RequestPart String docs);
/**
*
* @param deleteFileDTO
* @return
*/
@PostExchange(url = "/knowledge_base/delete_docs", contentType = MediaType.APPLICATION_JSON_VALUE)
LangChainChatRes<Object> deleteFile(@RequestBody DeleteFileDTO deleteFileDTO);
9 months ago
@GetExchange(url = "/knowledge_base/list_files")
LangChainChatRes<List<String>> queryFileList(@RequestParam String knowledge_base_name);
@PostExchange(url = "/knowledge_base//delete_knowledge_base", contentType = MediaType.APPLICATION_JSON_VALUE)
LangChainChatRes<Object> deleteBase(@RequestBody String knowledge_base_name);
@PostExchange(url = "/chat/knowledge_base_chat", contentType = MediaType.APPLICATION_JSON_VALUE)
ChatResDTO chat(@RequestBody ChatReqDTO chatReq);
9 months ago
}