TransformerOptimus / SuperAGI

<⚡️> SuperAGI - A dev-first open source autonomous AI agent framework. Enabling developers to build, manage & run useful autonomous agents quickly and reliably.
https://superagi.com/
MIT License
14.98k stars 1.79k forks source link

Cannot directly execute script #320

Open RickyEsclapon opened 1 year ago

RickyEsclapon commented 1 year ago

I'm running into issues getting SuperAGI to actually execute a Python script.

Here is an example agent with 3 goals:

  1. Write a python script to write "Hello World" to a .txt file. Save the .py file. Do not write any comments and make sure new lines and the format of the .py file are correct.

  2. Execute the .py file and don't consider the task as finished until the .txt file exists

  3. Read the contents of the .txt file and print to console

The agent has access to the CodingTool, Read File, and Write File, but it tells me the following:

Thoughts: Since I cannot directly execute the script, I will provide detailed instructions for the user.
Plan: - Provide instructions to execute the .py file
- Read the contents of the .txt file and print to console
Criticism: None
Tool: ThinkingTool

It correctly creates the hello_world.py file and when I manually execute it the result is correct, but not sure why SuperAGI is unable to execute the script itself. In some of my earlier experiments it was actually executing the python code and it was getting a "could not parse invalid json" on a more complex script (like what was reported in issue #187), but seemed to clearly run the code. Any tips around getting it to execute code directly?

I also think it would be useful to start an FAQ for things like this. If you could provide input here I'd be happy to kick-off an FAQ and add this in. Thank you for creating such an amazing tool 🔥

neelayan7 commented 1 year ago

Hey, we have not included the capability for executing a python file yet. But would love if you can maybe start a conversation and maybe even add a PR to execute it. We would love to get some help from the community!

RickyEsclapon commented 1 year ago

Sounds good, thank you! Will keep this open for now then. Thank you for the quick follow-up and all the work here 🙏

sairampillai commented 2 months ago

@neelayan7 Is this implemented? I would like to contribute if this is open. Any directions would be helpful.