-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Missing None check for el.output
when validating final answer. The code checks isinstance(el, FinalOutput)
but doesn't verify that el.output
is not None before attempting to validate the final answer, which can cause False finalizing.
Expected behavior
The code should check if el.output
is not None before attempting to use it:
if self.final_answer_checks and el.output is not None:
self._validate_final_answer(final_answer)
Existing Code
smolagents/src/smolagents/agents.py
Line 513 in 7113cf6
if self.final_answer_checks: |
One more thing
I think yield
ing FinalOutput
when output is None (which happens when is_final_answer
is False) is somehow not correct in terms of typing.
Packages version:
smolagents==1.18.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working