From 29dd3bf28ff4761b988bd0194c7fa4c4477d0efc Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Fri, 13 Sep 2024 11:43:55 -0300 Subject: [PATCH] fix: remove log from csvAgent component (#3800) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🐛 (CSVAgent.py): Fix handle_parsing_errors parameter to use the correct instance variable self.handle_parsing_errors instead of a hardcoded value * 📝 (CSVAgent.py): add newline at the end of the file to follow best practices and improve code readability --- .../base/langflow/components/agents/CSVAgent.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/backend/base/langflow/components/agents/CSVAgent.py b/src/backend/base/langflow/components/agents/CSVAgent.py index 444a04ae2a5..25cec6653d9 100644 --- a/src/backend/base/langflow/components/agents/CSVAgent.py +++ b/src/backend/base/langflow/components/agents/CSVAgent.py @@ -56,11 +56,13 @@ def build_agent_response(self) -> Message: } agent_csv = create_csv_agent( - llm=self.llm, path=self.path, agent_type=self.agent_type, handle_parsing_errors=True, **agent_kwargs + llm=self.llm, + path=self.path, + agent_type=self.agent_type, + handle_parsing_errors=self.handle_parsing_errors, + **agent_kwargs, ) - print(f"self.inputs = {agent_csv}") - result = agent_csv.invoke({"input": self.input_value}) return Message(text=str(result["output"])) @@ -71,7 +73,11 @@ def build_agent(self) -> AgentExecutor: } agent_csv = create_csv_agent( - llm=self.llm, path=self.path, agent_type=self.agent_type, handle_parsing_errors=True, **agent_kwargs + llm=self.llm, + path=self.path, + agent_type=self.agent_type, + handle_parsing_errors=self.handle_parsing_errors, + **agent_kwargs, ) self.status = Message(text=str(agent_csv))