fix: cot gent duplicate messages (#4470)

This commit is contained in:
Yeuoly 2024-05-17 13:32:02 +08:00 committed by GitHub
parent 091fba74cb
commit c2a8fa91b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -189,7 +189,7 @@ class CotAgentRunner(BaseAgentRunner, ABC):
if not scratchpad.action:
# failed to extract action, return final answer directly
final_answer = scratchpad.agent_response or ''
final_answer = ''
else:
if scratchpad.action.action_name.lower() == "final answer":
# action is final answer, return final answer directly