Skip to content

Commit 45ef6ce

Browse files
Apply suggestion from @Unshure
Co-authored-by: Nick Clegg <nac542@gmail.com>
1 parent 41338ec commit 45ef6ce

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/strands/agent/agent.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,9 @@ async def stream_async(
583583
if invocation_state is not None:
584584
merged_state = invocation_state
585585

586-
# Get callback handler from merged state or use default
587-
invocation_state_dict = merged_state.get("invocation_state", {})
588-
callback_handler = invocation_state_dict.get(
589-
"callback_handler", merged_state.get("callback_handler", self.callback_handler)
590-
)
586+
callback_handler = self.callback_handler
587+
if kwargs:
588+
callback_handler = kwargs.get("callback_handler", self.callback_handler)
591589

592590
# Process input and get message to add (if any)
593591
messages = self._convert_prompt_to_messages(prompt)

0 commit comments

Comments
 (0)