d901208032
- pipeline.py: switched LLM from OpenClaw/Claude to local Ollama, added settings loading, sentence aggregator, async SpeechBrain, tuned VAD - main.py: simplified (no more token server thread, just pipeline) - token_server.py: NEW - standalone token + settings API server - docker-compose.yml: all services on GPU machine, added token-server service, CUDA speaches, Ollama LLM - web-client/index.html: added settings panel with sliders - web-client/app.js: settings management, localStorage persistence, push to server - web-client/style.css: settings panel styles - web-client/nginx.conf: proxy to token-server instead of pipecat-agent - patch_livekit.py: updated with proper indentation-safe patching
44 lines
1.3 KiB
Python
Executable File
44 lines
1.3 KiB
Python
Executable File
"""
|
|
VoiceCoach pipeline entry point.
|
|
Token server runs as a separate container — this file only runs the pipeline.
|
|
Pipeline exits on session end; Docker restarts the container for a fresh state.
|
|
"""
|
|
import asyncio
|
|
import logging
|
|
import os
|
|
import uuid
|
|
from datetime import timedelta
|
|
|
|
import structlog
|
|
from livekit import api as livekit_api
|
|
|
|
from pipeline import run_voice_coach_pipeline
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
logger = structlog.get_logger()
|
|
|
|
LIVEKIT_API_KEY = os.environ["LIVEKIT_API_KEY"]
|
|
LIVEKIT_API_SECRET = os.environ["LIVEKIT_API_SECRET"]
|
|
LIVEKIT_WS_URL = os.getenv("LIVEKIT_URL", "ws://livekit-server:7880")
|
|
|
|
|
|
async def main():
|
|
agent_identity = f"voicecoach-agent-{uuid.uuid4().hex[:8]}"
|
|
token = livekit_api.AccessToken(LIVEKIT_API_KEY, LIVEKIT_API_SECRET)
|
|
token.with_grants(livekit_api.VideoGrants(room_join=True, room="voicecoach"))
|
|
token.identity = agent_identity
|
|
token.ttl = timedelta(hours=24)
|
|
livekit_token = token.to_jwt()
|
|
|
|
logger.info("Starting VoiceCoach pipeline", identity=agent_identity)
|
|
await run_voice_coach_pipeline(
|
|
livekit_url=LIVEKIT_WS_URL,
|
|
livekit_token=livekit_token,
|
|
openclaw_token="",
|
|
)
|
|
logger.info("Pipeline exited")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|