fix(models): clear stale speech endpoint settings (#1196)

This commit is contained in:
red person
2026-06-02 17:32:01 +03:00
committed by GitHub
parent 69ab350919
commit 76a7685105
2 changed files with 58 additions and 8 deletions
+29
View File
@@ -33,11 +33,40 @@ from routes.model_routes import (
_classify_endpoint,
_probe_endpoint,
_truthy,
_speech_settings_using_endpoint,
_clear_speech_settings_for_endpoint,
_PROVIDER_CURATED,
)
from src.llm_core import ANTHROPIC_MODELS
# ── speech endpoint settings ──
def test_speech_endpoint_dependents_include_stt():
settings = {"stt_provider": "endpoint:voice"}
assert _speech_settings_using_endpoint(settings, "voice") == ["Speech to Text"]
def test_clear_speech_endpoint_settings_resets_tts_and_stt():
settings = {
"tts_provider": "endpoint:voice",
"tts_model": "custom-tts",
"stt_provider": "endpoint:voice",
"stt_model": "custom-stt",
}
assert _clear_speech_settings_for_endpoint(settings, "voice") == [
"Text to Speech",
"Speech to Text",
]
assert settings == {
"tts_provider": "disabled",
"tts_model": "tts-1",
"stt_provider": "disabled",
"stt_model": "base",
}
# ── _match_provider_curated ──
class TestMatchProviderCurated: