Initial commit: Voice Assistant Gateway mit Konfig-/Routing-Fundament
- FastAPI-Gateway mit REST-Endpunkten (chat/speak/transcribe/devices/sessions/config) - Geschichtete Konfiguration mit Profilen (local-dev/hybrid/cloud) via TOML + ENV - Registry-Pattern + einheitliche Route-Aufloesung (Default->Profil->ENV->Session->Request) - Device Router (strikt, Singleton) und Output-Lifecycle im Orchestrator - OpenRouter-Adapter (STT multipart/LLM/TTS) + lokale Provider-Stubs - Regelbasierte Pipeline (Cleaner/Spoken-Adapter/TTS-Normalizer) - 22 automatisierte Tests; Doku: README, BEDIENUNGSANLEITUNG, Architektur - Secrets ausschliesslich ueber Umgebung; .env und lokale config gitignored Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
commit
293ed257db
72 changed files with 2612 additions and 0 deletions
43
tests/test_audio_router.py
Normal file
43
tests/test_audio_router.py
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import asyncio
|
||||
|
||||
import pytest
|
||||
|
||||
from app.audio.router import AudioRouter
|
||||
from app.audio.endpoints.input.local_default import LocalDefaultInput
|
||||
from app.audio.endpoints.input.bluetooth import BluetoothInput
|
||||
from app.audio.endpoints.output.local_default import LocalDefaultOutput
|
||||
from app.audio.endpoints.output.loopback import LoopbackOutput
|
||||
from app.errors import UnknownEndpointError
|
||||
|
||||
|
||||
def make_router():
|
||||
return AudioRouter(
|
||||
inputs=[LocalDefaultInput(), BluetoothInput()],
|
||||
outputs=[LocalDefaultOutput(), LoopbackOutput()],
|
||||
)
|
||||
|
||||
|
||||
def test_select_default_output():
|
||||
router = make_router()
|
||||
endpoint = asyncio.run(router.select_output())
|
||||
caps = asyncio.run(endpoint.capabilities())
|
||||
assert caps.default is True
|
||||
assert caps.kind == "local-default"
|
||||
|
||||
|
||||
def test_select_output_by_kind():
|
||||
router = make_router()
|
||||
endpoint = asyncio.run(router.select_output("loopback"))
|
||||
assert asyncio.run(endpoint.capabilities()).kind == "loopback"
|
||||
|
||||
|
||||
def test_select_input_by_id():
|
||||
router = make_router()
|
||||
endpoint = asyncio.run(router.select_input("local-default-mic"))
|
||||
assert asyncio.run(endpoint.capabilities()).id == "local-default-mic"
|
||||
|
||||
|
||||
def test_unknown_endpoint_raises():
|
||||
router = make_router()
|
||||
with pytest.raises(UnknownEndpointError):
|
||||
asyncio.run(router.select_output("does-not-exist"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue