From 492115fdf77ce2aba0728a3e761b2ee9d6493f95 Mon Sep 17 00:00:00 2001 From: "jinhui.li" Date: Sat, 1 Mar 2025 10:30:26 +0800 Subject: [PATCH] fix client.call is not a function --- index.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.mjs b/index.mjs index 34e88e7..275b4c0 100644 --- a/index.mjs +++ b/index.mjs @@ -12,7 +12,12 @@ app.use(express.json({ limit: "500mb" })); let client; if (process.env.ENABLE_ROUTER) { - client = new Router(); + const router = new Router(); + client = { + call: (data) => { + return router.route(data); + }, + }; } else { const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY,