ai-interview-caller / config.py
ranjithkumar111's picture
Upload 6 files
daab2d3 verified
Raw
History Blame Contribute Delete
3.37 kB
# File: config.py
# Purpose: Central configuration β€” all paths, keys, model settings, scoring weights
import os
from pathlib import Path
from dotenv import load_dotenv
load_dotenv()
# ── Base Paths ──────────────────────────────────────────────────────────────
BASE_DIR = Path(__file__).resolve().parent
DATA_DIR = BASE_DIR / "data"
MODELS_DIR = BASE_DIR / "models"
OUTPUTS_DIR = BASE_DIR / "outputs"
PROMPTS_DIR = BASE_DIR / "prompts"
# ── Database β€” SQLite for HF Spaces ──────────────────────────────────────────
DATABASE_URL = os.getenv("DATABASE_URL", "sqlite:///./ai_recruiter.db")
# ── Bland.ai ──────────────────────────────────────────────────────────────────
BLAND_API_KEY = os.getenv("BLAND_API_KEY", "")
BLAND_API_URL = "https://api.bland.ai/v1"
# ── Groq (LLM + STT) ─────────────────────────────────────────────────────────
GROQ_API_KEY = os.getenv("GROQ_API_KEY", "")
GROQ_LLM_MODEL = "llama-3.3-70b-versatile"
GROQ_STT_MODEL = "whisper-large-v3"
LLM_TEMPERATURE = 0.4
LLM_MAX_TOKENS = 512
# ── ElevenLabs ────────────────────────────────────────────────────────────────
ELEVENLABS_API_KEY = os.getenv("ELEVENLABS_API_KEY", "")
ELEVENLABS_VOICE_ID = os.getenv("ELEVENLABS_VOICE_ID", "EXAVITQu4vr4xnSDxMaL")
ELEVENLABS_MODEL_ID = "eleven_turbo_v2"
# ── Interview Settings ────────────────────────────────────────────────────────
MAX_QUESTIONS = 8
FOLLOW_UP_THRESHOLD = 0.6
SILENCE_TIMEOUT_SEC = 10
INTRO_MESSAGE = (
"Hello! I am an AI recruitment assistant calling on behalf of the hiring team. "
"I would like to ask you a few questions about your background and experience. "
"This will take around 10 minutes. Are you ready to begin?"
)
# ── Scoring Weights ────────────────────────────────────────────────────────────
SCORE_WEIGHTS = {
"communication": 0.30,
"technical_skills": 0.50,
"confidence": 0.20,
}
# ── RAG / Resume ──────────────────────────────────────────────────────────────
EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
CHROMA_PERSIST_DIR = str(DATA_DIR / "chroma_db")
CHUNK_SIZE = 400
CHUNK_OVERLAP = 80
TOP_K_RESUME_CHUNKS = 4
# ── Reproducibility ────────────────────────────────────────────────────────────
RANDOM_SEED = 42