diff --git a/tools/server/public_simplechat/tooldb.mjs b/tools/server/public_simplechat/tooldb.mjs index 2aa07853c5..5eefc16e89 100644 --- a/tools/server/public_simplechat/tooldb.mjs +++ b/tools/server/public_simplechat/tooldb.mjs @@ -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>} @@ -129,6 +156,11 @@ export let tc_switch = { "meta": dsdel_meta, "result": "" }, + "data_store_list": { + "handler": dslist_run, + "meta": dslist_meta, + "result": "" + }, }