src/core/settings.py and loaded from a .env file.
Configuration Loading
The application uses Pydantic settings with the following behavior:- Reads from
.envfile in the project root - Environment variables override
.envfile values - Case-insensitive variable names
- Extra unknown variables are ignored
General Settings
Application name identifier
Enable debug mode for verbose logging and development features
Application environment. Set to
test to skip required environment variable validationOptions: prod, dev, testLogging verbosity levelOptions:
DEBUG, INFO, WARNING, ERROR, CRITICALDatabase Settings
MongoDB connection URIExample:
MongoDB database name for storing call data and tenant configurations
Collection name for storing call transcripts and conversation items
Collection name for storing call metadata, summaries, and token metrics
OpenAI Settings
OpenAI API key for authenticationSecurity: This is a secret value. Store securely and never commit to version control.
OpenAI project identifier for tracking usage and billing
Base URL for OpenAI API. Change this to use a custom endpoint or proxy
Model used for generating post-call summaries
Secret for validating incoming webhooks from OpenAISecurity: Change this from the default value in production
Realtime Model Settings
OpenAI Realtime model for SIP-based calls
OpenAI Realtime model for WebSocket-based calls
WebSocket URL for OpenAI Realtime API
Audio sample rate in Hz for WebSocket connections
Audio chunk size in bytes for WebSocket streaming
Voice & Conversation Settings
Default voice for the AI agentOptions: Check OpenAI Realtime API documentation for available voices
Speech speed multiplier. Range: 0.5 to 2.0
1.0= normal speed< 1.0= slower> 1.0= faster
Maximum number of tokens in AI responses
Tool calling behavior for the AI agentOptions:
auto, required, noneMaximum number of simultaneous active calls
Prompt Configuration
Filename for the main instruction prompt in the prompts folderLocation:
data/prompts/Filename for the greeting prompt in the prompts folderLocation:
data/prompts/Email Settings (SMTP)
SMTP server hostname for sending emails
SMTP server port. Common values:
587= TLS (recommended)465= SSL25= unencrypted
SMTP authentication username
SMTP authentication passwordSecurity: This is a secret value. Store securely.
Email address to use as sender for outgoing emails
Default recipient email address for summaries
Blind carbon copy (BCC) recipient for all outgoing emails
API Endpoints
URI for post-call processing webhook
Base URI for the calls API service
Authentication
Administrative API token for protected endpointsSecurity: Change this from the default value in production. This token provides full access to administrative functions.
Example .env File
Validation Rules
The following environment variables are required whenAPP_ENV is not set to test:
OPENAI_API_KEYOPENAI_PROJECT_IDOPENAI_WS_URL
ValueError listing the missing variables.
Accessing Settings in Code
Settings are accessible via the globalsettings object:
Secret values (like API keys and passwords) are stored as
SecretStr types. Use .get_secret_value() to access the actual string value.