mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 00:02:36 +00:00
clean up thoughts as well
This commit is contained in:
@@ -122,7 +122,10 @@ class CrewAgentParser:
|
|||||||
regex = r"(.*?)(?:\n\nAction|\n\nFinal Answer)"
|
regex = r"(.*?)(?:\n\nAction|\n\nFinal Answer)"
|
||||||
thought_match = re.search(regex, text, re.DOTALL)
|
thought_match = re.search(regex, text, re.DOTALL)
|
||||||
if thought_match:
|
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 ""
|
return ""
|
||||||
|
|
||||||
def _clean_action(self, text: str) -> str:
|
def _clean_action(self, text: str) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user