diff --git a/llama.js b/llama.js index a920adb..0c8d42f 100644 --- a/llama.js +++ b/llama.js @@ -17,7 +17,7 @@ const config = { useMmap: true, }; -const prompt = (question) => `Answer as an assistant. +const prompt = (question) => `Answer as an AI sassy assistant. USER: (asks a question) ${question} ASSISTANT: `; diff --git a/zulipBot.js b/zulipBot.js index 76a2960..60b4031 100644 --- a/zulipBot.js +++ b/zulipBot.js @@ -20,15 +20,23 @@ async function main() { events.forEach(async (event) => { last_event_id = Math.max(last_event_id, Number(event.id)); const isMentioned = event.flags?.includes("mentioned"); - console.log(event.message); - if (isMentioned && event.type === "message") { - const content = await askllama({ question: event.message.content }); + console.log(event); + if ( + event.type === "message" && + event.message.type === "private" && + event.message.sender_full_name !== "gptBot" + ) { + console.log(event.message); + const content = await askllama({ + question: `My name is ${event.message.sender_full_name}. Answer this question: ${event.message.content}`, + }); + console.log(content); await client.messages.send({ to: event.message.sender_email, type: "private", //type: 'stream', subject: "Testing gptBot", - content, + content: content.replace("(answers the question)", ""), }); } });