fix the _extract_thought (#2398)

* fix the _extract_thought

the regex string should be same with prompt in en.json:129
...\nThought: I now know the final answer\nFinal Answer: the...

* fix Action match

---------

Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
This commit is contained in:
Arthur Chien
2025-03-21 03:44:44 +08:00
committed by GitHub
parent df266bda01
commit b766af75f2

View File

@@ -124,9 +124,9 @@ class CrewAgentParser:
) )
def _extract_thought(self, text: str) -> str: def _extract_thought(self, text: str) -> str:
thought_index = text.find("\n\nAction") thought_index = text.find("\nAction")
if thought_index == -1: if thought_index == -1:
thought_index = text.find("\n\nFinal Answer") thought_index = text.find("\nFinal Answer")
if thought_index == -1: if thought_index == -1:
return "" return ""
thought = text[:thought_index].strip() thought = text[:thought_index].strip()