Skip to content

Commit ac2816f

Browse files
zimegmwbrooks
andauthored
docs: improve comments to reason about sections of code
Co-authored-by: Michael Brooks <michael@michaelbrooks.ca>
1 parent 4a5de84 commit ac2816f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

ai/tools/dice.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def roll_dice(sides: int = 6, count: int = 1) -> dict:
1818
"rolls": [],
1919
"total": 0,
2020
}
21+
22+
# Roll the dice and calculate the total
2123
rolls = [random.randint(1, sides) for _ in range(count)]
2224
total = sum(rolls)
2325

listeners/assistant/message.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def message(
4141
user_id = context.user_id
4242

4343
# This first example shows a generated text response for the provided prompt
44+
# displayed as a timeline.
4445
if message["text"] != "Wonder a few deep thoughts.":
4546
set_status(
4647
status="thinking...",
@@ -74,6 +75,7 @@ def message(
7475
)
7576

7677
# The second example shows detailed thinking steps similar to tool calls
78+
# displayed as plan.
7779
else:
7880
streamer = client.chat_stream(
7981
channel=channel_id,

0 commit comments

Comments
 (0)