SimpleChatTC:DataStore:List keys - the plumbing

This commit is contained in:
hanishkvc 2025-10-30 06:24:01 +05:30
parent 2d497069d2
commit 57dd228512
1 changed files with 32 additions and 0 deletions

View File

@ -109,6 +109,33 @@ function dsdel_run(chatid, toolcallid, toolname, obj) {
}
let dslist_meta = {
"type": "function",
"function": {
"name": "data_store_list",
"description": "List all keys wrt key-value pairs currently stored in the data store. This will take few seconds and uses a web worker.",
"parameters": {
"type": "object",
"properties": {
},
}
}
}
/**
* Implementation of the data store list logic. Minimal skeleton for now.
* NOTE: Has access to the javascript web worker environment and can mess with it and beyond
* @param {string} chatid
* @param {string} toolcallid
* @param {string} toolname
* @param {any} obj
*/
function dslist_run(chatid, toolcallid, toolname, obj) {
gToolsDBWorker.postMessage({ cid: chatid, tcid: toolcallid, name: toolname, args: obj})
}
/**
* @type {Object<string, Object<string, any>>}
@ -129,6 +156,11 @@ export let tc_switch = {
"meta": dsdel_meta,
"result": ""
},
"data_store_list": {
"handler": dslist_run,
"meta": dslist_meta,
"result": ""
},
}