メンション以外では反応しないように

This commit is contained in:
Nebel 2024-11-14 10:19:30 +09:00
parent aa2850a776
commit aefc225aca
Signed by: nebel
GPG key ID: 79807D08C6EF6460

View file

@ -27,7 +27,7 @@ const usage = `\
https://dash.deno.com/playground/darazllm
使:
@darazllm <prompt> (1/${n})
@darazllm <prompt>
@darazllm /bye
@darazllm /help
@ -74,7 +74,7 @@ async function visionChat(
{
role: "user",
content: content.map((c) =>
c.type === "text" ? { ...c, text: `${system}\n\n${c.text}` } : c
c.type === "text" ? { ...c, text: `${system}\n\n${c.text}` } : c,
),
},
],
@ -112,7 +112,7 @@ app.message(async (c) => {
if (prompt) messages.push({ role: "user", content: prompt });
if (isMention || Math.floor(Math.random() * n) === 0) {
if (isMention) {
const content: Array<Groq.Chat.ChatCompletionContentPart> = prompt
.split(separatorRegex)
.filter(Boolean)