🐛 fix(stt): declare local initial prompt default

This commit is contained in:
墨綠BG 2026-07-18 20:18:11 +08:00 • committed by Teknium
parent f65481674b
commit 131251a1ae
2 changed files with 22 additions and 0 deletions

View file

@ -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

View file

@ -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
# ---------------------------------------------------------------------------