Skip to content
Trouble getting the...
 
Notifications
Clear all

Trouble getting the current date into Google Calendar using an AI Agent

7 Posts
4 Users
0 Reactions
5 Views
Ignacio_de_Diego
(@ignacio_de_diego)
Posts: 3
Active Member
Topic starter
 

:puzzle_piece:

Problem
I’m using an AI Agent in callin.io to handle appointment requests. The agent interacts with a Google Calendar Tool (e.g., Create Event or Check Availability). The challenge is that when a user requests something like “I want an appointment on Friday”, the model occasionally provides a date with the incorrect year (e.g., 2023) instead of the current year.

:white_check_mark:

What I want to do
I’d like to incorporate the current date and time into the model’s context—perhaps using something like {{ $now }}—either within the Agent’s System Message or the Tool Prompt Template. The goal is to ensure it consistently uses the current year or the next one (never a past year).

image

 
Posted : 14/06/2025 8:49 am
darrell_tw
(@darrell_tw)
Posts: 18
Active Member
 

Yes, when I require the date.

I will include this in the prompt:

Today is {{ $now.format('yyyy-MM-dd') }}

Then the AI will understand how to handle the date for tomorrow or next Wednesday.

 
Posted : 14/06/2025 8:52 am
Ignacio_de_Diego
(@ignacio_de_diego)
Posts: 3
Active Member
Topic starter
 

And where do I need to add that command? Should it be in the system message or elsewhere?

 
Posted : 14/06/2025 11:10 am
darrell_tw
(@darrell_tw)
Posts: 18
Active Member
 

Yes, I've placed it within the system message.

 
Posted : 14/06/2025 12:04 pm
nazir
(@nazir)
Posts: 1
New Member
 

Hi

I believe in your System Message/Prompt, you either haven't set up the date as Today is {{ $now }} or it hasn't been configured as an expression.

 
Posted : 14/06/2025 12:57 pm
Ignacio_de_Diego
(@ignacio_de_diego)
Posts: 3
Active Member
Topic starter
 

My issue was that I hadn't selected the expression format. Many thanks to both of you.

 
Posted : 15/06/2025 10:17 am
system
(@system)
Posts: 332
Reputable Member
 

This thread was automatically closed 7 days following the last response. New replies are no longer permitted.

 
Posted : 22/06/2025 10:18 am
Share: