mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
* 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>
OpenDevin Shared Abstraction and Components
This is a Python package that contains all the shared abstraction (e.g., Agent) and components (e.g., sandbox, web browser, search API, selenium).
Sandbox component
Run the docker-based sandbox interactive:
mkdir workspace
python3 opendevin/sandbox/sandbox.py -d workspace
It will map ./workspace into the docker container with the folder permission correctly adjusted for current user.
Example screenshot:
How to run
- Build the sandbox image local. If you want to use specific image tags, please also fix the variable in code, in code default image tag is
latest.
docker build -f opendevin/sandbox/Dockerfile -t opendevin/sandbox:v0.1 .
- Set the
OPENAI_API_KEY, please find more details here. Also, choose the model you want. Default isgpt-4-0125-preview
export OPENAI_API_KEY=xxxxxxx
- Install the requirement package.
pip install -r requirements.txt
If you still meet problem like ModuleNotFoundError: No module named 'agenthub', try to add the opendevin root path into PATH env.
- Run following cmd to start.
PYTHONPATH=`pwd` python ./opendevin/main.py -d ./workspace -t "write a bash script that prints hello world"