I am using a csv file with tabular data; I have a column called ‘product_name’ which I pass as part of the inputs to the crew. Then I ask an Agent to use the CSVSearchTool to retrieve the data for this product, but the data does not match, is as if the Agent retrieves data for other products. Is there documentation or examples that show how to use CSV files or structured data and how Agents can read it and use it? I have set the LLM temperature to zero to reduce the risk of hallucinations, but it seems the Agent is not able to find the correct information from CSV file.
1 Like
@jets6276 Set allow_code_execution
to True
for the agent. This allows the agent to write and run code when executing tasks, which should help improve the performance. Default is False
.
1 Like
rokbenko’s solution didn’t seem to solve the problem for me. What I’ve done is follow this example where the CSV search tool is initialized with the csv path and then sent as the tool for the agent.
example:
from crewai_tools import CSVSearchTool
csv_search_tool = CSVSearchTool(csv_file_path)
then inside the agent:
@agent
def agent_name(self) -> Agent:
return Agent(
config=self.agents_config['agent_name'],
tools=[csv_search_tool]
)