From 3b5274bebcc37f62d863fdc80757683a7b3039f8 Mon Sep 17 00:00:00 2001 From: cannorin Date: Thu, 12 Mar 2026 21:00:10 +0900 Subject: [PATCH] Refactor --- index.ts | 6 ++++-- lib/misskey.ts | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index 53809e8..1f18e8b 100644 --- a/index.ts +++ b/index.ts @@ -40,6 +40,7 @@ const baseChatPromptOptions = { return [ "{", " {", + "{ ", '{"', "{'", "{\\", @@ -47,6 +48,8 @@ const baseChatPromptOptions = { " {'", " {\\", "#", + "「", + "」", ].includes(text); }), penalty: 1.2, @@ -62,9 +65,8 @@ const getSystemPrompt = ( - 現在は地球の衛星軌道上からインターネットを観察している。 出力規則: - 「~です」「~ます」などの語尾を使って **丁寧に** 話す。 -- ハッシュタグや絵文字を使わない。 +- 3センテンス程度で出力する。 - \`{ name: string, text: string }\` の JSON 形式で出力する。name と text 以外のプロパティは出力しない。 -- 3センテンス、140文字程度で出力する。 ${instruction}`; const postJobPrompt = getSystemPrompt( diff --git a/lib/misskey.ts b/lib/misskey.ts index 496c70c..fa231cc 100644 --- a/lib/misskey.ts +++ b/lib/misskey.ts @@ -76,5 +76,5 @@ export async function expandReplyTree( export const sanitizeText = (text: string) => text .replaceAll(/(\r\n|\r|\n)\s+/g, "\n\n") // remove extra newlines - .replaceAll("@", "") // remove mentions - .replaceAll("#", ""); // remove hashtags + .replaceAll("@", "@") // remove mentions + .replaceAll("#", "#"); // remove hashtags