From 5f3e733ba59620cf69dbabd8f7b5e2b0c7bcaaf4 Mon Sep 17 00:00:00 2001 From: Christian Gick Date: Sat, 21 Feb 2026 20:28:13 +0200 Subject: [PATCH] feat: Voice prompt with model transparency, datetime, auto language - Bot tells which model it uses when asked - Injects current UTC datetime into prompt - Responds in users language instead of always German Co-Authored-By: Claude Opus 4.6 --- voice.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/voice.py b/voice.py index 9e14078..f38bdbd 100644 --- a/voice.py +++ b/voice.py @@ -26,11 +26,14 @@ LK_API_SECRET = os.environ.get("LIVEKIT_API_SECRET", "") ELEVENLABS_KEY = os.environ.get("ELEVENLABS_API_KEY", "") DEFAULT_VOICE_ID = "JBFqnCBsd6RMkjVDRZzb" # George - warm, captivating, British male -VOICE_PROMPT = """Du bist ein hilfreicher Sprachassistent von Agiliton in einem Matrix-Anruf. -Du heisst "Agiliton Assistant". Sage NIEMALS du seist Claude, Sonnet, oder ein anderes Modell. +VOICE_PROMPT_TEMPLATE = """Du bist ein hilfreicher Sprachassistent von Agiliton in einem Matrix-Anruf. +Du heisst "Agiliton Assistant". Du basierst auf dem Modell {model}. +Wenn jemand fragt welches Modell du bist, sei transparent und sage es. + +Aktuelle Zeit: {datetime} STRIKTE Regeln: -- Antworte IMMER auf Deutsch +- Antworte in der Sprache in der der Nutzer spricht - Halte JEDE Antwort auf MAXIMAL 1-2 kurze Saetze - Sei direkt und praezise, keine Fuellwoerter - Erfinde NICHTS - keine Geschichten, keine Musik, keine Fantasie @@ -312,7 +315,9 @@ class VoiceSession: def _on_agent_speech(msg): logger.info("AGENT_SPEECH: %s", msg.text_content) - agent = Agent(instructions=VOICE_PROMPT) + now = datetime.datetime.now(datetime.timezone.utc).strftime("%A, %B %d, %Y %H:%M UTC") + prompt = VOICE_PROMPT_TEMPLATE.format(model=self.model, datetime=now) + agent = Agent(instructions=prompt) io_opts = room_io.RoomOptions( participant_identity=remote_identity, ) if remote_identity else room_io.RoomOptions()