perf: yuque dataset (#5040)

* perf: yuque dataset

* doc
This commit is contained in:
Archer
2025-06-16 18:01:59 +08:00
committed by GitHub
parent 450d0a54fe
commit 7981b61ca9
9 changed files with 139 additions and 53 deletions

View File

@@ -106,7 +106,7 @@ export const useApiDatasetRequest = ({ apiServer }: { apiServer: APIFileServer }
const formattedFiles = files.map((file) => ({
...file,
hasChild: file.type === 'folder'
hasChild: file.hasChild ?? file.type === 'folder'
}));
return formattedFiles;

View File

@@ -198,6 +198,7 @@ export const useYuqueDatasetRequest = ({ yuqueServer }: { yuqueServer: YuqueServ
}: {
apiFileId: string;
}): Promise<ApiFileReadContentResponse> => {
if (typeof apiFileId !== 'string') return Promise.reject('Invalid file id');
const [parentId, fileId] = apiFileId.split(/-(.*?)-(.*)/);
const data = await request<{ title: string; body: string }>(

View File

@@ -167,7 +167,7 @@ export const readApiServerFileContent = async ({
};
export const rawText2Chunks = async ({
rawText,
rawText = '',
chunkTriggerType = ChunkTriggerConfigTypeEnum.minSize,
chunkTriggerMinSize = 1000,
backupParse,