From b05b6d565e1e665d241b3b8a623f4f11d1dd9f41 Mon Sep 17 00:00:00 2001 From: Abbas Asad <168946441+Abbas-Asad@users.noreply.github.com> Date: Thu, 14 Aug 2025 03:38:02 +0500 Subject: [PATCH] Fix: Clarify random_number function docstring for inclusive range The random_number function docstring was ambiguous, using "up to the provided maximum" which could be interpreted as either inclusive or exclusive of the maximum value. The implementation correctly uses random.randint(0, max) which generates numbers from 0 to max inclusive, matching the expected behavior based on usage in the example. Changed the docstring from: "Generate a random number up to the provided maximum." To: "Generate a random number from 0 to max (inclusive)." This makes the behavior explicit and eliminates potential confusion for developers using this function. --- examples/basic/agent_lifecycle_example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/basic/agent_lifecycle_example.py b/examples/basic/agent_lifecycle_example.py index b4334a83b..fbfd905a1 100644 --- a/examples/basic/agent_lifecycle_example.py +++ b/examples/basic/agent_lifecycle_example.py @@ -49,7 +49,7 @@ async def on_tool_end( @function_tool def random_number(max: int) -> int: """ - Generate a random number up to the provided maximum. + Generate a random number from 0 to max (inclusive). """ return random.randint(0, max)