Build the system prompt for a call by injecting live values into the template. WHY a template + injector: the persona/rules live in voice_agent_system_prompt.md (editable without touching code), and only the volatile bits — today's date, the current IST time, business hours, and
"""Build the system prompt for a call by injecting live values into the template.
WHY a template + injector: the persona/rules live in voice_agent_system_prompt.md
(editable without touching code), and only the volatile bits — today's date, the
current IST time, business hours, and the caller's number — are filled in per call.
"""
from __future__ import annotations
import os
from datetime import datetime, timedelta, timezone
from pathlib import Path
_PROMPT_PATH = Path(__file__).parent / "voice_agent_system_prompt.md"
_IST = timezone(timedelta(hours=5, minutes=30))
def _load_template() -> str:
return _PROMPT_PATH.read_text(encoding="utf-8")
def build_system_prompt(caller_phone: str = "unknown", now: datetime | None = None) -> str:
"""Return the full system prompt with place
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key