Refactor
This commit is contained in:
6
index.ts
6
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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user