mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-21 11:43:56 +00:00

* perf: password special chars * feat: llm paragraph;perf: chunk setting params * perf: text splitter worker * perf: get rawtext buffer * fix: test * fix: test * doc * min chunk size
15 lines
436 B
TypeScript
15 lines
436 B
TypeScript
import { parentPort } from 'worker_threads';
|
|
import type { SplitProps } from '@fastgpt/global/common/string/textSplitter';
|
|
import { splitText2Chunks } from '@fastgpt/global/common/string/textSplitter';
|
|
import { workerResponse } from '../controller';
|
|
|
|
parentPort?.on('message', async (props: SplitProps) => {
|
|
const result = splitText2Chunks(props);
|
|
|
|
workerResponse({
|
|
parentPort,
|
|
status: 'success',
|
|
data: result
|
|
});
|
|
});
|