From 73bbf9e70c222bd6ca3630bb2beb6d795b2e4643 Mon Sep 17 00:00:00 2001 From: sirius422 Date: Tue, 25 Jun 2024 00:38:09 +0800 Subject: [PATCH] Fix typo --- index.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.mjs b/index.mjs index acc7661..1fb0525 100644 --- a/index.mjs +++ b/index.mjs @@ -30,12 +30,12 @@ const modelMappping = { "claude-2.0": "claude_2", }; -// import config.js +// import config.mjs try { var { config } = await import("./config.mjs"); } catch (e) { console.error(e); - console.error("config.js 不存在或者有错误,请检查"); + console.error("config.mjs 不存在或者有错误,请检查"); process.exit(1); } var provider = new YouProvider(config); @@ -122,7 +122,7 @@ app.post("/v1/messages", apiKeyAuth, (req, res) => { res.write(createEvent("ping", { type: "ping" })); } }); - + completion.on("completion", (id, text) => { if (jsonBody.stream) { // send message delta @@ -162,7 +162,7 @@ app.post("/v1/messages", apiKeyAuth, (req, res) => { res.end(); } }); - + completion.on("end", () => { if (jsonBody.stream) { res.write(createEvent("content_block_stop", { type: "content_block_stop", index: 0 })); @@ -177,7 +177,7 @@ app.post("/v1/messages", apiKeyAuth, (req, res) => { res.end(); } }); - + res.on("close", () => { console.log(" > [Client closed]"); completion.removeAllListeners();