fix client.call is not a function

This commit is contained in:
jinhui.li
2025-03-01 10:30:26 +08:00
Unverified
parent b4d1efd9fb
commit 492115fdf7
+6 -1
View File
@@ -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,