-
Notifications
You must be signed in to change notification settings - Fork 5.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
Handling runtime errors in code produced by an agent #257
Comments
Could you try the default |
Though it seems the problem might be with Docker sanboxing... I have Docker desktop running and |
The default docker image doesn't allow pip install. To allow for pip install, set |
Why not set "python:3" as the default image? |
safer :) |
Thanks! It solved the issues for me! Though I spent like 20 minutes browsing docs and searching the exact place to put the value:) I've created a PR with FAQ doc updated, seems like the problem is common: #269 |
What is the right way to make agents debug and fix the code they produce?
In my code I prompt an agent to write Python script.
Actual: The user proxy fails to take care of installing Python dependencies and halts when running the code.
Expected: User proxy agent get's error description of the failing code and either take cares or running
pip install
or asks the agent to start with preparation instructions.Code
Output
smax (to CTO):https://dev.to/maximsaplin/efficient-dart-part-2-going-competitive-307c
to a .txt fileUse Python. If there're any dependencies required please specifically tell me how to get them installed.
CTO (to smax):
Here is a Python script that does what you asked for. This script uses the
requests
,BeautifulSoup
,collections
andmatplotlib
libraries. If you don't have these libraries installed, you can install them using pip:Here is the Python script:
This script first saves the article content to a file named
article.txt
. Then it reads this file, counts the occurrences of each word and saves this information to a file namedhistogram.txt
. The words in the histogram are sorted by their frequency.Please note that this script does not remove stop words (common words like 'the', 'is', 'in', etc.) from the text before counting the words. If you want a more accurate histogram, you might want to remove these words before counting.
https://dev.to/maximsaplin/efficient-dart-part-2-going-competitive-307c
to a .txt fileUse Python. If there're any dependencies required please specifically tell me how to get them installed.
CTO (to smax):
Here is a Python script that does what you asked for. This script uses the
requests
,BeautifulSoup
,collections
andmatplotlib
libraries. If you don't have these libraries installed, you can install them using pip:Here is the Python script:
This script first saves the article content to a file named
article.txt
. Then it reads this file, counts the occurrences of each word and saves this information to a file namedhistogram.txt
. The words in the histogram are sorted by their frequency.Please note that this script does not remove stop words (common words like 'the', 'is', 'in', etc.) from the text before counting the words. If you want a more accurate histogram, you might want to remove these words before counting.
The text was updated successfully, but these errors were encountered: