From 8465393e1d04340ff69aae3509bc1ada6c62cae9 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Mon, 30 Jan 2023 14:15:21 +0900 Subject: [PATCH] `Q:` and `A:` --- api/slack/events.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/slack/events.ts b/api/slack/events.ts index 99c9b27..6feffdb 100644 --- a/api/slack/events.ts +++ b/api/slack/events.ts @@ -31,9 +31,9 @@ const app = new App({ token, receiver }); // required app_mentions:read chat:write app.event("app_mention", async ({ event, say }) => { - const prompt = `語尾を「にゃん」にして質問にこたえる\n${event.text - .replace(/<@[0-9A-Z]+>/, "") - .trim()}\n`; + const prompt = `語尾を「にゃん」にして質問にこたえる +Q:${event.text.replace(/^<@[0-9A-Z]+>/, "").trim()} +A:`; const text = await gpt(prompt); await say(text); });