fix: TTS ack-bank stale voice cache + website/English pronunciation #6

Merged
arystanbek merged 1 commits from fix/voice-tts-ack-cache-and-pronunciation into main 2026-08-30 06:39:33 +00:00
2 changed files with 10 additions and 1 deletions
@@ -143,7 +143,12 @@ def operator_system_prompt(*, language: str, channel_label: str, is_voice: bool,
"Short hotline or service numbers (e.g. 1414, 109) must be spelled out the way people say them as a code, "
"grouped and read naturally (\"1414\" as \"четырнадцать четырнадцать\", not \"тысяча четыреста четырнадцать\"). "
"Calendar dates must use the correct spoken grammatical case (\"25 числа\" as \"двадцать пятого числа\", "
"not \"двадцать пять число\"; \"14 марта\" as \"четырнадцатого марта\")."
"not \"двадцать пять число\"; \"14 марта\" as \"четырнадцатого марта\"). "
"Never leave a website address, domain, or English word/abbreviation in raw Latin script — the TTS engine "
"slurs it into gibberish (e.g. \"egov.kz\" comes out as \"эговкз\"). Transliterate it into how a person "
"actually pronounces it aloud, with an explicit pause word for punctuation: write \"egov.kz\" as "
"\"игов точка кэ-зэт\", write \".kz\"/\".com\" as \"точка кэ-зэт\"/\"точка ком\", spell out an acronym or "
"English word phonetically in Cyrillic (\"IT\" as \"ай-ти\", \"email\" as \"имейл\")."
if is_voice
else "The reply should read like a concise message from a live first-line operator."
)
@@ -114,6 +114,10 @@ class RuntimeConfiguredTTSProvider(TTSProvider):
self._provider_cache[cache_key] = provider
return provider
def cache_fingerprint(self, language: str | None, *, style_hints: dict[str, object] | None = None) -> str:
provider = self._provider_for_language(language)
return f"{provider.name}:{provider.cache_fingerprint(language, style_hints=style_hints)}"
def synthesize(self, text: str, *, language: str | None = None, style_hints: dict[str, object] | None = None):
provider = self._provider_for_language(language)
return provider.synthesize(text, language=language, style_hints=style_hints)