Skip to content

Commit 536d98c

Browse files
Merge pull request #944 from MervinPraison/claude/fix-ollama-response-overwrite-20250715-2344
fix: prevent Ollama tool summary from being overwritten by empty response
2 parents e5e1113 + ec336d3 commit 536d98c

File tree

1 file changed

+2
-2
lines changed
  • src/praisonai-agents/praisonaiagents/llm

1 file changed

+2
-2
lines changed

src/praisonai-agents/praisonaiagents/llm/llm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ def get_response(
11201120
else:
11211121
# No tool calls, we're done with this iteration
11221122
# If we've executed tools in previous iterations, this response contains the final answer
1123-
if iteration_count > 0:
1123+
if iteration_count > 0 and not final_response_text:
11241124
final_response_text = response_text.strip() if response_text else ""
11251125
break
11261126

@@ -1869,7 +1869,7 @@ async def get_response_async(
18691869
else:
18701870
# No tool calls, we're done with this iteration
18711871
# If we've executed tools in previous iterations, this response contains the final answer
1872-
if iteration_count > 0:
1872+
if iteration_count > 0 and not final_response_text:
18731873
final_response_text = response_text.strip()
18741874
break
18751875

0 commit comments

Comments
 (0)