* add generic llm client * fix lint errors * fix lint issues * a potential suggestion for llm wrapper to keep all the function sigatures for ide * use completion partial * fix resp * remove unused args * add back truncation logic * fix add_event * fix merge issues * more merge issues fixed * fix codeact agent * remove dead code * remove import * unused imports * fix ruff * update requirements * mypy fixes * more lint fixes * fix browser errors * fix up observation conversion * fix format of error * change max iter default back to 100 * fix kill action * fix docker cleanup * add RUN_AS_DEVIN flag * fix condense * revert some files * unused imports --------- Co-authored-by: Xingyao Wang <xingyao6@illinois.edu> Co-authored-by: Robert Brennan <rbren@Roberts-MacBook-Pro.local>
CodeAct-based Agent Framework
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.
A minimalistic exmaple can be found at research/codeact/examples/run_flask_server_with_bash.py:
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.
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).