@inetafrica/open-claudia 2.6.51 → 2.6.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/system-prompt.js +24 -1
- package/package.json +1 -1
package/core/system-prompt.js
CHANGED
|
@@ -699,6 +699,29 @@ function bumpFtsMissCounter(n) {
|
|
|
699
699
|
} catch (e) {}
|
|
700
700
|
}
|
|
701
701
|
|
|
702
|
+
// Spoken-reply shaping. Injected into the USER prompt (not the cached system
|
|
703
|
+
// prompt) ONLY on voice-input turns of the voice channel — i.e. exactly when the
|
|
704
|
+
// reply will be read aloud by TTS (same gate as the streaming/auto-speak path in
|
|
705
|
+
// the runner). Text channels (Telegram/Kazee) and typed turns never see it.
|
|
706
|
+
const VOICE_REPLY_GUIDANCE = [
|
|
707
|
+
"",
|
|
708
|
+
"",
|
|
709
|
+
"## Voice reply mode",
|
|
710
|
+
"This reply will be spoken aloud to the user by a text-to-speech voice. Write it to be HEARD, not read:",
|
|
711
|
+
"- Talk naturally and conversationally, like a person speaking. Keep it short — a couple of clear sentences beat a long structured answer.",
|
|
712
|
+
"- Do NOT read out code, file paths, command syntax, IDs, URLs, or variable/function names. Describe them in plain words, summarise, or skip them (e.g. say \"the recall file\" instead of spelling a path).",
|
|
713
|
+
"- No markdown or formatting — no bullets, headings, backticks, or asterisks; they are noise when spoken.",
|
|
714
|
+
"- If the answer genuinely needs code or exact detail, say so briefly and offer to send it as text rather than reading it aloud.",
|
|
715
|
+
].join("\n");
|
|
716
|
+
|
|
717
|
+
function voiceReplyGuidance() {
|
|
718
|
+
try {
|
|
719
|
+
const { currentTransport } = require("./context");
|
|
720
|
+
if (currentTransport() === "voice" && currentState().lastInputWasVoice) return VOICE_REPLY_GUIDANCE;
|
|
721
|
+
} catch (e) {}
|
|
722
|
+
return "";
|
|
723
|
+
}
|
|
724
|
+
|
|
702
725
|
async function promptWithDynamicContext(prompt, opts = {}) {
|
|
703
726
|
lastInjected = { packs: [], entities: [], recall: null };
|
|
704
727
|
try {
|
|
@@ -735,7 +758,7 @@ async function promptWithDynamicContext(prompt, opts = {}) {
|
|
|
735
758
|
? `\n\n## Memory budget\n${budget.omitted} matched memory item${budget.omitted === 1 ? " was" : "s were"} omitted to keep this turn under the recall budget (${budget.maxChars} chars). Use \`open-claudia pack show <dir>\`, \`entity show <slug>\`, or transcript search if deeper context is needed.`
|
|
736
759
|
: "";
|
|
737
760
|
const transcriptPointer = opts.includeTranscriptPointer ? `${transcriptPointerNote(state)}\n\n` : "";
|
|
738
|
-
return `${transcriptPointer}${buildDynamicContextBlock()}${packBlock}${entityBlock}${budgetNote}\n\nCurrent user request:\n${prompt}`;
|
|
761
|
+
return `${transcriptPointer}${buildDynamicContextBlock()}${packBlock}${entityBlock}${budgetNote}${voiceReplyGuidance()}\n\nCurrent user request:\n${prompt}`;
|
|
739
762
|
} catch (e) {
|
|
740
763
|
return prompt;
|
|
741
764
|
}
|
package/package.json
CHANGED