fu-hsi-service/src/main/java/com/supervision/chat/client/LangChainChatService.java

62 lines
2.6 KiB
Java

package com.supervision.chat.client;
import com.supervision.chat.client.dto.CreateBaseDTO;
import com.supervision.chat.client.dto.DeleteFileDTO;
import com.supervision.chat.client.dto.LangChainChatRes;
import org.springframework.core.io.Resource;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;
@HttpExchange
public interface LangChainChatService {
/**
*
* @param createBaseDTO
* @return
*/
@PostExchange(url = "create_knowledge_base", contentType = MediaType.APPLICATION_JSON_VALUE)
LangChainChatRes createBase(@RequestBody CreateBaseDTO createBaseDTO);
/**
*
* @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 = "upload_docs", contentType = MediaType.MULTIPART_FORM_DATA_VALUE)
LangChainChatRes uploadFile(@RequestPart String knowledge_base_name,
@RequestPart MultipartFile files,
@RequestPart String text_splitter_type,
@RequestPart String to_vector_store,
@RequestPart String override,
@RequestPart String not_refresh_vs_cache,
@RequestPart Integer chunk_size,
@RequestPart Integer chunk_overlap,
@RequestPart String zh_title_enhance,
@RequestPart String docs);
/**
*
* @param deleteFileDTO
* @return
*/
@PostExchange(url = "delete_docs", contentType = MediaType.APPLICATION_JSON_VALUE)
LangChainChatRes deleteFile(@RequestBody DeleteFileDTO deleteFileDTO);
}