clean up thoughts as well

This commit is contained in:
Brandon Hancock
2025-02-18 15:17:59 -05:00
parent 091713b070
commit 66eaf2744a

View File

@@ -122,7 +122,10 @@ class CrewAgentParser:
regex = r"(.*?)(?:\n\nAction|\n\nFinal Answer)"
thought_match = re.search(regex, text, re.DOTALL)
if thought_match:
return thought_match.group(1).strip()
thought = thought_match.group(1).strip()
# Remove any triple backticks from the thought string
thought = thought.replace("```", "").strip()
return thought
return ""
def _clean_action(self, text: str) -> str: