feat(voice_worker): the v2 brain answers in Korean unless asked for another language

The brain passes default_language (worker --reply-language, default Korean) to
the reply engine; unlike the output_language lock it gives way when the user
explicitly asks for a language. Tools get the ko code (--tool-language).

Eval evals/test_reply_language_default.py (Qwen3.6 on Strata): 6/6, English
questions answered in Korean, an explicit English request in English, and the
control without the default answers English in English.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 10:34:12 +09:00
parent cefe9b9253
commit 7623d6d002
9 changed files with 170 additions and 25 deletions

View File

@@ -24,6 +24,9 @@ def main() -> int:
ap.add_argument("--history", default=None, help="conversation history SQLite file; no history without it")
ap.add_argument("--brain", action="store_true",
help="answer reply requests with the jarvis reply engine (needs --history)")
ap.add_argument("--reply-language", default="Korean",
help="answers come in this language unless the asker asks for another; '' for the asker's")
ap.add_argument("--tool-language", default="ko", help="ISO code tools get (e.g. the Wikipedia host)")
args = ap.parse_args()
if args.brain and not args.history:
print("--brain needs --history", file=sys.stderr)
@@ -56,7 +59,7 @@ def main() -> int:
history = HistoryStore(args.history)
if args.brain:
from .brain import JarvisBrain
brain = JarvisBrain()
brain = JarvisBrain(language=args.tool_language or None, reply_language=args.reply_language or None)
async def run() -> None:
worker = VoiceWorker(token, transcriber, vad.stream, tts, history=history, brain=brain)