Skip to content

Commit 9a70470

Browse files
committed
event loop - clarifying comment about handler args
1 parent a5e9f40 commit 9a70470

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/strands/event_loop/event_loop.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ def event_loop_cycle(
146146
)
147147

148148
try:
149+
# TODO: As part of the migration to async-iterator, we will continue moving callback_handler calls up the
150+
# call stack. At this point, we converted all events that were previously passed to the handler in
151+
# `stream_messages` into yielded events that now have the "callback" key. To maintain backwards
152+
# compatability, we need to combine the event with kwargs before passing to the handler. This we will
153+
# revisit when migrating to strongly typed events.
149154
for event in stream_messages(model, system_prompt, messages, tool_config):
150155
if "callback" in event:
151156
inputs = {**event["callback"], **(kwargs if "delta" in event["callback"] else {})}

0 commit comments

Comments
 (0)