Spaces:
Runtime error
Runtime error
Download bot_config.py from Smartwaylabs/pipecat-livekit: direct link, hf CLI and curl.
- Browser
- Download file 1.81 kB
-
https://huggingface.co/spaces/Smartwaylabs/pipecat-livekit/resolve/main/bot_config.py
- Command line
-
hf download hf://spaces/Smartwaylabs/pipecat-livekit/bot_config.py
-
curl -L -o bot_config.py https://huggingface.co/spaces/Smartwaylabs/pipecat-livekit/resolve/main/bot_config.py
1.81 kB
| """ | |
| Bot configuration schema and utilities. | |
| Supports multiple transport types through a unified configuration. | |
| """ | |
| from enum import Enum | |
| from typing import Optional, Any, Callable | |
| from pydantic import BaseModel | |
| class TransportType(str, Enum): | |
| """Supported transport types for voice AI.""" | |
| DAILY = "daily" # WebRTC/RTVI via Daily.co | |
| LIVEKIT = "livekit" # WebRTC via LiveKit Cloud | |
| TWILIO = "twilio" # Media Streams via WebSocket | |
| # Future: EXOTEL, PLIVO, TATA, etc. | |
| class BotConfig(BaseModel): | |
| """ | |
| Unified configuration for bot sessions across all transport types. | |
| """ | |
| # Transport type | |
| transport_type: TransportType = TransportType.DAILY | |
| # Core settings | |
| bot_name: str = "bot" | |
| # Recording settings | |
| local_recording: bool = False | |
| recording_dir: str = "/tmp" | |
| # RTVI settings (Daily.co only) | |
| rtvi_enabled: bool = True | |
| # Session info | |
| session_id: Optional[str] = None | |
| # Daily.co specific | |
| room_url: Optional[str] = None | |
| token: Optional[str] = None | |
| # LiveKit specific | |
| livekit_url: Optional[str] = None | |
| livekit_token: Optional[str] = None | |
| livekit_room_name: Optional[str] = None | |
| participant_identity: str = "bot" | |
| # Twilio specific | |
| call_sid: Optional[str] = None | |
| stream_sid: Optional[str] = None | |
| caller_number: Optional[str] = None | |
| # Agent ID for loading botData from database | |
| agent_id: Optional[str] = None | |
| # Bot data (can be provided directly or loaded from DB via agent_id) | |
| bot_data: Optional[dict] = None | |
| # Pre-created transport (for Twilio WebSocket) | |
| transport: Optional[Any] = None | |
| # Callback to save transcript to database (for Twilio) | |
| on_call_complete: Optional[Callable] = None | |
| class Config: | |
| arbitrary_types_allowed = True | |