Merge pull request 'fix: TTS ack-bank stale voice cache + website/English pronunciation' (#6) from fix/voice-tts-ack-cache-and-pronunciation into main
deploy / deploy (push) Successful in 30s
deploy / deploy (push) Successful in 30s
This commit was merged in pull request #6.
This commit is contained in:
@@ -144,6 +144,11 @@ def operator_system_prompt(*, language: str, channel_label: str, is_voice: bool,
|
|||||||
"grouped and read naturally (\"1414\" as \"четырнадцать четырнадцать\", not \"тысяча четыреста четырнадцать\"). "
|
"grouped and read naturally (\"1414\" as \"четырнадцать четырнадцать\", not \"тысяча четыреста четырнадцать\"). "
|
||||||
"Calendar dates must use the correct spoken grammatical case (\"25 числа\" as \"двадцать пятого числа\", "
|
"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
|
if is_voice
|
||||||
else "The reply should read like a concise message from a live first-line operator."
|
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
|
self._provider_cache[cache_key] = provider
|
||||||
return 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):
|
def synthesize(self, text: str, *, language: str | None = None, style_hints: dict[str, object] | None = None):
|
||||||
provider = self._provider_for_language(language)
|
provider = self._provider_for_language(language)
|
||||||
return provider.synthesize(text, language=language, style_hints=style_hints)
|
return provider.synthesize(text, language=language, style_hints=style_hints)
|
||||||
|
|||||||
Reference in New Issue
Block a user