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
22 lines
443 B
TypeScript
22 lines
443 B
TypeScript
import { parentPort } from 'worker_threads';
|
|
import { html2md } from './utils';
|
|
import { workerResponse } from '../controller';
|
|
|
|
parentPort?.on('message', (params: { html: string }) => {
|
|
try {
|
|
const md = html2md(params?.html || '');
|
|
|
|
workerResponse({
|
|
parentPort,
|
|
status: 'success',
|
|
data: md
|
|
});
|
|
} catch (error) {
|
|
workerResponse({
|
|
parentPort,
|
|
status: 'error',
|
|
data: error
|
|
});
|
|
}
|
|
});
|