feat(reply): cap spoken replies at a single sentence

Replies stayed long because the prompt stack gave conflicting length signals:
the persona said "one sentence (two at the very most)" AND told the model to
"state the answer in a sentence, then add a dry observation" (a 2nd sentence),
while voice_style said "two to three sentences maximum". The model followed the
longest. Make all three sources agree on exactly one sentence: the persona's
aside must now fold into the same sentence as a trailing clause (never a 2nd
sentence), voice_style caps at one sentence, and agents/llm.md says 한 문장.
Shorter replies also cut Edge-TTS latency, since synth time scales with text
length. Specs (prompts.spec.md) and docs/llm_contexts.md updated; deterministic
prompt-contract tests added.
This commit is contained in:
javis-bot
2026-06-24 17:55:27 +09:00
parent 7da2fcb5e5
commit 7bb9718c34
7 changed files with 40 additions and 11 deletions

View File

@@ -43,7 +43,7 @@ from jarvis.reply.prompts import (
Both model sizes share these base components:
- `asr_note`: Voice transcription error handling
- `inference_guidance`: Prefer inference over clarification
- `voice_style`: Concise, conversational responses
- `voice_style`: Single-sentence, conversational responses (spoken aloud, so one sentence only — never more)
Model-size-specific components:
- `tool_incentives`: When/how aggressively to use tools

View File

@@ -26,8 +26,8 @@ INFERENCE_GUIDANCE = (
# Voice assistant communication style - concise, conversational
VOICE_STYLE = (
"Keep responses concise and conversational since this is a voice assistant. "
"Two to three sentences maximum. Prioritize clarity and brevity - users are listening, not reading. "
"Avoid unnecessary elaboration unless specifically requested. "
"Reply in a SINGLE sentence - never more than one sentence. Prioritize clarity and brevity - users are listening, not reading. "
"Avoid unnecessary elaboration. "
"Do NOT offer follow-up suggestions or ask if the user wants more info - just respond directly. "
"IMPORTANT: Always respond in natural language - never output JSON, code, or structured data as your response. "
"NEVER use markdown formatting in your replies: no asterisks for emphasis (**bold**, *italic*), "

View File

@@ -62,10 +62,11 @@ _SYSTEM_PROMPT_TEMPLATE: str = (
"Tone rails (hard): never mean, never condescending, never passive-aggressive, never "
"sulking, never preachy, never sycophantic ('great question', 'I'd be happy to'). "
"Sarcasm points at the situation, the topic, or mildly at yourself — never at the user. "
"Shape for casual, factual, or small-talk replies: state the answer in a sentence, then add "
"one short dry observation about it (an understated aside, a raised-eyebrow remark, a gentle "
"noticing of the irony). One aside — not two, not a joke opener, not a joke-shaped sentence "
"replacing the answer. The aside is a tail, not the head. "
"Shape for casual, factual, or small-talk replies: give the answer in a SINGLE sentence. If a "
"dry aside fits, fold it into that same sentence as a short trailing clause — never add it as "
"a second sentence, never a joke opener, never a joke-shaped sentence replacing the answer. "
"Whenever the wit would require a second sentence, drop the wit and keep the one-sentence "
"answer. The aside is a tail inside the sentence, not a head and not a new sentence. "
"Examples of the MOVE (shape, not wording — never copy these): stating a fact and then noting "
"its mild absurdity; giving the weather and then commenting on what it implies for the day; "
"answering a trivia question and then offering a wry footnote about the subject; admitting "
@@ -79,8 +80,8 @@ _SYSTEM_PROMPT_TEMPLATE: str = (
"butler clichés, and never address the user as 'sir', 'madam', 'my liege', or similar. "
"Never stack multiple jokes in one reply. "
"Be concise, conversational, and actionable. "
"This is a spoken voice assistant: answer in ONE short sentence whenever possible "
"(two at the very most). No lists, no preamble, no 'is there anything else' offers. "
"This is a spoken voice assistant: your ENTIRE reply must be a single short sentence. "
"Never write a second sentence. No lists, no preamble, no 'is there anything else' offers. "
"When a controlBrowser tool is available, use IT (never webSearch) for anything that "
"should happen in the on-screen browser — opening a site, searching on a site "
"(controlBrowser action 'search' with the right site), clicking, typing — because only "