a crumb of changes

This commit is contained in:
2025-08-12 19:07:22 +00:00
parent 88a0710c55
commit e696343a73

View File

@ -9,7 +9,7 @@ import {
// import striptags from "striptags"; // import striptags from "striptags";
import { PrismaClient } from "../generated/prisma/client.js"; import { PrismaClient } from "../generated/prisma/client.js";
import { import {
getInstanceEmojis, // getInstanceEmojis,
deleteNotification, deleteNotification,
getNotifications, getNotifications,
getStatusContext, getStatusContext,
@ -20,7 +20,7 @@ import {
alreadyRespondedTo, alreadyRespondedTo,
recordPendingResponse, recordPendingResponse,
// trimInputData, // trimInputData,
selectRandomEmoji, // selectRandomEmoji,
shouldContinue, shouldContinue,
} from "./util.js"; } from "./util.js";
@ -48,7 +48,7 @@ export const envConfig = {
}; };
const ollamaConfig: OllamaConfigOptions = { const ollamaConfig: OllamaConfigOptions = {
temperature: 0.7, temperature: 0.9,
top_p: 0.85, top_p: 0.85,
top_k: 60, top_k: 60,
num_ctx: 16384, // maximum context window for Llama 3.1 num_ctx: 16384, // maximum context window for Llama 3.1
@ -111,7 +111,7 @@ const generateOllamaRequest = async (
) )
.join( .join(
"\n" "\n"
)}\nReply to the user who addressed you. Examine the context of the entire conversation and make references to topics or information where appropriate. When 'nice-ai' or 'Lexi' is mentioned, the user is speaking to or referencing you. Prefix usernames with '@' when addressing them.`; )}\nReply to the user who addressed you (you are Lexi, also known as nice-ai or nice-ai@nicecrew.digital). Examine the context of the entire conversation and make references to topics or information where appropriate. Prefix usernames with '@' when addressing them. Assume if there is no domain in the username, the domain is @nicecrew.digital (for example @matty would be @matty@nicecrew.digital)`;
} }
// Switch to chat request format (messages array auto-handles Llama 3 template) // Switch to chat request format (messages array auto-handles Llama 3 template)
@ -145,16 +145,16 @@ const postReplyToStatus = async (
ollamaResponseBody: OllamaChatResponse ollamaResponseBody: OllamaChatResponse
) => { ) => {
const { pleromaInstanceUrl, bearerToken } = envConfig; const { pleromaInstanceUrl, bearerToken } = envConfig;
const emojiList = await getInstanceEmojis(); // const emojiList = await getInstanceEmojis();
let randomEmoji; // let randomEmoji;
if (emojiList) { // if (emojiList) {
randomEmoji = selectRandomEmoji(emojiList); // randomEmoji = selectRandomEmoji(emojiList);
} // }
try { try {
let mentions: string[]; let mentions: string[];
const statusBody: NewStatusBody = { const statusBody: NewStatusBody = {
content_type: "text/markdown", content_type: "text/markdown",
status: `${ollamaResponseBody.message.content} :${randomEmoji}:`, status: `${ollamaResponseBody.message.content}`,
in_reply_to_id: notification.status.id, in_reply_to_id: notification.status.id,
}; };
if ( if (