Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(desktop): apply custom dictionary to meeting note cleanup prompt

Gabriel Stein24ea31216858
diff --git a/src/config/prompts.ts b/src/config/prompts.ts
index 6919c1fef..5c0a7b040 100644
--- a/src/config/prompts.ts
+++ b/src/config/prompts.ts
@@ -1,6 +1,6 @@
import { resolvePrompt } from "./prompts/index";
-export { resolvePrompt, getDefaultPromptText } from "./prompts/index";
+export { resolvePrompt, getDefaultPromptText, appendDictionarySuffix } from "./prompts/index";
export { PROMPT_KINDS, PROMPT_KIND_LIST, type PromptKind } from "./prompts/registry";
export { detectAgentName } from "./agentDetection";
diff --git a/src/config/prompts/index.ts b/src/config/prompts/index.ts
index 455a8b54a..698a7e83e 100644
--- a/src/config/prompts/index.ts
+++ b/src/config/prompts/index.ts
@@ -27,6 +27,19 @@ export function getDefaultPromptText(kind: PromptKind, uiLanguage?: string): str
return t(def.i18nKey, { defaultValue: def.fallback });
}
+export function appendDictionarySuffix(
+ prompt: string,
+ customDictionary?: string[],
+ uiLanguage?: string
+): string {
+ if (!customDictionary?.length) return prompt;
+ const locale = normalizeUiLanguage(uiLanguage || "en");
+ const suffix = i18n.getFixedT(locale, "prompts")("dictionarySuffix", {
+ defaultValue: enPrompts.dictionarySuffix,
+ });
+ return prompt + suffix + customDictionary.join(", ");
+}
+
function applySubstitutions(template: string, opts: ResolvePromptOptions): string {
const name = opts.agentName?.trim() || "Assistant";
let prompt = template.replace(/\{\{agentName\}\}/g, name);
@@ -34,13 +47,5 @@ function applySubstitutions(template: string, opts: ResolvePromptOptions): strin
const langInstruction = getLanguageInstruction(opts.language);
if (langInstruction) prompt += "\n\n" + langInstruction;
- if (opts.customDictionary?.length) {
- const locale = normalizeUiLanguage(opts.uiLanguage || "en");
- const suffix = i18n.getFixedT(locale, "prompts")("dictionarySuffix", {
- defaultValue: enPrompts.dictionarySuffix,
- });
- prompt += suffix + opts.customDictionary.join(", ");
- }
-
- return prompt;
+ return appendDictionarySuffix(prompt, opts.customDictionary, opts.uiLanguage);
}
diff --git a/src/stores/actionProcessingStore.ts b/src/stores/actionProcessingStore.ts
index 3009fb933..f590d6023 100644
--- a/src/stores/actionProcessingStore.ts
+++ b/src/stores/actionProcessingStore.ts
@@ -1,6 +1,7 @@
import { create } from "zustand";
import reasoningService from "../services/ReasoningService";
import { getEffectiveCleanupModel, getSettings } from "./settingsStore";
+import { appendDictionarySuffix } from "../config/prompts";
import { generateNoteTitle } from "../utils/generateTitle";
import type { ActionItem } from "../types/electron";
@@ -121,11 +122,16 @@ export function runBackgroundAction(
(async () => {
try {
const basePrompt = options.isMeetingNote ? MEETING_SYSTEM_PROMPT : BASE_SYSTEM_PROMPT;
- const systemPrompt = basePrompt + action.prompt;
+ const settings = getSettings();
+ const systemPrompt = appendDictionarySuffix(
+ basePrompt + action.prompt,
+ options.isMeetingNote ? settings.customDictionary : undefined,
+ settings.uiLanguage
+ );
const enhanced = await reasoningService.processText(noteContent, modelId, null, {
systemPrompt,
temperature: 0.3,
- disableThinking: getSettings().noteFormattingDisableThinking,
+ disableThinking: settings.noteFormattingDisableThinking,
});
if (cancelledFlags.get(noteId)) return;