Files
voicecoach/pipecat-agent/main.py
T
jeremy 59856bd4fc feat: initial commit — VoiceCoach real-time voice coaching pipeline
Services: Pipecat agent (LiveKit + Claude + Whisper STT + Piper TTS),
SpeechBrain analysis service, Piper TTS service, web client (nginx).
Includes LiveKit server config and docker-compose orchestration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 01:15:24 -05:00

47 lines
1.3 KiB
Python
Executable File

"""
Entry point for the Pipecat VoiceCoach agent.
Reads config from environment variables.
"""
import asyncio
import logging
import os
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()
async def main():
anthropic_key = os.environ["ANTHROPIC_API_KEY"]
livekit_api_key = os.environ["LIVEKIT_API_KEY"]
livekit_api_secret = os.environ["LIVEKIT_API_SECRET"]
livekit_url = os.getenv("LIVEKIT_URL", "ws://livekit-server:7880")
# Generate LiveKit access token for this agent
token = livekit_api.AccessToken(livekit_api_key, livekit_api_secret)
token.with_grants(livekit_api.VideoGrants(room_join=True, room="voicecoach"))
token.identity = "voicecoach-agent"
livekit_token = token.to_jwt()
session_context = {
"baseline_context": "",
"session_history": "",
"current_mode": "coaching mode",
}
logger.info("Starting VoiceCoach pipeline", livekit_url=livekit_url)
await run_voice_coach_pipeline(
livekit_url=livekit_url,
livekit_token=livekit_token,
anthropic_key=anthropic_key,
session_context=session_context,
)
if __name__ == "__main__":
asyncio.run(main())