mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
#1412 Add randomized user ids to OpenAI
This commit is contained in:
@ -259,6 +259,14 @@ const color = {
|
||||
white: (mess) => color.byNum(mess, 37)
|
||||
};
|
||||
|
||||
function uuidv4() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
const r = Math.random() * 16 | 0;
|
||||
const v = c === 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getConfig,
|
||||
getConfigValue,
|
||||
@ -270,4 +278,5 @@ module.exports = {
|
||||
delay,
|
||||
deepMerge,
|
||||
color,
|
||||
uuidv4,
|
||||
};
|
||||
|
Reference in New Issue
Block a user