mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-05-27 03:05:59 +08:00
Refactor: Standardize naming convention to camelCase (#14079)
### What problem does this PR solve? Refactor: Standardize naming convention to camelCase ### Type of change - [x] Refactoring
This commit is contained in:
@ -494,7 +494,7 @@ export function useUploadAndParseFile() {
|
||||
|
||||
const { data } = await chatService.uploadAndParse(
|
||||
{
|
||||
url: api.upload_and_parse,
|
||||
url: api.uploadAndParse,
|
||||
signal: controller.current.signal,
|
||||
data: formData,
|
||||
onUploadProgress: ({ progress }) => {
|
||||
|
||||
@ -47,7 +47,7 @@ export const useDeleteChunk = () => {
|
||||
} = useMutation({
|
||||
mutationKey: ['deleteChunk'],
|
||||
mutationFn: async (params: { chunkIds: string[]; doc_id: string }) => {
|
||||
const { data } = await kbService.rm_chunk(params);
|
||||
const { data } = await kbService.rmChunk(params);
|
||||
if (data.code === 0) {
|
||||
setPaginationParams(1);
|
||||
queryClient.invalidateQueries({ queryKey: ['fetchChunkList'] });
|
||||
@ -70,9 +70,9 @@ export const useCreateChunk = () => {
|
||||
} = useMutation({
|
||||
mutationKey: ['createChunk'],
|
||||
mutationFn: async (payload: any) => {
|
||||
let service = kbService.create_chunk;
|
||||
let service = kbService.createChunk;
|
||||
if (payload.chunk_id) {
|
||||
service = kbService.set_chunk;
|
||||
service = kbService.setChunk;
|
||||
}
|
||||
const { data } = await service(payload);
|
||||
if (data.code === 0) {
|
||||
@ -95,7 +95,7 @@ export const useFetchChunk = (chunkId?: string): ResponseType<any> => {
|
||||
initialData: {},
|
||||
gcTime: 0,
|
||||
queryFn: async () => {
|
||||
const data = await kbService.get_chunk({
|
||||
const data = await kbService.getChunk({
|
||||
chunk_id: chunkId,
|
||||
});
|
||||
|
||||
@ -138,7 +138,7 @@ export const useFetchNextChunkList = (
|
||||
gcTime: 0,
|
||||
enabled,
|
||||
queryFn: async () => {
|
||||
const { data } = await kbService.chunk_list({
|
||||
const { data } = await kbService.chunkList({
|
||||
doc_id: documentId,
|
||||
page: pagination.current,
|
||||
size: pagination.pageSize,
|
||||
@ -206,7 +206,7 @@ export const useSwitchChunk = () => {
|
||||
available_int?: number;
|
||||
doc_id: string;
|
||||
}) => {
|
||||
const { data } = await kbService.switch_chunk(params);
|
||||
const { data } = await kbService.switchChunk(params);
|
||||
if (data.code === 0) {
|
||||
message.success(t('message.modified'));
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ export const useUploadNextDocument = () => {
|
||||
});
|
||||
|
||||
try {
|
||||
const ret = await kbService.document_upload(formData);
|
||||
const ret = await kbService.documentUpload(formData);
|
||||
const code = get(ret, 'data.code');
|
||||
|
||||
if (code === 0 || code === 500) {
|
||||
@ -93,7 +93,7 @@ export const useUploadNextDocument = () => {
|
||||
return { uploadDocument: mutateAsync, loading, data };
|
||||
};
|
||||
|
||||
export const useFetchDocumentList = () => {
|
||||
export const useFetchDocumentList = (loop = true) => {
|
||||
const { knowledgeId } = useGetKnowledgeSearchParams();
|
||||
const { searchString, handleInputChange } = useHandleSearchChange();
|
||||
const { pagination, setPagination } = useGetPaginationWithRouter();
|
||||
@ -103,9 +103,10 @@ export const useFetchDocumentList = () => {
|
||||
const { filterValue, handleFilterSubmit, checkValue } =
|
||||
useHandleFilterSubmit();
|
||||
const [docs, setDocs] = useState<IDocumentInfo[]>([]);
|
||||
|
||||
const isLoop = useMemo(() => {
|
||||
return docs.some((doc) => doc.run === '1');
|
||||
}, [docs]);
|
||||
return loop && docs.some((doc) => doc.run === '1');
|
||||
}, [docs, loop]);
|
||||
|
||||
const { data, isFetching: loading } = useQuery<{
|
||||
docs: IDocumentInfo[];
|
||||
@ -245,7 +246,7 @@ export const useSetDocumentStatus = () => {
|
||||
documentId: string | string[];
|
||||
}) => {
|
||||
const ids = Array.isArray(documentId) ? documentId : [documentId];
|
||||
const { data } = await kbService.document_change_status({
|
||||
const { data } = await kbService.documentChangeStatus({
|
||||
doc_ids: ids,
|
||||
status: Number(status),
|
||||
});
|
||||
@ -284,7 +285,7 @@ export const useRunDocument = () => {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [DocumentApiAction.FetchDocumentList],
|
||||
});
|
||||
const ret = await kbService.document_run({
|
||||
const ret = await kbService.documentRun({
|
||||
doc_ids: documentIds,
|
||||
run,
|
||||
...(option || {}),
|
||||
@ -313,7 +314,7 @@ export const useRemoveDocument = () => {
|
||||
} = useMutation({
|
||||
mutationKey: [DocumentApiAction.RemoveDocument],
|
||||
mutationFn: async (documentIds: string | string[]) => {
|
||||
const { data } = await kbService.document_rm({ doc_id: documentIds });
|
||||
const { data } = await kbService.documentRm({ doc_id: documentIds });
|
||||
if (data.code === 0) {
|
||||
message.success(i18n.t('message.deleted'));
|
||||
queryClient.invalidateQueries({
|
||||
@ -381,7 +382,7 @@ export const useSetDocumentParser = () => {
|
||||
documentId: string;
|
||||
parserConfig: IChangeParserConfigRequestBody;
|
||||
}) => {
|
||||
const { data } = await kbService.document_change_parser({
|
||||
const { data } = await kbService.documentChangeParser({
|
||||
parser_id: parserId,
|
||||
pipeline_id: pipelineId,
|
||||
doc_id: documentId,
|
||||
@ -446,7 +447,7 @@ export const useCreateDocument = () => {
|
||||
} = useMutation({
|
||||
mutationKey: [DocumentApiAction.CreateDocument],
|
||||
mutationFn: async (name: string) => {
|
||||
const { data } = await kbService.document_create({
|
||||
const { data } = await kbService.documentCreate({
|
||||
name,
|
||||
kb_id: id,
|
||||
});
|
||||
@ -518,7 +519,7 @@ export const useNextWebCrawl = () => {
|
||||
formData.append('url', url);
|
||||
formData.append('kb_id', knowledgeId);
|
||||
|
||||
const ret = await kbService.web_crawl(formData);
|
||||
const ret = await kbService.webCrawl(formData);
|
||||
const code = get(ret, 'data.code');
|
||||
if (code === 0) {
|
||||
message.success(i18n.t('message.uploaded'));
|
||||
@ -542,7 +543,7 @@ export const useFetchDocumentThumbnailsByIds = () => {
|
||||
enabled: ids.length > 0,
|
||||
initialData: {},
|
||||
queryFn: async () => {
|
||||
const { data } = await kbService.document_thumbnails({ doc_ids: ids });
|
||||
const { data } = await kbService.documentThumbnails({ doc_ids: ids });
|
||||
if (data.code === 0) {
|
||||
return data.data;
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ export const useTestRetrieval = () => {
|
||||
|
||||
const mutation = useMutation<INextTestingResult, Error, typeof queryParams>({
|
||||
mutationFn: async (params) => {
|
||||
const { data } = await kbService.retrieval_test(params);
|
||||
const { data } = await kbService.retrievalTest(params);
|
||||
const result = data?.data ?? {};
|
||||
return { ...result, isRuned: true };
|
||||
},
|
||||
@ -406,7 +406,7 @@ export const useFetchKnowledgeBaseConfiguration = (props?: {
|
||||
gcTime: 0,
|
||||
queryFn: async () => {
|
||||
if (isEdit) {
|
||||
const { data } = await kbService.get_kb_detail({
|
||||
const { data } = await kbService.getKbDetail({
|
||||
kb_id: knowledgeBaseId,
|
||||
});
|
||||
return data?.data ?? {};
|
||||
@ -621,7 +621,7 @@ export const useTestChunkRetrieval = (): ResponsePostType<ITestingResult> & {
|
||||
mutationKey: ['testChunk'], // This method is invalid
|
||||
gcTime: 0,
|
||||
mutationFn: async (values: any) => {
|
||||
const { data } = await kbService.retrieval_test({
|
||||
const { data } = await kbService.retrievalTest({
|
||||
...values,
|
||||
kb_id: values.kb_id ?? knowledgeBaseId,
|
||||
page,
|
||||
@ -665,7 +665,7 @@ export const useTestChunkAllRetrieval = (): ResponsePostType<ITestingResult> & {
|
||||
mutationKey: ['testChunkAll'], // This method is invalid
|
||||
gcTime: 0,
|
||||
mutationFn: async (values: any) => {
|
||||
const { data } = await kbService.retrieval_test({
|
||||
const { data } = await kbService.retrievalTest({
|
||||
...values,
|
||||
kb_id: values.kb_id ?? knowledgeBaseId,
|
||||
doc_ids: [],
|
||||
|
||||
@ -40,7 +40,7 @@ export const useFetchLlmList = (modelType?: LlmModelType) => {
|
||||
queryKey: [LLMApiAction.LlmList],
|
||||
initialData: {},
|
||||
queryFn: async () => {
|
||||
const { data } = await userService.llm_list({ model_type: modelType });
|
||||
const { data } = await userService.llmList({ model_type: modelType });
|
||||
|
||||
return data?.data ?? {};
|
||||
},
|
||||
@ -191,7 +191,7 @@ export const useFetchLlmFactoryList = (): ResponseGetType<IFactory[]> => {
|
||||
initialData: [],
|
||||
gcTime: 0,
|
||||
queryFn: async () => {
|
||||
const { data } = await userService.factories_list();
|
||||
const { data } = await userService.factoriesList();
|
||||
|
||||
return data?.data ?? [];
|
||||
},
|
||||
@ -210,7 +210,7 @@ export const useFetchMyLlmList = (): ResponseGetType<
|
||||
initialData: {},
|
||||
gcTime: 0,
|
||||
queryFn: async () => {
|
||||
const { data } = await userService.my_llm();
|
||||
const { data } = await userService.myLlm();
|
||||
|
||||
return data?.data ?? {};
|
||||
},
|
||||
@ -227,7 +227,7 @@ export const useFetchMyLlmListDetailed = (): ResponseGetType<
|
||||
initialData: {},
|
||||
gcTime: 0,
|
||||
queryFn: async () => {
|
||||
const { data } = await userService.my_llm({ include_details: true });
|
||||
const { data } = await userService.myLlm({ include_details: true });
|
||||
|
||||
return data?.data ?? {};
|
||||
},
|
||||
@ -285,7 +285,7 @@ export const useSaveApiKey = () => {
|
||||
} = useMutation({
|
||||
mutationKey: [LLMApiAction.SaveApiKey],
|
||||
mutationFn: async (params: IApiKeySavingParams) => {
|
||||
const { data } = await userService.set_api_key(params);
|
||||
const { data } = await userService.setApiKey(params);
|
||||
if (data.code === 0) {
|
||||
// message.success(t('message.modified'));
|
||||
queryClient.invalidateQueries({ queryKey: [LLMApiAction.MyLlmList] });
|
||||
@ -319,7 +319,7 @@ export const useSaveTenantInfo = () => {
|
||||
} = useMutation({
|
||||
mutationKey: [LLMApiAction.SaveTenantInfo],
|
||||
mutationFn: async (params: ISystemModelSettingSavingParams) => {
|
||||
const { data } = await userService.set_tenant_info(params);
|
||||
const { data } = await userService.setTenantInfo(params);
|
||||
if (data.code === 0) {
|
||||
message.success(t('message.modified'));
|
||||
}
|
||||
@ -340,7 +340,7 @@ export const useAddLlm = () => {
|
||||
} = useMutation({
|
||||
mutationKey: [LLMApiAction.AddLlm],
|
||||
mutationFn: async (params: IAddLlmRequestBody & { verify?: boolean }) => {
|
||||
const { data } = await userService.add_llm(params);
|
||||
const { data } = await userService.addLlm(params);
|
||||
if (data.code === 0 && !params.verify) {
|
||||
queryClient.invalidateQueries({ queryKey: [LLMApiAction.MyLlmList] });
|
||||
queryClient.invalidateQueries({
|
||||
@ -367,7 +367,7 @@ export const useDeleteLlm = () => {
|
||||
} = useMutation({
|
||||
mutationKey: [LLMApiAction.DeleteLlm],
|
||||
mutationFn: async (params: IDeleteLlmRequestBody) => {
|
||||
const { data } = await userService.delete_llm(params);
|
||||
const { data } = await userService.deleteLlm(params);
|
||||
if (data.code === 0) {
|
||||
queryClient.invalidateQueries({ queryKey: [LLMApiAction.MyLlmList] });
|
||||
queryClient.invalidateQueries({
|
||||
@ -398,7 +398,7 @@ export const useEnableLlm = () => {
|
||||
status?: 1 | 0;
|
||||
} = { ...params, status: params.enable ? 1 : 0 };
|
||||
delete reqParam.enable;
|
||||
const { data } = await userService.enable_llm(reqParam);
|
||||
const { data } = await userService.enableLlm(reqParam);
|
||||
if (data.code === 0) {
|
||||
queryClient.invalidateQueries({ queryKey: [LLMApiAction.MyLlmList] });
|
||||
queryClient.invalidateQueries({
|
||||
|
||||
@ -50,7 +50,7 @@ export const useFetchUserInfo = (): ResponseGetType<IUserInfo> => {
|
||||
initialData: {},
|
||||
gcTime: 0,
|
||||
queryFn: async () => {
|
||||
const { data } = await userService.user_info();
|
||||
const { data } = await userService.userInfo();
|
||||
|
||||
if (data.code === 0) {
|
||||
const targetLng =
|
||||
@ -79,7 +79,7 @@ export const useFetchTenantInfo = (
|
||||
initialData: {},
|
||||
gcTime: 0,
|
||||
queryFn: async () => {
|
||||
const { data: res } = await userService.get_tenant_info();
|
||||
const { data: res } = await userService.getTenantInfo();
|
||||
if (res.code === 0) {
|
||||
// llm_id is chat_id
|
||||
// asr_id is speech2txt
|
||||
|
||||
@ -136,7 +136,7 @@ const FileLogsPage: FC = () => {
|
||||
const { data: topData } = useFetchOverviewTital();
|
||||
const {
|
||||
pagination: { total: fileTotal },
|
||||
} = useFetchDocumentList();
|
||||
} = useFetchDocumentList(false);
|
||||
|
||||
useEffect(() => {
|
||||
setTopAllData((prev) => {
|
||||
|
||||
@ -139,7 +139,7 @@ export const useTestChunkRetrieval = (
|
||||
const shared_id = searchParams.get('shared_id');
|
||||
const retrievalTestFunc = shared_id
|
||||
? kbService.retrievalTestShare
|
||||
: kbService.retrieval_test;
|
||||
: kbService.retrievalTest;
|
||||
const {
|
||||
data,
|
||||
isPending: loading,
|
||||
@ -190,7 +190,7 @@ export const useTestChunkAllRetrieval = (
|
||||
const shared_id = searchParams.get('shared_id');
|
||||
const retrievalTestFunc = shared_id
|
||||
? kbService.retrievalTestShare
|
||||
: kbService.retrieval_test;
|
||||
: kbService.retrievalTest;
|
||||
const {
|
||||
data,
|
||||
isPending: loading,
|
||||
|
||||
@ -9,30 +9,30 @@ import registerServer from '@/utils/register-server';
|
||||
import request, { post } from '@/utils/request';
|
||||
|
||||
const {
|
||||
create_kb,
|
||||
rm_kb,
|
||||
get_kb_detail,
|
||||
kb_list,
|
||||
get_document_list,
|
||||
document_change_status,
|
||||
document_rm,
|
||||
document_delete,
|
||||
document_create,
|
||||
document_change_parser,
|
||||
document_thumbnails,
|
||||
chunk_list,
|
||||
create_chunk,
|
||||
set_chunk,
|
||||
get_chunk,
|
||||
switch_chunk,
|
||||
rm_chunk,
|
||||
retrieval_test,
|
||||
document_rename,
|
||||
document_run,
|
||||
document_upload,
|
||||
web_crawl,
|
||||
knowledge_graph,
|
||||
document_infos,
|
||||
createKb,
|
||||
rmKb,
|
||||
getKbDetail,
|
||||
kbList,
|
||||
getDocumentList,
|
||||
documentChangeStatus,
|
||||
documentRm,
|
||||
documentDelete,
|
||||
documentCreate,
|
||||
documentChangeParser,
|
||||
documentThumbnails,
|
||||
chunkList,
|
||||
createChunk,
|
||||
setChunk,
|
||||
getChunk,
|
||||
switchChunk,
|
||||
rmChunk,
|
||||
retrievalTest,
|
||||
documentRename,
|
||||
documentRun,
|
||||
documentUpload,
|
||||
webCrawl,
|
||||
knowledgeGraph,
|
||||
documentInfos,
|
||||
listTagByKnowledgeIds,
|
||||
setMeta,
|
||||
getMeta,
|
||||
@ -40,71 +40,71 @@ const {
|
||||
getKnowledgeBasicInfo,
|
||||
fetchDataPipelineLog,
|
||||
fetchPipelineDatasetLogs,
|
||||
check_embedding,
|
||||
checkEmbedding,
|
||||
kbUpdateMetaData,
|
||||
documentUpdateMetaData,
|
||||
} = api;
|
||||
|
||||
const methods = {
|
||||
createKb: {
|
||||
url: create_kb,
|
||||
url: createKb,
|
||||
method: 'post',
|
||||
},
|
||||
rmKb: {
|
||||
url: rm_kb,
|
||||
url: rmKb,
|
||||
method: 'delete',
|
||||
},
|
||||
get_kb_detail: {
|
||||
url: get_kb_detail,
|
||||
getKbDetail: {
|
||||
url: getKbDetail,
|
||||
method: 'get',
|
||||
},
|
||||
getList: {
|
||||
url: kb_list,
|
||||
url: kbList,
|
||||
method: 'get',
|
||||
},
|
||||
// document manager
|
||||
get_document_list: {
|
||||
url: get_document_list,
|
||||
getDocumentList: {
|
||||
url: getDocumentList,
|
||||
method: 'get',
|
||||
},
|
||||
document_change_status: {
|
||||
url: document_change_status,
|
||||
documentChangeStatus: {
|
||||
url: documentChangeStatus,
|
||||
method: 'post',
|
||||
},
|
||||
document_rm: {
|
||||
url: document_rm,
|
||||
documentRm: {
|
||||
url: documentRm,
|
||||
method: 'post',
|
||||
},
|
||||
document_rename: {
|
||||
url: document_rename,
|
||||
documentRename: {
|
||||
url: documentRename,
|
||||
method: 'put',
|
||||
},
|
||||
document_create: {
|
||||
url: document_create,
|
||||
documentCreate: {
|
||||
url: documentCreate,
|
||||
method: 'post',
|
||||
},
|
||||
document_run: {
|
||||
url: document_run,
|
||||
documentRun: {
|
||||
url: documentRun,
|
||||
method: 'post',
|
||||
},
|
||||
document_change_parser: {
|
||||
url: document_change_parser,
|
||||
documentChangeParser: {
|
||||
url: documentChangeParser,
|
||||
method: 'post',
|
||||
},
|
||||
document_thumbnails: {
|
||||
url: document_thumbnails,
|
||||
documentThumbnails: {
|
||||
url: documentThumbnails,
|
||||
method: 'get',
|
||||
},
|
||||
document_upload: {
|
||||
url: document_upload,
|
||||
documentUpload: {
|
||||
url: documentUpload,
|
||||
method: 'post',
|
||||
},
|
||||
web_crawl: {
|
||||
url: web_crawl,
|
||||
webCrawl: {
|
||||
url: webCrawl,
|
||||
method: 'post',
|
||||
},
|
||||
document_infos: {
|
||||
url: document_infos,
|
||||
documentInfos: {
|
||||
url: documentInfos,
|
||||
method: 'post',
|
||||
},
|
||||
setMeta: {
|
||||
@ -112,40 +112,40 @@ const methods = {
|
||||
method: 'post',
|
||||
},
|
||||
// chunk管理
|
||||
chunk_list: {
|
||||
url: chunk_list,
|
||||
chunkList: {
|
||||
url: chunkList,
|
||||
method: 'post',
|
||||
},
|
||||
create_chunk: {
|
||||
url: create_chunk,
|
||||
createChunk: {
|
||||
url: createChunk,
|
||||
method: 'post',
|
||||
},
|
||||
set_chunk: {
|
||||
url: set_chunk,
|
||||
setChunk: {
|
||||
url: setChunk,
|
||||
method: 'post',
|
||||
},
|
||||
get_chunk: {
|
||||
url: get_chunk,
|
||||
getChunk: {
|
||||
url: getChunk,
|
||||
method: 'get',
|
||||
},
|
||||
switch_chunk: {
|
||||
url: switch_chunk,
|
||||
switchChunk: {
|
||||
url: switchChunk,
|
||||
method: 'post',
|
||||
},
|
||||
rm_chunk: {
|
||||
url: rm_chunk,
|
||||
rmChunk: {
|
||||
url: rmChunk,
|
||||
method: 'post',
|
||||
},
|
||||
retrieval_test: {
|
||||
url: retrieval_test,
|
||||
retrievalTest: {
|
||||
url: retrievalTest,
|
||||
method: 'post',
|
||||
},
|
||||
knowledge_graph: {
|
||||
url: knowledge_graph,
|
||||
knowledgeGraph: {
|
||||
url: knowledgeGraph,
|
||||
method: 'get',
|
||||
},
|
||||
document_delete: {
|
||||
url: document_delete,
|
||||
documentDelete: {
|
||||
url: documentDelete,
|
||||
method: 'delete',
|
||||
},
|
||||
listTagByKnowledgeIds: {
|
||||
@ -153,7 +153,7 @@ const methods = {
|
||||
method: 'get',
|
||||
},
|
||||
documentFilter: {
|
||||
url: api.get_dataset_filter,
|
||||
url: api.getDatasetFilter,
|
||||
method: 'post',
|
||||
},
|
||||
getMeta: {
|
||||
@ -176,8 +176,8 @@ const methods = {
|
||||
url: fetchPipelineDatasetLogs,
|
||||
method: 'post',
|
||||
},
|
||||
get_pipeline_detail: {
|
||||
url: api.get_pipeline_detail,
|
||||
getPipelineDetail: {
|
||||
url: api.getPipelineDetail,
|
||||
method: 'get',
|
||||
},
|
||||
|
||||
@ -187,7 +187,7 @@ const methods = {
|
||||
},
|
||||
|
||||
checkEmbedding: {
|
||||
url: check_embedding,
|
||||
url: checkEmbedding,
|
||||
method: 'post',
|
||||
},
|
||||
kbUpdateMetaData: {
|
||||
@ -226,10 +226,10 @@ export function deleteKnowledgeGraph(knowledgeId: string) {
|
||||
}
|
||||
|
||||
export const listDataset = (params?: IFetchKnowledgeListRequestParams) =>
|
||||
request.get(api.kb_list, { params });
|
||||
request.get(api.kbList, { params });
|
||||
|
||||
export const updateKb = (datasetId: string, data: Record<string, any>) =>
|
||||
request.put(api.update_kb(datasetId), { data });
|
||||
request.put(api.updateKb(datasetId), { data });
|
||||
|
||||
export const runGraphRag = (datasetId: string) =>
|
||||
request.post(api.runGraphRag(datasetId));
|
||||
@ -246,16 +246,16 @@ export const traceRaptor = (datasetId: string) =>
|
||||
export const listDocument = (
|
||||
params?: IFetchKnowledgeListRequestParams,
|
||||
body?: IFetchDocumentListRequestBody,
|
||||
) => request.post(api.get_document_list, { data: body || {}, params });
|
||||
) => request.post(api.getDocumentList, { data: body || {}, params });
|
||||
|
||||
export const documentFilter = (kb_id: string) =>
|
||||
request.post(api.get_dataset_filter, { kb_id });
|
||||
request.post(api.getDatasetFilter, { kb_id });
|
||||
|
||||
export const renameDocument = (
|
||||
datasetId: string,
|
||||
documentId: string,
|
||||
data: { name?: string },
|
||||
) => request.put(api.document_rename(datasetId, documentId), { data });
|
||||
) => request.put(api.documentRename(datasetId, documentId), { data });
|
||||
|
||||
export const getMetaDataService = ({
|
||||
kb_id,
|
||||
@ -282,7 +282,10 @@ export const listDataPipelineLogDocument = (
|
||||
body?: IFetchDocumentListRequestBody,
|
||||
) => request.post(api.fetchDataPipelineLog, { data: body || {}, params });
|
||||
export const listPipelineDatasetLogs = (
|
||||
params?: IFetchKnowledgeListRequestParams,
|
||||
params?: IFetchKnowledgeListRequestParams & {
|
||||
kb_id?: string;
|
||||
keywords?: string;
|
||||
},
|
||||
body?: IFetchDocumentListRequestBody,
|
||||
) => request.post(api.fetchPipelineDatasetLogs, { data: body || {}, params });
|
||||
|
||||
|
||||
@ -20,7 +20,7 @@ const {
|
||||
ask,
|
||||
chatsMindmap,
|
||||
chatsRelatedQuestions,
|
||||
upload_and_parse,
|
||||
uploadAndParse,
|
||||
fetchExternalChatInfo,
|
||||
} = api;
|
||||
|
||||
@ -99,7 +99,7 @@ const methods = {
|
||||
},
|
||||
uploadAndParse: {
|
||||
method: 'post',
|
||||
url: upload_and_parse,
|
||||
url: uploadAndParse,
|
||||
},
|
||||
fetchExternalChatInfo: {
|
||||
url: fetchExternalChatInfo,
|
||||
|
||||
@ -3,12 +3,12 @@ import registerServer from '@/utils/register-server';
|
||||
import request from '@/utils/request';
|
||||
|
||||
const {
|
||||
llm_tools
|
||||
llmTools
|
||||
} = api;
|
||||
|
||||
const methods = {
|
||||
getLlmTools: {
|
||||
url: llm_tools,
|
||||
url: llmTools,
|
||||
method: 'get',
|
||||
},
|
||||
} as const;
|
||||
|
||||
@ -7,16 +7,16 @@ const {
|
||||
logout,
|
||||
register,
|
||||
setting,
|
||||
user_info,
|
||||
tenant_info,
|
||||
factories_list,
|
||||
llm_list,
|
||||
my_llm,
|
||||
set_api_key,
|
||||
set_tenant_info,
|
||||
add_llm,
|
||||
delete_llm,
|
||||
enable_llm,
|
||||
userInfo,
|
||||
tenantInfo,
|
||||
factoriesList,
|
||||
llmList,
|
||||
myLlm,
|
||||
setApiKey,
|
||||
setTenantInfo,
|
||||
addLlm,
|
||||
deleteLlm,
|
||||
enableLlm,
|
||||
deleteFactory,
|
||||
getSystemVersion,
|
||||
getSystemTokenList,
|
||||
@ -43,44 +43,44 @@ const methods = {
|
||||
url: setting,
|
||||
method: 'post',
|
||||
},
|
||||
user_info: {
|
||||
url: user_info,
|
||||
userInfo: {
|
||||
url: userInfo,
|
||||
method: 'get',
|
||||
},
|
||||
get_tenant_info: {
|
||||
url: tenant_info,
|
||||
getTenantInfo: {
|
||||
url: tenantInfo,
|
||||
method: 'get',
|
||||
},
|
||||
set_tenant_info: {
|
||||
url: set_tenant_info,
|
||||
setTenantInfo: {
|
||||
url: setTenantInfo,
|
||||
method: 'post',
|
||||
},
|
||||
factories_list: {
|
||||
url: factories_list,
|
||||
factoriesList: {
|
||||
url: factoriesList,
|
||||
method: 'get',
|
||||
},
|
||||
llm_list: {
|
||||
url: llm_list,
|
||||
llmList: {
|
||||
url: llmList,
|
||||
method: 'get',
|
||||
},
|
||||
my_llm: {
|
||||
url: my_llm,
|
||||
myLlm: {
|
||||
url: myLlm,
|
||||
method: 'get',
|
||||
},
|
||||
set_api_key: {
|
||||
url: set_api_key,
|
||||
setApiKey: {
|
||||
url: setApiKey,
|
||||
method: 'post',
|
||||
},
|
||||
add_llm: {
|
||||
url: add_llm,
|
||||
addLlm: {
|
||||
url: addLlm,
|
||||
method: 'post',
|
||||
},
|
||||
delete_llm: {
|
||||
url: delete_llm,
|
||||
deleteLlm: {
|
||||
url: deleteLlm,
|
||||
method: 'post',
|
||||
},
|
||||
enable_llm: {
|
||||
url: enable_llm,
|
||||
enableLlm: {
|
||||
url: enableLlm,
|
||||
method: 'post',
|
||||
},
|
||||
getSystemVersion: {
|
||||
@ -123,9 +123,9 @@ const methods = {
|
||||
|
||||
const userService = registerServer<keyof typeof methods>(methods, request);
|
||||
|
||||
export const getLoginChannels = () => request.get(api.login_channels);
|
||||
export const getLoginChannels = () => request.get(api.loginChannels);
|
||||
export const loginWithChannel = (channel: string) =>
|
||||
(window.location.href = api.login_channel(channel));
|
||||
(window.location.href = api.loginChannel(channel));
|
||||
|
||||
export const listTenantUser = (tenantId: string) =>
|
||||
request.get(api.listTenantUser(tenantId));
|
||||
|
||||
@ -9,11 +9,11 @@ export default {
|
||||
logout: `${webAPI}/user/logout`,
|
||||
register: `${webAPI}/user/register`,
|
||||
setting: `${webAPI}/user/setting`,
|
||||
user_info: `${webAPI}/user/info`,
|
||||
tenant_info: `${webAPI}/user/tenant_info`,
|
||||
set_tenant_info: `${webAPI}/user/set_tenant_info`,
|
||||
login_channels: `${webAPI}/user/login/channels`,
|
||||
login_channel: (channel: string) => `${webAPI}/user/login/${channel}`,
|
||||
userInfo: `${webAPI}/user/info`,
|
||||
tenantInfo: `${webAPI}/user/tenant_info`,
|
||||
setTenantInfo: `${webAPI}/user/set_tenant_info`,
|
||||
loginChannels: `${webAPI}/user/login/channels`,
|
||||
loginChannel: (channel: string) => `${webAPI}/user/login/${channel}`,
|
||||
|
||||
// team
|
||||
addTenantUser: (tenantId: string) => `${webAPI}/tenant/${tenantId}/user`,
|
||||
@ -25,13 +25,13 @@ export default {
|
||||
agreeTenant: (tenantId: string) => `${webAPI}/tenant/agree/${tenantId}`,
|
||||
|
||||
// llm model
|
||||
factories_list: `${webAPI}/llm/factories`,
|
||||
llm_list: `${webAPI}/llm/list`,
|
||||
my_llm: `${webAPI}/llm/my_llms`,
|
||||
set_api_key: `${webAPI}/llm/set_api_key`,
|
||||
add_llm: `${webAPI}/llm/add_llm`,
|
||||
delete_llm: `${webAPI}/llm/delete_llm`,
|
||||
enable_llm: `${webAPI}/llm/enable_llm`,
|
||||
factoriesList: `${webAPI}/llm/factories`,
|
||||
llmList: `${webAPI}/llm/list`,
|
||||
myLlm: `${webAPI}/llm/my_llms`,
|
||||
setApiKey: `${webAPI}/llm/set_api_key`,
|
||||
addLlm: `${webAPI}/llm/add_llm`,
|
||||
deleteLlm: `${webAPI}/llm/delete_llm`,
|
||||
enableLlm: `${webAPI}/llm/enable_llm`,
|
||||
deleteFactory: `${webAPI}/llm/delete_factory`,
|
||||
|
||||
// data source
|
||||
@ -50,18 +50,18 @@ export default {
|
||||
boxWebAuthResult: () => `${webAPI}/connector/box/oauth/web/result`,
|
||||
|
||||
// plugin
|
||||
llm_tools: `${webAPI}/plugin/llm_tools`,
|
||||
llmTools: `${webAPI}/plugin/llm_tools`,
|
||||
|
||||
chatsTranscriptions: `${restAPIv1}/chats/transcriptions`,
|
||||
|
||||
// knowledge base
|
||||
|
||||
check_embedding: `${webAPI}/kb/check_embedding`,
|
||||
kb_list: `${restAPIv1}/datasets`,
|
||||
create_kb: `${restAPIv1}/datasets`,
|
||||
update_kb: (datasetId: string) => `${restAPIv1}/datasets/${datasetId}`,
|
||||
rm_kb: `${restAPIv1}/datasets`,
|
||||
get_kb_detail: `${webAPI}/kb/detail`,
|
||||
checkEmbedding: `${webAPI}/kb/check_embedding`,
|
||||
kbList: `${restAPIv1}/datasets`,
|
||||
createKb: `${restAPIv1}/datasets`,
|
||||
updateKb: (datasetId: string) => `${restAPIv1}/datasets/${datasetId}`,
|
||||
rmKb: `${restAPIv1}/datasets`,
|
||||
getKbDetail: `${webAPI}/kb/detail`,
|
||||
getKnowledgeGraph: (knowledgeId: string) =>
|
||||
`${restAPIv1}/datasets/${knowledgeId}/knowledge_graph`,
|
||||
deleteKnowledgeGraph: (knowledgeId: string) =>
|
||||
@ -70,7 +70,7 @@ export default {
|
||||
getKnowledgeBasicInfo: `${webAPI}/kb/basic_info`,
|
||||
// data pipeline log
|
||||
fetchDataPipelineLog: `${webAPI}/kb/list_pipeline_logs`,
|
||||
get_pipeline_detail: `${webAPI}/kb/pipeline_log_detail`,
|
||||
getPipelineDetail: `${webAPI}/kb/pipeline_log_detail`,
|
||||
fetchPipelineDatasetLogs: `${webAPI}/kb/list_pipeline_dataset_logs`,
|
||||
runGraphRag: (datasetId: string) =>
|
||||
`${restAPIv1}/datasets/${datasetId}/run_graphrag`,
|
||||
@ -96,36 +96,36 @@ export default {
|
||||
renameTag: (knowledgeId: string) => `${webAPI}/kb/${knowledgeId}/rename_tag`,
|
||||
|
||||
// chunk
|
||||
chunk_list: `${webAPI}/chunk/list`,
|
||||
create_chunk: `${webAPI}/chunk/create`,
|
||||
set_chunk: `${webAPI}/chunk/set`,
|
||||
get_chunk: `${webAPI}/chunk/get`,
|
||||
switch_chunk: `${webAPI}/chunk/switch`,
|
||||
rm_chunk: `${webAPI}/chunk/rm`,
|
||||
retrieval_test: `${webAPI}/chunk/retrieval_test`,
|
||||
knowledge_graph: `${webAPI}/chunk/knowledge_graph`,
|
||||
chunkList: `${webAPI}/chunk/list`,
|
||||
createChunk: `${webAPI}/chunk/create`,
|
||||
setChunk: `${webAPI}/chunk/set`,
|
||||
getChunk: `${webAPI}/chunk/get`,
|
||||
switchChunk: `${webAPI}/chunk/switch`,
|
||||
rmChunk: `${webAPI}/chunk/rm`,
|
||||
retrievalTest: `${webAPI}/chunk/retrieval_test`,
|
||||
knowledgeGraph: `${webAPI}/chunk/knowledge_graph`,
|
||||
|
||||
// document
|
||||
get_document_list: `${webAPI}/document/list`,
|
||||
document_change_status: `${webAPI}/document/change_status`,
|
||||
document_rm: `${webAPI}/document/rm`,
|
||||
document_delete: `${webAPI}/api/document`,
|
||||
document_rename: (datasetId: string, documentId: string) =>
|
||||
getDocumentList: `${webAPI}/document/list`,
|
||||
documentChangeStatus: `${webAPI}/document/change_status`,
|
||||
documentRm: `${webAPI}/document/rm`,
|
||||
documentDelete: `${webAPI}/api/document`,
|
||||
documentRename: (datasetId: string, documentId: string) =>
|
||||
`${restAPIv1}/datasets/${datasetId}/documents/${documentId}`,
|
||||
document_create: `${webAPI}/document/create`,
|
||||
document_run: `${webAPI}/document/run`,
|
||||
document_change_parser: `${webAPI}/document/change_parser`,
|
||||
document_thumbnails: `${webAPI}/document/thumbnails`,
|
||||
get_document_file: `${webAPI}/document/get`,
|
||||
get_document_file_download: (docId: string) =>
|
||||
documentCreate: `${webAPI}/document/create`,
|
||||
documentRun: `${webAPI}/document/run`,
|
||||
documentChangeParser: `${webAPI}/document/change_parser`,
|
||||
documentThumbnails: `${webAPI}/document/thumbnails`,
|
||||
getDocumentFile: `${webAPI}/document/get`,
|
||||
getDocumentFileDownload: (docId: string) =>
|
||||
`${webAPI}/document/download/${docId}`,
|
||||
document_upload: `${webAPI}/document/upload`,
|
||||
web_crawl: `${webAPI}/document/web_crawl`,
|
||||
document_infos: `${webAPI}/document/infos`,
|
||||
upload_and_parse: `${webAPI}/document/upload_info`,
|
||||
documentUpload: `${webAPI}/document/upload`,
|
||||
webCrawl: `${webAPI}/document/web_crawl`,
|
||||
documentInfos: `${webAPI}/document/infos`,
|
||||
uploadAndParse: `${webAPI}/document/upload_info`,
|
||||
parse: `${webAPI}/document/parse`,
|
||||
setMeta: `${webAPI}/document/set_meta`,
|
||||
get_dataset_filter: `${webAPI}/document/filter`,
|
||||
getDatasetFilter: `${webAPI}/document/filter`,
|
||||
|
||||
// chat
|
||||
createChat: `${restAPIv1}/chats`,
|
||||
|
||||
Reference in New Issue
Block a user