-
Notifications
You must be signed in to change notification settings - Fork 44.6k
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
Add command for directly executing python code #4581
Conversation
Deployment failed with the following error:
|
Deployment failed with the following error:
|
Since this is a new command that will be highly used I've opened a discussion in discord. Will update this PR with any outcome. Also welcome comments directly on the PR |
You changed AutoGPT's behaviour. The cassettes have been updated and will be merged to the submodule when this Pull Request gets merged. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4581 +/- ##
==========================================
+ Coverage 69.67% 69.79% +0.11%
==========================================
Files 72 72
Lines 3558 3575 +17
Branches 569 570 +1
==========================================
+ Hits 2479 2495 +16
- Misses 890 891 +1
Partials 189 189
☔ View full report in Codecov by Sentry. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
@erik-megarad we skipped the debug code challenge, we need to unskip it so we can tie the challenges to this command. |
You changed AutoGPT's behaviour. The cassettes have been updated and will be merged to the submodule when this Pull Request gets merged. |
Requesting review by @Pwuts since he's commented on this idea on discord and in related RFEs, and indicated being supportive of this. I really believe we should strive to get this reviewed and integrated, we have a number of requests related to creating commands (#4549) and tooling (#4214) "on the fly", being able to execute python code directly (including potentially unit tests), could be a first step towards this. This would also help implement other features, and make a few similar PRs obsolete: We would only need a way to register certain code as [new] commands. Related: |
Deployment failed with the following error:
|
Deployment failed with the following error:
|
d6bae54
to
dd466b6
Compare
You changed AutoGPT's behaviour. The cassettes have been updated and will be merged to the submodule when this Pull Request gets merged. |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
Deployment failed with the following error:
|
You changed AutoGPT's behaviour. The cassettes have been updated and will be merged to the submodule when this Pull Request gets merged. |
Deployment failed with the following error:
|
Deployment failed with the following error:
|
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
You changed AutoGPT's behaviour. The cassettes have been updated and will be merged to the submodule when this Pull Request gets merged. |
You changed AutoGPT's behaviour. The cassettes have been updated and will be merged to the submodule when this Pull Request gets merged. |
Why did you go with |
I explained it in a previous comment. Using filename caused the AI to
always give an absolute path, no matter what I did. Since we’re placing it
specifically in another location it was necessary to change the argument
name.
…On Fri, Jun 9, 2023 at 10:48 AM Reinier van der Leer < ***@***.***> wrote:
Why did you do with basename rather than filename?
—
Reply to this email directly, view it on GitHub
<#4581 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAABQXHCPMNPYMWGBBZQJN3XKNOVXANCNFSM6AAAAAAY2I2NEM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Background
When running Auto-GPT it very, very frequently wants to run python code. To do it is usually 3 steps (execute file [that probably does not exist], write file, execute file). Not only is this quite costly, but if there are errors in the code (there usually are), the iteration cycle to fix it is slow and extremely error prone.
This change adds a new command,
execute_python_code
, which will execute straight python code. It does this by writing the code to a file in the workspace directory, executing it using the existingexecute_python_file
command, and then returning the results. The file is kept around for later reference.I know that we're limiting the number of new commands we have, but this one is a 200%+ increase in efficiency for the majority of tasks that Auto-GPT decides to do.
Changes
execute_python_code
Documentation
Test Plan
PR Quality Checklist