hermes-agent/tests/gateway/test_stt_transcript_echo_config.py
2026-07-05 06:12:49 -07:00

41 lines
1.3 KiB
Python

from types import SimpleNamespace
from gateway.config import GatewayConfig
from gateway.run import GatewayRunner
def test_stt_echo_transcripts_defaults_on_for_backwards_compatibility():
cfg = GatewayConfig.from_dict({})
assert cfg.stt_enabled is True
assert cfg.stt_echo_transcripts is True
assert cfg.to_dict()["stt_echo_transcripts"] is True
def test_stt_echo_transcripts_can_be_disabled_in_stt_section():
cfg = GatewayConfig.from_dict({"stt": {"enabled": True, "echo_transcripts": False}})
assert cfg.stt_enabled is True
assert cfg.stt_echo_transcripts is False
def test_top_level_stt_echo_transcripts_takes_precedence():
cfg = GatewayConfig.from_dict({
"stt_echo_transcripts": False,
"stt": {"echo_transcripts": True},
})
assert cfg.stt_echo_transcripts is False
def test_gateway_runner_uses_stt_echo_transcripts_flag():
runner = GatewayRunner.__new__(GatewayRunner)
runner.config = SimpleNamespace(stt_echo_transcripts=False)
assert runner._should_echo_stt_transcripts() is False
runner.config = SimpleNamespace(stt_echo_transcripts=True)
assert runner._should_echo_stt_transcripts() is True
runner.config = SimpleNamespace()
assert runner._should_echo_stt_transcripts() is True