diff --git a/src/crewai/agents/parser.py b/src/crewai/agents/parser.py index 1bda4df5cb..05c5bc0034 100644 --- a/src/crewai/agents/parser.py +++ b/src/crewai/agents/parser.py @@ -124,9 +124,9 @@ def parse(self, text: str) -> Union[AgentAction, AgentFinish]: ) def _extract_thought(self, text: str) -> str: - thought_index = text.find("\n\nAction") + thought_index = text.find("\nAction") if thought_index == -1: - thought_index = text.find("\n\nFinal Answer") + thought_index = text.find("\nFinal Answer") if thought_index == -1: return "" thought = text[:thought_index].strip()