음성 재생과 운영 배포 정리
This commit is contained in:
parent
8ed185ce6c
commit
ac7db95542
1020 changed files with 46863 additions and 2175 deletions
|
|
@ -17,6 +17,7 @@ from .services.voice import (
|
|||
assess_end_of_turn,
|
||||
build_tts_payload,
|
||||
resolve_voice,
|
||||
resolve_voice_from_map,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -50,6 +51,49 @@ class VoicePresetResolutionTest(unittest.TestCase):
|
|||
self.assertEqual(voice.openai_voice, DEFAULT_OPENAI_VOICE)
|
||||
self.assertEqual(voice.rate, 1.0)
|
||||
|
||||
def test_openai_persona_voice_map_overrides_live_tts_fields(self) -> None:
|
||||
voice = resolve_voice_from_map(
|
||||
provider="openai",
|
||||
voice_id="voice-p1-custom",
|
||||
persona_code="P1",
|
||||
base_params={
|
||||
"preset": "soft-young-fem",
|
||||
"openai_voice": "nova",
|
||||
"rate": 1.14,
|
||||
"instructions": "Keep the voice quiet and hesitant.",
|
||||
},
|
||||
)
|
||||
|
||||
self.assertIsNotNone(voice)
|
||||
assert voice is not None
|
||||
self.assertEqual(voice.preset, "soft-young-fem")
|
||||
self.assertEqual(voice.openai_voice, "nova")
|
||||
self.assertAlmostEqual(voice.rate, 1.14)
|
||||
self.assertEqual(voice.instructions, "Keep the voice quiet and hesitant.")
|
||||
|
||||
def test_openai_persona_voice_map_can_use_voice_id_as_openai_voice(self) -> None:
|
||||
voice = resolve_voice_from_map(
|
||||
provider="openai",
|
||||
voice_id="verse",
|
||||
persona_code="P2",
|
||||
base_params={"preset": "calm-adult-male"},
|
||||
)
|
||||
|
||||
self.assertIsNotNone(voice)
|
||||
assert voice is not None
|
||||
self.assertEqual(voice.preset, "calm-adult-male")
|
||||
self.assertEqual(voice.openai_voice, "verse")
|
||||
|
||||
def test_non_openai_persona_voice_map_returns_none_for_safe_fallback(self) -> None:
|
||||
self.assertIsNone(
|
||||
resolve_voice_from_map(
|
||||
provider="higgs",
|
||||
voice_id="p1-synthetic",
|
||||
persona_code="P1",
|
||||
base_params={"openai_voice": "coral"},
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class TTSPayloadTest(unittest.TestCase):
|
||||
def test_payload_contains_openai_tts_fields_and_clamps_high_speed(self) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue