Refactor (7)

This commit is contained in:
2026-03-05 09:01:56 +09:00
parent 321731ad4b
commit 619cdee636
3 changed files with 10 additions and 10 deletions

View File

@@ -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(