SimpleChatTC: Bring in the tools meta into the main flow

This commit is contained in:
hanishkvc 2025-10-11 00:18:37 +05:30
parent 46f0304105
commit 6167cdff9f
1 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,8 @@
import * as du from "./datautils.mjs"; import * as du from "./datautils.mjs";
import * as ui from "./ui.mjs" import * as ui from "./ui.mjs"
import * as tools from "./tools.mjs"
class Roles { class Roles {
static System = "system"; static System = "system";
@ -228,6 +230,9 @@ class SimpleChat {
if (gMe.bStream) { if (gMe.bStream) {
obj["stream"] = true; obj["stream"] = true;
} }
if (gMe.bTools) {
obj["tools"] = tools.meta();
}
return JSON.stringify(obj); return JSON.stringify(obj);
} }
@ -927,6 +932,8 @@ function startme() {
gMe.debug_disable(); gMe.debug_disable();
document["gMe"] = gMe; document["gMe"] = gMe;
document["du"] = du; document["du"] = du;
document["tools"] = tools;
tools.setup()
for (let cid of gMe.defaultChatIds) { for (let cid of gMe.defaultChatIds) {
gMe.multiChat.new_chat_session(cid); gMe.multiChat.new_chat_session(cid);
} }