Commit Graph

36 Commits

Author SHA1 Message Date
iFurySt
8b9fc3df28 feat: add workflow to ghcr (#237)
Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
2024-03-27 23:10:34 +08:00
iFurySt
1c5c84faea fix: delete the docker exec output prefix(8 bytes). (#247) 2024-03-27 11:05:07 -04:00
Robert Brennan
413f5b1c0b standardize on LLM_MODEL (#244) 2024-03-27 09:41:13 -04:00
Robert Brennan
ea10809a96 fix file write observations (#225)
* fix file write observations

* empty content for file write
2024-03-27 13:07:14 +08:00
Robert Brennan
93656f3bb3 add error handling for action running (#212) 2024-03-26 16:42:27 -04:00
Yufan Song
9ab15b3287 add mock server (#214) 2024-03-26 16:15:20 -04:00
iFurySt
02a0367757 feat: add message related schema to FE and BE. (#195) 2024-03-26 12:06:30 -04:00
Robert Brennan
a6aa2d88cc Fix messages in chat window (#185)
* fix messages from server

* fix observations

* fix file path arg

* revert session
2024-03-26 23:47:53 +08:00
Robert Brennan
134cc2bc84 fix summaries (#191) 2024-03-26 23:44:54 +08:00
Robert Brennan
9e924ab4b1 add error observations (#196) 2024-03-26 23:43:59 +08:00
Robert Brennan
983092c182 use utf8 encoding for file operations (#180) 2024-03-26 08:44:16 -04:00
Robert Brennan
0758db202c fix bad observation check (#184)
* fix bad observation check

* fix add_history call
2024-03-26 08:35:06 -04:00
Robert Brennan
397f3fbc78 Add rewrite logic to help with docker-in-docker scenarios (#146)
* add rewrite logic

* Update opendevin/sandbox/sandbox.py

* Update sandbox.py
2024-03-26 07:38:57 -04:00
Robert Brennan
486ec2d94a Minor fixes for new Agent framework (#158)
* add message if exit happens before finish

* fix kill command

* fix browse action

* fix sandbox

* update requirements

* add status code

* refactor controller

* add try to callbacks

* fix background log collection

* format logs a bit more nicely

* run background procs in same container

* fix close command

* rename sockt

* fix up kills

* fix lint issues

* fix ruff

---------

Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
2024-03-26 12:55:33 +08:00
Jim Su
430527680f Server: load environment variables from .env and document environment variables (#137)
Server: load environment variables from .env and document environment variables
2024-03-26 00:14:48 -04:00
Robert Brennan
eb4a261880 Create generic LLM client using LiteLLM (#114)
* 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>
2024-03-26 12:10:23 +08:00
Robert Brennan
815b78595a Fix sandbox user ID on windows (#170)
* set user id

* fix lint
2024-03-25 22:56:48 -04:00
Hesham
847c2148a6 update messages (#156)
* update messages

* Update opendevin/action/agent.py

Co-authored-by: Robert Brennan <accounts@rbren.io>

* Update opendevin/action/agent.py

Co-authored-by: Robert Brennan <accounts@rbren.io>

---------

Co-authored-by: Hesham Haroon <heshamharoon@Heshams-MacBook-Pro.local>
Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-03-25 19:15:23 -04:00
Robert Brennan
ad83a4d869 fix tag on sandbox (#164) 2024-03-25 18:24:30 -04:00
Xingyao Wang
82f934d4cd New Agent, Action, Observation Abstraction with updated Controller (#105)
* rearrange workspace_dir and max_step as arguments to controller

* remove unused output

* abstract each action into dataclass

* move actions

* fix action import

* move cmd manager and change method to private

* move controller

* rename action folder

* add state

* a draft of Controller & new agent abstraction

* add agent actions

* remove controller file

* add observation to perform a refractor on langchains agent

* revert to make this compatible via translation

* fix typo and translate error

* add error to observation

* index thought as dict

* refractor controller

* fix circular dependency caused by type hint

* add runnable attribute to agent

* add mixin to denote executable

* change baseclass

* make file read/write action compatible w/ docker directory

* remove event

* fix some merge issue

* fix sandbox w/ permission issue

* cleanup history abstraction since langchains agent is not really using it

* tweak to make langchains agent working

* make all actions return observation

* fix missing import

* add echo action for agent

* add error code to cmd output obs

* make cmd manager returns cmd output obs

* fix codeact agent to make it work

* fix all ruff issue

* fix mypy

* add import agenthub back

* add message for Action attribute (migrate from previous event)

* fix typo

* fix instruction setting

* fix instruction setting

* attempt to fix session

* ruff fix

* add .to_dict method for base and observation

* add message for recall

* try to simplify the state_updated_info with tuple of action and obs

* update_info to Tuple[Action, Observation]

* make codeact agent and langchains compatible with Tuple[Action, Observation]

* fix ruff

* fix ruff

* change to base path to fix minimal langchains agent

* add NullAction to potentially handle for chat scenario

* Update opendevin/controller/command_manager.py

Co-authored-by: Robert Brennan <accounts@rbren.io>

* fix event args

* set the default workspace to "workspace"

* make directory relative (so it does not show up to agent in File*Action)

* fix typo

* await to yield for sending observation

* fix message format

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-03-26 01:56:58 +08:00
Robert Brennan
8a64d7c912 Fix read and write operations when LLM asks for absolute path (#126)
* fix resolution of filepaths

* fix imports

* Update write.py
2024-03-25 08:53:26 -04:00
Robert Brennan
d9c1bee2aa Add instructions to README.md (#129)
* Update README.md

* add WORKSPACE_DIR env var

* Update README.md

* Update session.py

---------

Co-authored-by: Robert Brennan <rbren@Roberts-MacBook-Pro.local>
2024-03-25 11:35:12 +08:00
Jim Su
335a91610e Wire up frontend (#128) 2024-03-25 10:07:38 +08:00
Robert Brennan
0f4a11685e Add agenthub import to listen.py (#127) 2024-03-24 19:20:42 -04:00
Robert Brennan
8ce2ac7648 Fix agenthub import (#123)
* fix agenthub import

* add noqa
2024-03-24 18:29:09 -04:00
Sean Lim
dfa98b334e fix typo (#122) 2024-03-24 17:15:29 -04:00
Robert Brennan
4aa24eb41d Server working with agent library (#97)
* server working with agent library

* update readme

* add messages to events

* factor out steps

* fix websocket messages

* allow user to run arbitrary actions

* allow user to run commands before a task is started

* fix main.py

* check JSON

* handle errors in controller better

* fix memory issue

* better error handling and task cancellation

* fix monologue len

* fix imports

* remove server from lint check

* fix lint issues

* fix lint errors
2024-03-24 22:24:44 +08:00
geohotstan
fb1822123a Adding pre-commit and CI for ruff and mypy (#69)
* don't modify directories

* oops typo

* dev_config/python

* add config to CI

* bump CI python to 3.10

* 3.11?

* del actions/

* add suggestions

* delete unused code

* missed some

* oops missed another one

* remove a file
2024-03-23 19:41:49 -04:00
Yufan Song
642e1b3cd0 doc(sandbox): add more instructions for starting on sandbox work (#107)
* add doc

* fix

* remove requirement

* Update opendevin/README.md

Co-authored-by: Robert Brennan <accounts@rbren.io>

---------

Co-authored-by: Robert Brennan <accounts@rbren.io>
2024-03-23 17:44:48 -04:00
Yufan Song
fabdddca21 fix(evaluation): solve graceful shutdown of docker containers (#106)
* add atexit

* remove print

* fix typo
2024-03-23 17:37:20 -04:00
Robert Brennan
78f8752246 minor fixes for langchain agent (#83)
* minor fixes

* set max output len

* truncate logs

* Update agenthub/langchains_agent/utils/agent.py
2024-03-23 17:34:35 -04:00
Xingyao Wang
2ba6fb1e7b Use main.py arguments to specify model_name instead of env var for Langchains Agent (#94)
* use model name from main.py arguments instead of env var

* set default model to gpt-4-0125-preview for langchains agent to work;
print model, dir, and task when started
2024-03-22 22:06:42 +08:00
Robert Brennan
3b2ed14ae7 Use Docker SDK for sandbox, integrate into CommandManager (#93)
* refactor command manager to use docker and move to docker sdk

* fix read and write actions

* actually run background cmd

* use bash for running cmds and fix logs

* keep logs in buffer file

* fix up background logs

* consolidate requirements

* fix docker imports

* add fixme

* add remove fixme

* fix sandbox.py path in README

* fix typo annotation and prompt

---------

Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
2024-03-22 21:54:00 +08:00
Robert Brennan
b84463f512 Refactor agent interface a bit (#74)
* start moving files

* initial refactor

* factor out command management

* fix command runner

* add workspace to gitignore

* factor out command manager

* remove dupe add_event

* update docs

* fix init

* fix langchain agent after merge
2024-03-21 23:35:28 +08:00
Xingyao Wang
2de75d4782 Minimal Docker Sandbox with GPT-3.5 Execution Example (#48)
* minimal docker sandbox

* make container_image as an argument (fall back to ubuntu);
increase timeout to avoid return too early for long running commands;

* add a minimal working (imperfect) example

* fix typo

* change default container name

* attempt to fix "Bad file descriptor" error

* handle ctrl+D

* add Python gitignore

* push sandbox to shared dockerhub for ease of use

* move codeact example into research folder

* add README for opendevin

* change container image name to opendevin dockerhub

* move folder; change example to a more general agent

* update Message and Role

* update docker sandbox to support mounting folder and switch to user with correct permission

* make network as host

* handle erorrs when attrs are not set yet

* convert codeact agent into a compatible agent

* add workspace to gitignore

* make sure the agent interface adjustment works for langchain_agent
2024-03-21 21:54:56 +08:00
Xingyao Wang
0380070e98 Abstraction that allows us to develop different agents, frontend, backend, and evaluation in parallel (#68)
* move agent to langchains_agent

* remove old .env

* remove the old agent folder

* add preliminary version of Agent abstraction

* add preliminary version of the main.py

* merge controlloop and main into a Agent class

* add init

* fix json import

* fix missing arg

* get langchains_agent working after abstraction

* rename `research` to `agenthub`

* rename: rename research to agenthub

---------

Co-authored-by: huybery <huybery@gmail.com>
2024-03-20 15:09:29 -04:00