Skip to content

add time tools#231

Open
mlikasam-askui wants to merge 2 commits intofeat/caching_v02from
feat/add-wait-tool-for-caching-v2
Open

add time tools#231
mlikasam-askui wants to merge 2 commits intofeat/caching_v02from
feat/add-wait-tool-for-caching-v2

Conversation

@mlikasam-askui
Copy link
Contributor

No description provided.


def __call__(self) -> str:
now = datetime.now(timezone.utc)
return now.strftime("%Y-%m-%d %H:%M:%S UTC")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we always want utc? Local timezone or system time would make more sense no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case the report is shared between colleagues in different time zones, I use UTC. The alternative would be to include a note specifying the time zone along with the local time, but using UTC is simpler and easier 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add it to the tool store we should at least add an option for that (in the init or as parameter for the agent). Who knows what people are using this tool for in the future, e.g. "Please verify if the clock on this system is correct"...


def __call__(self) -> str:
now = datetime.now(timezone.utc)
return now.strftime("%Y-%m-%d %H:%M:%S UTC")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could make the response for the agent a sentence like "Today is (date) and currently it is (time) (timezone)

self._max_wait_time = max_wait_time

def __call__(self, wait_duration: float) -> str:
if wait_duration < 0.1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why even bother with a minimum wait duration? I think we are fine as long as it is not negative, no?

"maximum": max_wait_time,
},
},
"required": ["max_wait_time", "check_interval"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would provide a default for check_interval and hence make it not required

self._max_wait_time = max_wait_time

def __call__(self, max_wait_time: float, check_interval: float) -> str:
if max_wait_time < 10:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above. I think we dont need a minimum wait time

"maximum": max_wait_time,
},
"check_interval": {
"type": "number",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not an integer? I dont think we need float precision here

if max_wait_time > self._max_wait_time:
msg = f"max_wait_time must not exceed {self._max_wait_time}"
raise ValueError(msg)
if check_interval < 1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be omitted if check_interval is an integer

@mlikasam-askui mlikasam-askui force-pushed the feat/add-wait-tool-for-caching-v2 branch from 667e163 to 9bcb128 Compare February 16, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments