clean: archive legacy stt/tts/llm services; update ARCHITECTURE.md + README.md to current stack (REST gpt-4o-transcribe, nano, sage, Honcho, incremental TTS, white noise)

Per PLAN item 6. Legacy files moved to archive/legacy-pipeline/.
This commit is contained in:
2026-06-04 15:54:12 -04:00
parent 59b72aa184
commit 1bfc8333e9
5 changed files with 24 additions and 22 deletions
+27
View File
@@ -0,0 +1,27 @@
"""Speech-to-text via OpenAI Whisper API"""
import logging
from openai import AsyncOpenAI
from config import settings
logger = logging.getLogger("kira.stt")
def _get_client() -> AsyncOpenAI:
return AsyncOpenAI(api_key=settings.openai_api_key)
async def transcribe_audio(audio_bytes: bytes) -> str | None:
"""Transcribe audio bytes to text using Whisper API."""
try:
client = _get_client()
transcript = await client.audio.transcriptions.create(
model="whisper-1",
file=("audio.webm", audio_bytes, "audio/webm"),
language="en",
response_format="text",
)
return transcript.strip() if transcript and transcript.strip() else None
except Exception as e:
logger.error(f"STT error: {e}")
return None