Export variable manipulation functions to getContext

This commit is contained in:
Cohee
2025-01-30 01:58:55 +02:00
parent e3f0a8d35b
commit 1df209c284
2 changed files with 15 additions and 4 deletions

View File

@ -69,6 +69,7 @@ import { textgenerationwebui_settings } from './textgen-settings.js';
import { tokenizers, getTextTokens, getTokenCount, getTokenCountAsync, getTokenizerModel } from './tokenizers.js';
import { ToolManager } from './tool-calling.js';
import { timestampToMoment, uuidv4 } from './utils.js';
import { getGlobalVariable, getLocalVariable, setGlobalVariable, setLocalVariable } from './variables.js';
export function getContext() {
return {
@ -175,6 +176,16 @@ export function getContext() {
humanizedDateTime,
updateMessageBlock,
appendMediaToMessage,
variables: {
local: {
get: getLocalVariable,
set: setLocalVariable,
},
global: {
get: getGlobalVariable,
set: setGlobalVariable,
},
},
};
}