Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions python/src/agent_squad/agents/bedrock_llm_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ async def handle_single_response(
if isinstance(item, dict) and "text" in item:
content.append(item)

toolInUse=True
# Go through response content and save text items
toolInUse = False
# Go through response content and save toolUse items
for item in response_content:
if isinstance(item, dict) and "toolUse" in item:
content.append(item)
Expand All @@ -398,7 +398,7 @@ async def handle_single_response(
if toolInUse:
if thinking_content:
content.insert(0,{"reasoningContent": thinking_content})
else:
elif thinking_content:
content.append({"reasoningContent": thinking_content})

kwargs = {
Expand Down Expand Up @@ -520,8 +520,8 @@ async def handle_streaming_response(
if isinstance(item, dict) and "text" in item:
_content.append(item)

toolInUse=True
# Go through response content and save text items
toolInUse = False
# Go through response content and save toolUse items
for item in response_content:
if isinstance(item, dict) and "toolUse" in item:
_content.append(item)
Expand All @@ -531,7 +531,7 @@ async def handle_streaming_response(
if toolInUse:
if accumulated_thinking:
_content.insert(0,{"reasoningContent": {"reasoningText": {"text": accumulated_thinking, "signature":thinking_signature}}})
else:
elif accumulated_thinking:
_content.append({"reasoningContent": {"reasoningText": {"text": accumulated_thinking, "signature":thinking_signature}}})


Expand Down