mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 20:27:45 +00:00
Quote Modal UI and fix doc (#432)
This commit is contained in:
@@ -21,13 +21,13 @@ export function replaceVariable(text: string, obj: Record<string, string | numbe
|
||||
* maxLen > overlapLen
|
||||
*/
|
||||
export const splitText2Chunks = ({ text = '', maxLen }: { text: string; maxLen: number }) => {
|
||||
const overlapLen = Math.floor(maxLen * 0.2); // Overlap length
|
||||
const overlapLen = Math.floor(maxLen * 0.15); // Overlap length
|
||||
const tempMarker = 'SPLIT_HERE_SPLIT_HERE';
|
||||
|
||||
const stepReg: Record<number, RegExp> = {
|
||||
0: /(\n\n)/g,
|
||||
1: /([\n])/g,
|
||||
2: /([。]|\.\s)/g,
|
||||
2: /[。]|(?!<[^a-zA-Z])\.\s/g,
|
||||
3: /([!?]|!\s|\?\s)/g,
|
||||
4: /([;]|;\s)/g,
|
||||
5: /([,]|,\s)/g
|
||||
|
Reference in New Issue
Block a user