diff --git a/bun.lockb b/bun.lockb index 790b4af..505aed1 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/index.ts b/index.ts index 04bca99..580c742 100644 --- a/index.ts +++ b/index.ts @@ -54,14 +54,14 @@ const replyJobPrompt = getSystemPrompt( "ユーザがあなたへのメッセージを送ってきています。あるびのちゃんとして、発言に返信してください。", ); -await using rephraseSession = new LlmSession( - model, - getSystemPrompt( - "user が与えたテキストを『ですます調』(丁寧な文体)で言い換えたものを、そのまま出力してください。", - ), -); -await rephraseSession.init(); async function rephrase(text: string) { + await using rephraseSession = new LlmSession( + model, + getSystemPrompt( + "user が与えたテキストを『ですます調』(丁寧な文体)で言い換えたものを、そのまま出力してください。", + ), + ); + await rephraseSession.init(); const res = parseResponse( grammar, await rephraseSession.prompt(JSON.stringify({ text }), { @@ -94,9 +94,9 @@ type Job = history: Note[]; }; -await using postJobSession = new LlmSession(model, postJobPrompt); -await postJobSession.init(); async function processPostJob() { + await using postJobSession = new LlmSession(model, postJobPrompt); + await postJobSession.init(); const notes = await getNotes(10, 0, 5); const input = notes.map(formatNote).join("\n"); const text = parseResponse( diff --git a/package.json b/package.json index ac464d6..7addf26 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "misskey-js": "^2025.12.2", - "node-llama-cpp": "^3.16.2", + "node-llama-cpp": "^3.17.1", "openai": "5.0.0-alpha.0", "reconnecting-websocket": "^4.4.0" },