Skip to content

Conversation

@pathfinder-analytics-uk

This PR updates the prompt in units/en/unit2/smolagents/code_agents.mdx to ensure the agent reliably calculates the actual wall-clock time and not just the duration.

Issue

With the previous wording:

“If we start right now, at what time will the party be ready?”

the agent would sometimes compute only the total duration instead of the final timestamp.
The first screenshot shows this behaviour: the agent returns “3.0 hours” instead of a clock time.

This happens because the model interprets the question ambiguously and chooses the simpler calculation.

Screenshot 2025-11-30 at 15 01 57

Fix

A short clarifying sentence was added:

“Please calculate the actual clock time, not just the duration.”

This makes the instruction unambiguous.
As shown in the second screenshot, the agent now correctly imports datetime, computes the current time, adds the total minutes, and returns the actual finishing time (e.g., “06:14 PM”).

Screenshot 2025-11-30 at 15 15 01

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.

1 participant