From 20f553f72181ad8c605f0d1a56b1c40f63404fe5 Mon Sep 17 00:00:00 2001 From: Abbas Asad <168946441+Abbas-Asad@users.noreply.github.com> Date: Thu, 14 Aug 2025 23:15:38 +0500 Subject: [PATCH] Docs: Add missing docstring to how_many_jokes tool ## Summary Added a missing docstring to the `how_many_jokes` function in the `stream_items` example to improve code documentation and tool description. ## Problem The `how_many_jokes` function was missing a docstring, which is important for: - Function documentation and code clarity - Tool description that the LLM uses to understand when to call the tool - Following Python best practices for function documentation ## Changes Made Added a clear and precise docstring to the `how_many_jokes` function: ```python def how_many_jokes() -> int: """Return a random integer of jokes to tell between 1 and 10 (inclusive).""" return random.randint(1, 10) ``` The docstring provides a clear description of the function's purpose and helps both developers and LLMs understand when and how to use this tool. --- examples/basic/stream_items.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/basic/stream_items.py b/examples/basic/stream_items.py index c1f2257a5..9ba01accf 100644 --- a/examples/basic/stream_items.py +++ b/examples/basic/stream_items.py @@ -6,6 +6,7 @@ @function_tool def how_many_jokes() -> int: + """Return a random integer of jokes to tell between 1 and 10 (inclusive).""" return random.randint(1, 10)