Skip to content

Commit f76dee1

Browse files
Fix logging "None" and simplify the logic (#1788)
1 parent 498e963 commit f76dee1

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/smolagents/agents.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,13 +1285,8 @@ def _step_stream(
12851285
stop_sequences=["Observation:", "Calling tools:"],
12861286
tools_to_call_from=self.tools_and_managed_agents,
12871287
)
1288-
if chat_message.content is None and chat_message.raw is not None:
1289-
log_content = str(chat_message.raw)
1290-
else:
1291-
log_content = str(chat_message.content) or ""
1292-
12931288
self.logger.log_markdown(
1294-
content=log_content,
1289+
content=str(chat_message.content or chat_message.raw or ""),
12951290
title="Output message of the LLM:",
12961291
level=LogLevel.DEBUG,
12971292
)

0 commit comments

Comments
 (0)