fix client.call is not a function
This commit is contained in:
@@ -12,7 +12,12 @@ app.use(express.json({ limit: "500mb" }));
|
|||||||
|
|
||||||
let client;
|
let client;
|
||||||
if (process.env.ENABLE_ROUTER) {
|
if (process.env.ENABLE_ROUTER) {
|
||||||
client = new Router();
|
const router = new Router();
|
||||||
|
client = {
|
||||||
|
call: (data) => {
|
||||||
|
return router.route(data);
|
||||||
|
},
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
const openai = new OpenAI({
|
const openai = new OpenAI({
|
||||||
apiKey: process.env.OPENAI_API_KEY,
|
apiKey: process.env.OPENAI_API_KEY,
|
||||||
|
|||||||
Reference in New Issue
Block a user