feat(voice): add isolated Local S2S v3 candidate and acceptance evidence
Extract the provider boundary while retaining OpenAI/Gemini contracts. Add an opt-in isolated Local S2S adapter, pinned engine extension, bounded component gateway and frozen effective configuration profiles. Enforce request token limits, zero retries, local asset validation, connection deadlines, disconnect ownership, bounded cleanup and signals. Include regression coverage, pinned source fixtures, operator guidance, asset fingerprints and guarded disposable PostgreSQL acceptance tooling. Preserve immutable fixture bytes across Git line-ending conversion. Validation recorded in the reports: - 74 repair, 107 combined and 242 preservation checks passed. - Fresh PostgreSQL local checks: 2 passed. - Expanded PostgreSQL: 57 passed, 6 documented baseline failures. - Compose configurations, staged whitespace and fixture hashes passed. Phase 1 live listening and Phase 2 complete engine/SDK/POSIX, real component audio and Persian browser acceptance remain pending. No operational switch, paid call, model download or Phase 3 implementation is included.
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
"""Selected voice transport construction shared by the API and operator smoke."""
|
||||
import asyncio
|
||||
from app.modules.voice.provider import VoiceProvider
|
||||
from app.infrastructure.gemini_live import GeminiLiveAdapter, connect_gemini
|
||||
from app.infrastructure.realtime import RealtimeAdapter, connect as connect_openai
|
||||
|
||||
|
||||
async def create_adapter(config, limits):
|
||||
async def create_adapter(config, limits) -> VoiceProvider:
|
||||
config.require_voice()
|
||||
if config.provider == 'local_s2s':
|
||||
from app.infrastructure.local_s2s import LocalS2SAdapter, connect_local
|
||||
if limits.output_capacity_profile != 'standard':
|
||||
raise ValueError('OpenAI output capacity cannot be used for local S2S')
|
||||
transport = await asyncio.wait_for(connect_local(config, limits), limits.connect_timeout_seconds)
|
||||
try:
|
||||
return LocalS2SAdapter(transport, config=config, settings=limits)
|
||||
except BaseException:
|
||||
await asyncio.wait_for(transport.close(), limits.send_timeout_seconds)
|
||||
raise
|
||||
if config.provider == 'gemini' and limits.output_capacity_profile != 'standard':
|
||||
raise ValueError('OpenAI output capacity cannot be used for Gemini')
|
||||
input_settings = None
|
||||
|
||||
Reference in New Issue
Block a user