[文档验收]:完成全双工Agent文档和最终门禁,包含安全策略、验收命令和OpenSpec校验
This commit is contained in:
@@ -166,6 +166,7 @@ class ModelsConfigTests(unittest.TestCase):
|
||||
"OWNER_AUDIO_RING_BUFFER_MS=1200",
|
||||
"OWNER_INTERRUPT_ENABLED=0",
|
||||
"OWNER_INTERRUPT_TARGET_LATENCY_MS=180",
|
||||
"OWNER_LLM_STREAMING_ENABLED=0",
|
||||
"OWNER_STREAMING_STT_PROVIDER=sherpa_onnx",
|
||||
"OWNER_STREAMING_STT_PRODUCT_CANDIDATE=faster_whisper",
|
||||
"OWNER_STREAMING_TTS_PROVIDER=macos_say",
|
||||
@@ -196,6 +197,7 @@ class ModelsConfigTests(unittest.TestCase):
|
||||
self.assertEqual(config.audio_ring_buffer_ms, 1200)
|
||||
self.assertFalse(config.interrupt_enabled)
|
||||
self.assertEqual(config.interrupt_target_latency_ms, 180)
|
||||
self.assertFalse(config.llm_stream)
|
||||
self.assertEqual(config.streaming_stt_provider, "sherpa_onnx")
|
||||
self.assertEqual(config.streaming_stt_product_candidate, "faster_whisper")
|
||||
self.assertEqual(config.streaming_tts_provider, "macos_say")
|
||||
@@ -212,6 +214,26 @@ class ModelsConfigTests(unittest.TestCase):
|
||||
self.assertTrue(config.computer_control_enabled)
|
||||
self.assertEqual(config.validate_basic(), [])
|
||||
|
||||
def test_llm_streaming_enabled_takes_precedence_over_legacy_llm_stream(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
path = f"{tmp}/.env"
|
||||
with open(path, "w", encoding="utf-8") as handle:
|
||||
handle.write("OWNER_LLM_STREAM=0\nOWNER_LLM_STREAMING_ENABLED=1\n")
|
||||
|
||||
config = AppConfig.from_dotenv(path)
|
||||
|
||||
self.assertTrue(config.llm_stream)
|
||||
|
||||
def test_legacy_llm_stream_still_disables_streaming(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
path = f"{tmp}/.env"
|
||||
with open(path, "w", encoding="utf-8") as handle:
|
||||
handle.write("OWNER_LLM_STREAM=0\n")
|
||||
|
||||
config = AppConfig.from_dotenv(path)
|
||||
|
||||
self.assertFalse(config.llm_stream)
|
||||
|
||||
def test_speech_provider_must_be_cloud_or_local(self) -> None:
|
||||
config = AppConfig(speech_provider="invalid")
|
||||
errors = config.validate_basic()
|
||||
|
||||
Reference in New Issue
Block a user