You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Used coding agent to execute a python program and save the results in a csv file in local path
from crewai import Agent, Task, Crew
coding_agent = Agent(
role="Python programmer",
goal="Analyze question and generate a python code and execute the same",
backstory="You are an experienced Python programmer with strong Python skills.",
allow_code_execution=True,
llm = llm,
output_file = "output/results.csv"
)
# Create a task that requires code execution
data_analysis_task = Task(
description="generate and execute a python program to read a CSV file in my local path <path name> and do these operations <operations> and save it in output path <output path>",
agent=coding_agent,
expected_output='Successfull generation and execution of a python program'
)
# Create a crew and add the task
analysis_crew = Crew(
agents=[coding_agent],
tasks=[data_analysis_task]
)
# Execute the crew
result = analysis_crew.kickoff()
print(result)
While running the crew, I could see the correct code in the terminal but once it was completed, there was no output file in the specified folder. It seems the generated code didn't properly executed in my machine.
The text was updated successfully, but these errors were encountered:
Used coding agent to execute a python program and save the results in a csv file in local path
While running the crew, I could see the correct code in the terminal but once it was completed, there was no output file in the specified folder. It seems the generated code didn't properly executed in my machine.
The text was updated successfully, but these errors were encountered: