fix: instruct voice AI to spell out phone numbers and dates in natural spoken Russian

TTS reads raw text digit-by-digit with no number/date normalization layer.
Short numbers like 1414 were read as a single 4-digit number (tysyacha
chetyresta chetyrnadtsat) instead of a spoken code, and dates like '25
chisla' were read in the wrong grammatical case (dvadtsat pyat chislo
instead of dvadtsat pyatogo chisla). Extend the voice delivery_hint with
explicit spell-out rules so the model itself produces already-correct
spoken-form text.
This commit is contained in:
arys
2026-08-30 11:21:42 +05:00
parent 92095ff5d6
commit d876a67b3a
@@ -136,7 +136,14 @@ def operator_system_prompt(*, language: str, channel_label: str, is_voice: bool,
preferred_language = "Kazakh" if str(language or "").strip().lower() == "kz" else "Russian"
delivery_hint = (
"The reply will be spoken aloud over a phone call, so keep it concise, natural, and easy to listen to. "
"Prefer one or two short sentences and at most one clarifying question."
"Prefer one or two short sentences and at most one clarifying question. "
"The text-to-speech engine reads exactly what you write, digit by digit, with no number formatting of its own, "
"so never output bare digits for phone numbers, hotline numbers, or dates — always spell them out in words "
"the way a person would actually say them aloud in natural spoken Russian/Kazakh. "
"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 \"четырнадцатого марта\")."
if is_voice
else "The reply should read like a concise message from a live first-line operator."
)