mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Sanitize completion names. Only send names in msg texts if names in completion is disabled
This commit is contained in:
@ -938,6 +938,10 @@ PromptManagerModule.prototype.isValidName = function(name) {
|
||||
return regex.test(name);
|
||||
}
|
||||
|
||||
PromptManagerModule.prototype.sanitizeName = function(name) {
|
||||
return name.replace(/[^a-zA-Z0-9_]/g, '_').substring(0, 64);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a given prompt into the edit form fields.
|
||||
* @param {Object} prompt - Prompt object with properties 'name', 'role', 'content', and 'system_prompt'
|
||||
|
Reference in New Issue
Block a user