feat: inject current datetime into agent system prompt
Build Agents Runtime / build (push) Successful in 4m37s
Details
Build Agents Runtime / build (push) Successful in 4m37s
Details
This commit is contained in:
parent
aa36610883
commit
4284d7d2d5
|
|
@ -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,6 +109,7 @@ 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")
|
||||
|
|
@ -115,6 +117,8 @@ def run_agent_activity(payload: dict) -> str:
|
|||
|
||||
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}.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue