This folder implements the CodeAct idea that relies on LLM to autonomously perform actions in a Bash shell. It requires more from the LLM itself: LLM needs to be capable enough to do all the stuff autonomously, instead of stuck in an infinite loop.
NOTE: This agent is still highly experimental and under active development to reach the capability described in the original paper & repo.
codeact-demo.mp4
mkdir workspace
PYTHONPATH=`pwd`:$PYTHONPATH python3 opendevin/main.py -d ./workspace -c CodeActAgent -t "Please write a flask app that returns 'Hello, World\!' at the root URL, then start the app on port 5000. python3 has already been installed for you."
Example: prompts gpt-4-0125-preview
to write a flask server, install flask
library, and start the server.
![image](https://private-user-images.githubusercontent.com/38853559/313768228-325c3115-a343-4cc5-a92b-f1e5d552a077.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMzEzNzMsIm5iZiI6MTczOTMzMTA3MywicGF0aCI6Ii8zODg1MzU1OS8zMTM3NjgyMjgtMzI1YzMxMTUtYTM0My00Y2M1LWE5MmItZjFlNWQ1NTJhMDc3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDAzMzExM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNmZTcxM2U5YmU5ZWE0N2ZhNDQ5OTkzNmU0ZGQ4NjNkMTRhYmM0MDY2ZTBlZmIyZWJiNTg5ZjgxNDk5ZWJjYTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.6EyY-0VFyT8hXrV1QgEHvM9QIHhcoxAyKZ7bV3KJL9U)
![image](https://private-user-images.githubusercontent.com/38853559/313767846-68ad10c1-744a-4e9d-bb29-0f163d665a0a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMzEzNzMsIm5iZiI6MTczOTMzMTA3MywicGF0aCI6Ii8zODg1MzU1OS8zMTM3Njc4NDYtNjhhZDEwYzEtNzQ0YS00ZTlkLWJiMjktMGYxNjNkNjY1YTBhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDAzMzExM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU1MmQ1MTNjZjQ5OTM0NDJlNTdlYmY2ZGFjZGYxZjI5N2ExNmVlZDdlNjcwZTdhZDkzYmRkYjBiMjU5ODZlMDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.tJG4_RMP2fQrilkH19Uvfa2NSFjubosJWj1VwrTWRiY)
Most of the things are working as expected, except at the end, the model did not follow the instruction to stop the interaction by outputting <execute> exit </execute>
as instructed.
TODO: This should be fixable by either (1) including a complete in-context example like this, OR (2) collect some interaction data like this and fine-tune a model (like this, a more complex route).