changing method naming to increment

This commit is contained in:
João Moura
2024-02-28 02:14:28 -03:00
parent a9863fe670
commit 3df3bba756
2 changed files with 3 additions and 3 deletions

View File

@@ -255,7 +255,7 @@ class Agent(BaseModel):
agent=RunnableAgent(runnable=inner_agent), **executor_args agent=RunnableAgent(runnable=inner_agent), **executor_args
) )
def count_formatting_errors(self) -> None: def increment_formatting_errors(self) -> None:
"""Count the formatting errors of the agent.""" """Count the formatting errors of the agent."""
self.formatting_errors += 1 self.formatting_errors += 1

View File

@@ -42,7 +42,7 @@ class CrewAgentParser(ReActSingleInputOutputParser):
if includes_tool: if includes_tool:
if includes_answer: if includes_answer:
self.agent.count_formatting_errors() self.agent.increment_formatting_errors()
raise OutputParserException(f"{FINAL_ANSWER_AND_TOOL_ERROR_MESSAGE}") raise OutputParserException(f"{FINAL_ANSWER_AND_TOOL_ERROR_MESSAGE}")
return AgentAction("", "", text) return AgentAction("", "", text)
@@ -54,7 +54,7 @@ class CrewAgentParser(ReActSingleInputOutputParser):
format = self._i18n.slice("format_without_tools") format = self._i18n.slice("format_without_tools")
error = f"{format}" error = f"{format}"
self.agent.count_formatting_errors() self.agent.increment_formatting_errors()
raise OutputParserException( raise OutputParserException(
error, error,
observation=error, observation=error,