mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Implement Data Bank vectors querying
This commit is contained in:
@ -685,6 +685,11 @@ export function sortMoments(a, b) {
|
||||
* splitRecursive('Hello, world!', 3); // ['Hel', 'lo,', 'wor', 'ld!']
|
||||
*/
|
||||
export function splitRecursive(input, length, delimiters = ['\n\n', '\n', ' ', '']) {
|
||||
// Invalid length
|
||||
if (length <= 0) {
|
||||
return [input];
|
||||
}
|
||||
|
||||
const delim = delimiters[0] ?? '';
|
||||
const parts = input.split(delim);
|
||||
|
||||
|
Reference in New Issue
Block a user