diff --git a/src/crewai/agents/parser.py b/src/crewai/agents/parser.py index 1cf05e455..58605b692 100644 --- a/src/crewai/agents/parser.py +++ b/src/crewai/agents/parser.py @@ -103,10 +103,6 @@ class CrewAgentParser: return AgentFinish(thought, final_answer, text) elif action_match: - if includes_answer: - raise OutputParserException( - f"{FINAL_ANSWER_AND_PARSABLE_ACTION_ERROR_MESSAGE}" - ) action = action_match.group(1) clean_action = self._clean_action(action) diff --git a/tests/agents/test_crew_agent_parser.py b/tests/agents/test_crew_agent_parser.py index 4b48e1552..18bb1d523 100644 --- a/tests/agents/test_crew_agent_parser.py +++ b/tests/agents/test_crew_agent_parser.py @@ -227,13 +227,6 @@ def test_missing_action_input_error(parser): assert "I missed the 'Action Input:' after 'Action:'." in str(exc_info.value) -def test_action_and_final_answer_error(parser): - text = "Thought: I found the information\nAction: search\nAction Input: what is the temperature in SF?\nFinal Answer: The temperature is 100 degrees" - with pytest.raises(OutputParserException) as exc_info: - parser.parse(text) - assert "both perform Action and give a Final Answer" in str(exc_info.value) - - def test_safe_repair_json(parser): invalid_json = '{"task": "Research XAI", "context": "Explainable AI", "coworker": Senior Researcher' expected_repaired_json = '{"task": "Research XAI", "context": "Explainable AI", "coworker": "Senior Researcher"}'