feat: inject current datetime into agent system prompt
Build Agents Runtime / build (push) Successful in 4m37s Details

This commit is contained in:
deepkoluguri 2026-06-30 14:39:26 -04:00
parent aa36610883
commit 4284d7d2d5
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@ import os
import requests
import threading
import time
from datetime import datetime
from langchain_core.tools import tool
from langchain_google_genai import ChatGoogleGenerativeAI
from langgraph.prebuilt import create_react_agent
@ -108,12 +109,15 @@ def run_agent_activity(payload: dict) -> str:
user_request = payload.get("text", "")
target_jid = payload.get("targetJid", "default")
sender = payload.get("sender", "Unknown")
current_datetime = datetime.now().strftime("%A, %B %d %Y %I:%M %p")
primary_llm = ChatGoogleGenerativeAI(model="gemini-2.5-flash")
fallback_llm = ChatGoogleGenerativeAI(model="gemini-2.5-pro")
llm = primary_llm.with_fallbacks([fallback_llm])
system_prompt = f"""You are a highly capable AI assistant operating as an orchestrator.
CURRENT DATE AND TIME: {current_datetime}. Use this for all date/time calculations. Never ask the user for the current date or time.
The user ({sender}) has sent a message.
Their routing ID (target_jid) is: {target_jid}.