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:
@@ -121,6 +121,18 @@ class TestPromptComponents:
|
||||
assert prompts.voice_style, f"{size.value} missing voice_style"
|
||||
assert prompts.tool_guidance, f"{size.value} missing tool_guidance"
|
||||
|
||||
def test_voice_style_enforces_single_sentence(self):
|
||||
"""voice_style must cap replies at one sentence (spoken aloud). The old
|
||||
'Two to three sentences maximum' wording let the model run long, which
|
||||
also slowed TTS since synth time scales with text length."""
|
||||
from jarvis.reply.prompts import get_system_prompts, ModelSize
|
||||
|
||||
for size in [ModelSize.SMALL, ModelSize.LARGE]:
|
||||
voice_style = get_system_prompts(size).voice_style
|
||||
assert "SINGLE sentence" in voice_style, f"{size.value} voice_style not single-sentence"
|
||||
assert "never more than one sentence" in voice_style
|
||||
assert "Two to three" not in voice_style
|
||||
|
||||
def test_to_list_returns_non_empty_strings(self):
|
||||
"""to_list() returns only non-empty prompt strings."""
|
||||
from jarvis.reply.prompts import get_system_prompts, ModelSize
|
||||
|
||||
Reference in New Issue
Block a user