""" 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())