From 131251a1aefdd64817b3a2422ce552eab2e79514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A2=A8=E7=B6=A0BG?= Date: Sat, 18 Jul 2026 20:18:11 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(stt):=20declare=20local=20in?= =?UTF-8?q?itial=20prompt=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hermes_cli/config.py | 1 + tests/tools/test_transcription.py | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/hermes_cli/config.py b/hermes_cli/config.py index a2501411034..76fd21f8b05 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -2325,6 +2325,7 @@ DEFAULT_CONFIG = { "local": { "model": "base", # tiny, base, small, medium, large-v3 "language": "", # auto-detect by default; set to "en", "es", "fr", etc. to force + "initial_prompt": "", }, "openai": { "model": "whisper-1", # whisper-1, gpt-4o-mini-transcribe, gpt-4o-transcribe diff --git a/tests/tools/test_transcription.py b/tests/tools/test_transcription.py index c1bba550eca..e8e925d5314 100644 --- a/tests/tools/test_transcription.py +++ b/tests/tools/test_transcription.py @@ -122,6 +122,27 @@ class TestValidateAudioFile: assert "too large" in result["error"] +# --------------------------------------------------------------------------- +# Config resolution +# --------------------------------------------------------------------------- + + +class TestLoadSttConfig: + + def test_merges_default_local_initial_prompt(self, monkeypatch, tmp_path): + monkeypatch.setenv("HERMES_HOME", str(tmp_path)) + (tmp_path / "config.yaml").write_text( + "stt:\n local:\n model: small\n", + encoding="utf-8", + ) + + from tools.transcription_tools import _load_stt_config + local_config = _load_stt_config()["local"] + + assert local_config["model"] == "small" + assert local_config["initial_prompt"] == "" + + # --------------------------------------------------------------------------- # Local transcription # ---------------------------------------------------------------------------