feat: api dataset support pdf parse;fix: chunk reader auth (#4117)

* feat: api dataset support pdf parse

* fix: chunk reader auth
This commit is contained in:
Archer
2025-03-12 12:41:19 +08:00
committed by archer
parent 30f83f848d
commit 1a3613cd2c
27 changed files with 378 additions and 355 deletions

View File

@@ -111,11 +111,13 @@ export const useApiDatasetRequest = ({ apiServer }: { apiServer: APIFileServer }
const getFileContent = async ({
teamId,
tmbId,
apiFileId
apiFileId,
customPdfParse
}: {
teamId: string;
tmbId: string;
apiFileId: string;
customPdfParse?: boolean;
}) => {
const data = await request<APIFileContentResponse>(
`/v1/file/content`,
@@ -133,7 +135,8 @@ export const useApiDatasetRequest = ({ apiServer }: { apiServer: APIFileServer }
teamId,
tmbId,
url: previewUrl,
relatedId: apiFileId
relatedId: apiFileId,
customPdfParse
});
return rawText;
}

View File

@@ -127,7 +127,8 @@ export const readApiServerFileContent = async ({
yuqueServer,
apiFileId,
teamId,
tmbId
tmbId,
customPdfParse
}: {
apiServer?: APIFileServer;
feishuServer?: FeishuServer;
@@ -135,9 +136,15 @@ export const readApiServerFileContent = async ({
apiFileId: string;
teamId: string;
tmbId: string;
customPdfParse?: boolean;
}) => {
if (apiServer) {
return useApiDatasetRequest({ apiServer }).getFileContent({ teamId, tmbId, apiFileId });
return useApiDatasetRequest({ apiServer }).getFileContent({
teamId,
tmbId,
apiFileId,
customPdfParse
});
}
if (feishuServer || yuqueServer) {