I’ve been beating my head against the wall for the past month and can’t get this fixed.
I’m running cloud-based version [email protected]. This is my current workflow:
I’m using this JavaScript in Current Date/Time:
const now = new Date();
const boiseTZ = new Intl.DateTimeFormat('en-US', {
timeZone: 'America/Boise',
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
timeZoneName: 'short'
}).format(now);
items[0].json = {
...items[0].json,
currentDateAndTime: boiseTZ
};
return items;
This is at the start of the System Message in the Tools Agent:
SYSTEM INSTRUCTION: The current date and time is {{ $json.currentDateAndTime }}. You MUST use this exact date and time for all responses. Never use any other date. If asked about the current date or time, you must respond with this exact date and time.
I’ve tried simply using {{ now }} in the system message, and it did not work.
I’ve tried it with just {{ now }} in the system message and no Current Date/Time code node with no success.
I have probably tried over 100 things at this point and cannot get the Tools agent to pass the current (dynamically set) date.
From what I understand, the issue is that OpenAI Chat Model only knows the last date it saw, which was October 27, 2023. It seems to me like current date is extremely important! How do we get the system to pass the current date?