[文档、验收与归档]:完成真实运行说明和OpenSpec归档,包含README、最终门禁和主规范更新

This commit is contained in:
mkbk
2026-06-17 20:17:04 +08:00
parent 4b7cd18a0f
commit 445eebeaec
15 changed files with 320 additions and 143 deletions
+18 -4
View File
@@ -1,6 +1,7 @@
from __future__ import annotations
import io
import base64
import json
import unittest
@@ -75,7 +76,17 @@ class PipelineLlmTtsTests(unittest.TestCase):
return None
def read(self) -> bytes:
return b"fake-mp3"
return json.dumps(
{
"choices": [
{
"message": {
"audio": {"data": base64.b64encode(b"fake-wav").decode("ascii")}
}
}
]
}
).encode()
requests = []
@@ -90,11 +101,14 @@ class PipelineLlmTtsTests(unittest.TestCase):
provider.load()
segment = provider.synthesize("你好")
self.assertEqual(segment.metadata["format"], "mp3")
self.assertEqual(segment.pcm, b"fake-mp3")
self.assertEqual(segment.metadata["format"], "wav")
self.assertEqual(segment.pcm, b"fake-wav")
body = json.loads(requests[0].data.decode())
self.assertEqual(body["model"], "mimo-v2.5-tts")
self.assertIn("/v1/audio/speech", requests[0].full_url)
self.assertEqual(body["messages"][0]["role"], "assistant")
self.assertEqual(body["messages"][0]["content"], "你好")
self.assertEqual(body["audio"]["format"], "wav")
self.assertIn("/v1/chat/completions", requests[0].full_url)
def test_pipeline_runs_from_wake_to_playback(self) -> None:
frames = [