From d40b51460e20c6a69167d70a19776cdc4298c747 Mon Sep 17 00:00:00 2001 From: matty Date: Tue, 28 Oct 2025 17:35:05 +0000 Subject: [PATCH] clean up some shit --- .env.example | 3 ++- src/main.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index f9bf0df..59138f5 100644 --- a/.env.example +++ b/.env.example @@ -10,4 +10,5 @@ OLLAMA_SYSTEM_PROMPT="" # system prompt - used to help tune the responses from t OLLAMA_MODEL="" # Ollama model for responses e.g dolphin-mistral:latest FETCH_INTERVAL="" # interval for fetching new notifications from the instance, in milliseconds, recommend at least 15000 RANDOM_POST_INTERVAL="" # interval for ad-hoc posts in milliseconds -INSTANCE_BEARER_TOKEN="" # instance auth/bearer token (check the "verify_credentials" endpoint request headers in Chrome DevTools if on Soapbox) \ No newline at end of file +INSTANCE_BEARER_TOKEN="" # instance auth/bearer token (check the "verify_credentials" endpoint request headers in Chrome DevTools if on Soapbox) +AD_HOC_POST_INSTRUCTIONS="" \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index f67ca1e..81d24d4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -41,6 +41,9 @@ export const envConfig = { : 3600000, botAccountId: process.env.PLEROMA_ACCOUNT_ID, replyWithContext: process.env.REPLY_WITH_CONTEXT === "true" ? true : false, + adHocPostInstructions: process.env.AD_HOC_POST_INSTRUCTIONS + ? process.env.AD_HOC_POST_INSTRUCTIONS + : "Say something.", }; const ollamaConfig: OllamaConfigOptions = { @@ -258,15 +261,15 @@ const createTimelinePost = async () => { ollamaSystemPrompt, ollamaUrl, pleromaInstanceUrl, + adHocPostInstructions, } = envConfig; const ollamaRequestBody: OllamaChatRequest = { model: ollamaModel, messages: [ - { role: "system", content: ollamaSystemPrompt as string }, + { role: "system", content: ollamaSystemPrompt }, { role: "user", - content: - "Make a post about something. Keep your tone authentic, as if you are a real person making a post about a topic that interests you on a microblogging platform. This can be about anything like politics, gardening, homesteading, your favorite animal, a fun fact, what happened during your day, seeking companionship, baking, cooking, et cetera. Do not format the post with a title or quotes, nor sign the post with your name. It will be posted to your timeline so everyone will know you said it.", + content: adHocPostInstructions, }, ], stream: false,