Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] allow_code_execution=True (CodeInterpreterTool) not working as expected #92

Open
pradeepdev-1995 opened this issue Aug 14, 2024 · 0 comments

Comments

@pradeepdev-1995
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant