From 6dff4e38b74d87b9b7b66b31c29c7dada4a7562a Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Tue, 23 Apr 2024 10:08:21 -0400 Subject: [PATCH 01/12] first pass at dummy --- agenthub/__init__.py | 5 +++- agenthub/dummy_agent/__init__.py | 4 +++ agenthub/dummy_agent/agent.py | 47 ++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 agenthub/dummy_agent/__init__.py create mode 100644 agenthub/dummy_agent/agent.py diff --git a/agenthub/__init__.py b/agenthub/__init__.py index c39cfa3b6ff..f7fb25ba1c6 100644 --- a/agenthub/__init__.py +++ b/agenthub/__init__.py @@ -12,9 +12,12 @@ from . import planner_agent # noqa: E402 from . import SWE_agent # noqa: E402 from . import delegator_agent # noqa: E402 +from . import dummy_agent # noqa: E402 __all__ = ['monologue_agent', 'codeact_agent', - 'planner_agent', 'SWE_agent', 'delegator_agent'] + 'planner_agent', 'SWE_agent', + 'delegator_agent', + 'dummy_agent'] for agent in all_microagents.values(): name = agent['name'] diff --git a/agenthub/dummy_agent/__init__.py b/agenthub/dummy_agent/__init__.py new file mode 100644 index 00000000000..46f83207fc6 --- /dev/null +++ b/agenthub/dummy_agent/__init__.py @@ -0,0 +1,4 @@ +from opendevin.agent import Agent +from .agent import DummyAgent + +Agent.register('DummyAgent', DummyAgent) diff --git a/agenthub/dummy_agent/agent.py b/agenthub/dummy_agent/agent.py new file mode 100644 index 00000000000..ae479150821 --- /dev/null +++ b/agenthub/dummy_agent/agent.py @@ -0,0 +1,47 @@ +from typing import List + +from opendevin.agent import Agent +from opendevin.llm.llm import LLM +from opendevin.state import State +from opendevin.action import ( + Action, + CmdRunAction, + FileWriteAction, + FileReadAction, + AgentFinishAction, + AgentThinkAction, + AddTaskAction, + ModifyTaskAction, + AgentRecallAction, + BrowseURLAction, +) + + +class DummyAgent(Agent): + ''' + The DummyAgent is used for e2e testing. It just sends the same set of actions deterministically, + without making any LLM calls. + ''' + + def __init__(self, llm: LLM): + super().__init__(llm) + self.steps = [ + AddTaskAction(parent='0', goal='check the current directory'), + AddTaskAction(parent='0.0', goal='run ls'), + ModifyTaskAction(id='0.0', state='in_progress'), + AgentThinkAction(thought='Time to get started!'), + CmdRunAction(command='ls'), + FileWriteAction(content='echo "Hello, World!"', path='hello.sh'), + FileReadAction(path='hello.sh'), + CmdRunAction(command='bash hello.sh'), + CmdRunAction(command='echo "This is in the background"', background=True), + AgentRecallAction(query='who am I?'), + BrowseURLAction(url='https://google.com'), + AgentFinishAction(), + ] + + def step(self, state: State) -> Action: + return self.steps[state.iteration] + + def search_memory(self, query: str) -> List[str]: + return ['I am a computer.'] From 57b45edd9e43c02e78e8ddeae78d3a4f4472eed9 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Tue, 23 Apr 2024 10:24:22 -0400 Subject: [PATCH 02/12] add assertion to dummy --- agenthub/dummy_agent/agent.py | 70 +++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 16 deletions(-) diff --git a/agenthub/dummy_agent/agent.py b/agenthub/dummy_agent/agent.py index ae479150821..0010fe27d6f 100644 --- a/agenthub/dummy_agent/agent.py +++ b/agenthub/dummy_agent/agent.py @@ -1,4 +1,4 @@ -from typing import List +from typing import List, TypedDict from opendevin.agent import Agent from opendevin.llm.llm import LLM @@ -15,6 +15,12 @@ AgentRecallAction, BrowseURLAction, ) +from opendevin.observation import ( + Observation, + NullObservation, +) + +ActionObs = TypedDict('ActionObs', {'action': Action, 'observations': List[Observation]}) class DummyAgent(Agent): @@ -25,23 +31,55 @@ class DummyAgent(Agent): def __init__(self, llm: LLM): super().__init__(llm) - self.steps = [ - AddTaskAction(parent='0', goal='check the current directory'), - AddTaskAction(parent='0.0', goal='run ls'), - ModifyTaskAction(id='0.0', state='in_progress'), - AgentThinkAction(thought='Time to get started!'), - CmdRunAction(command='ls'), - FileWriteAction(content='echo "Hello, World!"', path='hello.sh'), - FileReadAction(path='hello.sh'), - CmdRunAction(command='bash hello.sh'), - CmdRunAction(command='echo "This is in the background"', background=True), - AgentRecallAction(query='who am I?'), - BrowseURLAction(url='https://google.com'), - AgentFinishAction(), - ] + self.steps: List[ActionObs] = [{ + 'action': AddTaskAction(parent='0', goal='check the current directory'), + 'observations': [NullObservation('')], + }, { + 'action': AddTaskAction(parent='0.0', goal='run ls'), + 'observations': [], + }, { + 'action': ModifyTaskAction(id='0.0', state='in_progress'), + 'observations': [], + }, { + 'action': AgentThinkAction(thought='Time to get started!'), + 'observations': [], + }, { + 'action': CmdRunAction(command='ls'), + 'observations': [], + }, { + 'action': FileWriteAction(content='echo "Hello, World!"', path='hello.sh'), + 'observations': [], + }, { + 'action': FileReadAction(path='hello.sh'), + 'observations': [], + }, { + 'action': CmdRunAction(command='bash hello.sh'), + 'observations': [], + }, { + 'action': CmdRunAction(command='echo "This is in the background"', background=True), + 'observations': [], + }, { + 'action': AgentRecallAction(query='who am I?'), + 'observations': [], + }, { + 'action': BrowseURLAction(url='https://google.com'), + 'observations': [], + }, { + 'action': AgentFinishAction(), + 'observations': [], + }] def step(self, state: State) -> Action: - return self.steps[state.iteration] + if state.iteration > 0: + prev_step = self.steps[state.iteration - 1] + if 'observations' in prev_step: + expected_observations = prev_step['observations'] + hist_start = len(state.history) - len(expected_observations) + for i in range(len(expected_observations)): + hist_obs = state.history[hist_start + i][1] + expected_obs = expected_observations[i] + assert hist_obs == expected_obs, f'Expected observation {expected_obs}, got {hist_obs}' + return self.steps[state.iteration]['action'] def search_memory(self, query: str) -> List[str]: return ['I am a computer.'] From ff449dc98555425e54021a530a618c758077f3ba Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Tue, 23 Apr 2024 15:02:59 -0400 Subject: [PATCH 03/12] add dummy workflow --- .github/workflows/dummy-e2e.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/dummy-e2e.yml diff --git a/.github/workflows/dummy-e2e.yml b/.github/workflows/dummy-e2e.yml new file mode 100644 index 00000000000..22708a1bbc5 --- /dev/null +++ b/.github/workflows/dummy-e2e.yml @@ -0,0 +1,20 @@ +name: Run e2e test with dummy agent + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + - name: Set up environment + run: | + curl -sSL https://install.python-poetry.org | python3 - + poetry install --without evaluation + - name: Run tests + run: | + poetry run python opendevin/main.py -t "do a flip" -m ollama/not-a-model -d ./workspace/ -c DummyAgent From cb7d7c59e53c4b76b3b382c3b1aaad66d26050d8 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Tue, 23 Apr 2024 16:11:11 -0400 Subject: [PATCH 04/12] beef up tests --- agenthub/dummy_agent/agent.py | 61 +++++++++++++++++++++++++++-------- opendevin/action/agent.py | 2 +- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/agenthub/dummy_agent/agent.py b/agenthub/dummy_agent/agent.py index 0010fe27d6f..4693fa47147 100644 --- a/agenthub/dummy_agent/agent.py +++ b/agenthub/dummy_agent/agent.py @@ -1,3 +1,4 @@ +import time from typing import List, TypedDict from opendevin.agent import Agent @@ -18,10 +19,24 @@ from opendevin.observation import ( Observation, NullObservation, + CmdOutputObservation, + FileWriteObservation, + FileReadObservation, + AgentRecallObservation, ) +""" +FIXME: There are a few problems this surfaced +* FileWrites seem to add an unintended newline at the end of the file +* command_id is sometimes a number, sometimes a string +* Why isn't the output of the background command split between two steps? +* Browser not working +""" + ActionObs = TypedDict('ActionObs', {'action': Action, 'observations': List[Observation]}) +BACKGROUND_CMD = 'echo "This is in the background" && sleep .1 && echo "This too"' + class DummyAgent(Agent): ''' @@ -36,48 +51,66 @@ def __init__(self, llm: LLM): 'observations': [NullObservation('')], }, { 'action': AddTaskAction(parent='0.0', goal='run ls'), - 'observations': [], + 'observations': [NullObservation('')], }, { 'action': ModifyTaskAction(id='0.0', state='in_progress'), - 'observations': [], + 'observations': [NullObservation('')], }, { 'action': AgentThinkAction(thought='Time to get started!'), - 'observations': [], + 'observations': [NullObservation('')], }, { - 'action': CmdRunAction(command='ls'), - 'observations': [], + 'action': CmdRunAction(command='echo "foo"'), + 'observations': [CmdOutputObservation('foo\n', command_id=-1, command='echo "foo"')], }, { 'action': FileWriteAction(content='echo "Hello, World!"', path='hello.sh'), - 'observations': [], + 'observations': [FileWriteObservation('', path='hello.sh')], }, { 'action': FileReadAction(path='hello.sh'), - 'observations': [], + 'observations': [FileReadObservation('echo "Hello, World!"\n', path='hello.sh')], }, { 'action': CmdRunAction(command='bash hello.sh'), - 'observations': [], + 'observations': [CmdOutputObservation('Hello, World!\n', command_id=-1, command='bash hello.sh')], }, { - 'action': CmdRunAction(command='echo "This is in the background"', background=True), - 'observations': [], + 'action': CmdRunAction(command=BACKGROUND_CMD, background=True), + 'observations': [ + CmdOutputObservation('Background command started. To stop it, send a `kill` action with id 42', command_id='42', command=BACKGROUND_CMD), # type: ignore[arg-type] + CmdOutputObservation('This is in the background\nThis too\n', command_id='42', command=BACKGROUND_CMD), # type: ignore[arg-type] + ] }, { 'action': AgentRecallAction(query='who am I?'), - 'observations': [], + 'observations': [ + AgentRecallObservation('', memories=['I am a computer.']), + # CmdOutputObservation('This too\n', command_id='42', command=BACKGROUND_CMD), + ], }, { 'action': BrowseURLAction(url='https://google.com'), - 'observations': [], + 'observations': [ + # BrowserOutputObservation('', url='https://google.com', screenshot=""), + ], }, { 'action': AgentFinishAction(), 'observations': [], }] def step(self, state: State) -> Action: + time.sleep(0.1) if state.iteration > 0: prev_step = self.steps[state.iteration - 1] if 'observations' in prev_step: expected_observations = prev_step['observations'] hist_start = len(state.history) - len(expected_observations) for i in range(len(expected_observations)): - hist_obs = state.history[hist_start + i][1] - expected_obs = expected_observations[i] + hist_obs = state.history[hist_start + i][1].to_dict() + expected_obs = expected_observations[i].to_dict() + if 'command_id' in hist_obs['extras'] and hist_obs['extras']['command_id'] != -1: + del hist_obs['extras']['command_id'] + hist_obs['content'] = '' + if 'command_id' in expected_obs['extras'] and expected_obs['extras']['command_id'] != -1: + del expected_obs['extras']['command_id'] + expected_obs['content'] = '' + if hist_obs != expected_obs: + print('\nactual', hist_obs) + print('\nexpect', expected_obs) assert hist_obs == expected_obs, f'Expected observation {expected_obs}, got {hist_obs}' return self.steps[state.iteration]['action'] diff --git a/opendevin/action/agent.py b/opendevin/action/agent.py index 1cb0b8cdf2a..5331a4a5fb1 100644 --- a/opendevin/action/agent.py +++ b/opendevin/action/agent.py @@ -21,7 +21,7 @@ class AgentRecallAction(ExecutableAction): async def run(self, controller: 'AgentController') -> AgentRecallObservation: return AgentRecallObservation( - content='Recalling memories...', + content='', memories=controller.agent.search_memory(self.query), ) From 048e625dc1e6097cf0dc8c07739d527d59cdb8bb Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Tue, 23 Apr 2024 16:31:49 -0400 Subject: [PATCH 05/12] try and fix huggingface issue --- .github/workflows/dummy-e2e.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dummy-e2e.yml b/.github/workflows/dummy-e2e.yml index 22708a1bbc5..2de266efe29 100644 --- a/.github/workflows/dummy-e2e.yml +++ b/.github/workflows/dummy-e2e.yml @@ -15,6 +15,7 @@ jobs: run: | curl -sSL https://install.python-poetry.org | python3 - poetry install --without evaluation + wget https://huggingface.co/BAAI/bge-small-en-v1.5/raw/main/1_Pooling/config.json -P /tmp/llama_index/models--BAAI--bge-small-en-v1.5/snapshots/5c38ec7c405ec4b44b94cc5a9bb96e735b38267a/1_Pooling/ - name: Run tests run: | poetry run python opendevin/main.py -t "do a flip" -m ollama/not-a-model -d ./workspace/ -c DummyAgent From 889bbd6399a71e159a994611c5550b9335a27110 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Thu, 25 Apr 2024 11:15:24 -0400 Subject: [PATCH 06/12] remove newlines --- agenthub/dummy_agent/agent.py | 4 ++-- opendevin/sandbox/docker/exec_box.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/agenthub/dummy_agent/agent.py b/agenthub/dummy_agent/agent.py index 4693fa47147..1f5a3bda494 100644 --- a/agenthub/dummy_agent/agent.py +++ b/agenthub/dummy_agent/agent.py @@ -60,7 +60,7 @@ def __init__(self, llm: LLM): 'observations': [NullObservation('')], }, { 'action': CmdRunAction(command='echo "foo"'), - 'observations': [CmdOutputObservation('foo\n', command_id=-1, command='echo "foo"')], + 'observations': [CmdOutputObservation('foo', command_id=-1, command='echo "foo"')], }, { 'action': FileWriteAction(content='echo "Hello, World!"', path='hello.sh'), 'observations': [FileWriteObservation('', path='hello.sh')], @@ -69,7 +69,7 @@ def __init__(self, llm: LLM): 'observations': [FileReadObservation('echo "Hello, World!"\n', path='hello.sh')], }, { 'action': CmdRunAction(command='bash hello.sh'), - 'observations': [CmdOutputObservation('Hello, World!\n', command_id=-1, command='bash hello.sh')], + 'observations': [CmdOutputObservation('Hello, World!', command_id=-1, command='bash hello.sh')], }, { 'action': CmdRunAction(command=BACKGROUND_CMD, background=True), 'observations': [ diff --git a/opendevin/sandbox/docker/exec_box.py b/opendevin/sandbox/docker/exec_box.py index 89f634ef6cb..999b654b50c 100644 --- a/opendevin/sandbox/docker/exec_box.py +++ b/opendevin/sandbox/docker/exec_box.py @@ -122,7 +122,10 @@ def run_command(container, command): self.container.exec_run( f'kill -9 {pid}', workdir=SANDBOX_WORKSPACE_DIR) return -1, f'Command: "{cmd}" timed out' - return exit_code, logs.decode('utf-8').strip() + logs_out = logs.decode('utf-8') + if logs_out.endswith('\n'): + logs_out = logs_out[:-1] + return exit_code, logs_out def copy_to(self, host_src: str, sandbox_dest: str, recursive: bool = False): # mkdir -p sandbox_dest if it doesn't exist From 0e2979130e98c50a41c5c480725bc106f3652a1a Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Thu, 25 Apr 2024 11:40:47 -0400 Subject: [PATCH 07/12] rename test --- .github/workflows/{dummy-e2e.yml => dummy-agent-test.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{dummy-e2e.yml => dummy-agent-test.yml} (100%) diff --git a/.github/workflows/dummy-e2e.yml b/.github/workflows/dummy-agent-test.yml similarity index 100% rename from .github/workflows/dummy-e2e.yml rename to .github/workflows/dummy-agent-test.yml From de8121c400028399451de94ebd2681eedc6dee5b Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Fri, 26 Apr 2024 17:38:52 -0400 Subject: [PATCH 08/12] move to pytest --- .github/workflows/dummy-agent-test.yml | 21 --------------------- tests/integration/test_actions.py | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 21 deletions(-) delete mode 100644 .github/workflows/dummy-agent-test.yml create mode 100644 tests/integration/test_actions.py diff --git a/.github/workflows/dummy-agent-test.yml b/.github/workflows/dummy-agent-test.yml deleted file mode 100644 index 2de266efe29..00000000000 --- a/.github/workflows/dummy-agent-test.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Run e2e test with dummy agent - -on: [push] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' - - name: Set up environment - run: | - curl -sSL https://install.python-poetry.org | python3 - - poetry install --without evaluation - wget https://huggingface.co/BAAI/bge-small-en-v1.5/raw/main/1_Pooling/config.json -P /tmp/llama_index/models--BAAI--bge-small-en-v1.5/snapshots/5c38ec7c405ec4b44b94cc5a9bb96e735b38267a/1_Pooling/ - - name: Run tests - run: | - poetry run python opendevin/main.py -t "do a flip" -m ollama/not-a-model -d ./workspace/ -c DummyAgent diff --git a/tests/integration/test_actions.py b/tests/integration/test_actions.py new file mode 100644 index 00000000000..25328a7aafe --- /dev/null +++ b/tests/integration/test_actions.py @@ -0,0 +1,15 @@ +import asyncio + +from agenthub.dummy_agent import DummyAgent + +from opendevin.controller import AgentController +from opendevin.llm.llm import LLM + + +def test_actions_with_dummy_agent(): + llm = LLM('not-a-real-model') + agent = DummyAgent(llm=llm) + controller = AgentController(agent=agent) + + asyncio.run(controller.start('do a flip')) + # assertions are inside the DummyAgent From 85cd78de7e4200a646824eb3fdbcb35d63a9fc86 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Sat, 27 Apr 2024 08:06:15 -0400 Subject: [PATCH 09/12] Revert " move to pytest" This reverts commit de8121c400028399451de94ebd2681eedc6dee5b. --- .github/workflows/dummy-agent-test.yml | 21 +++++++++++++++++++++ tests/integration/test_actions.py | 15 --------------- 2 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/dummy-agent-test.yml delete mode 100644 tests/integration/test_actions.py diff --git a/.github/workflows/dummy-agent-test.yml b/.github/workflows/dummy-agent-test.yml new file mode 100644 index 00000000000..2de266efe29 --- /dev/null +++ b/.github/workflows/dummy-agent-test.yml @@ -0,0 +1,21 @@ +name: Run e2e test with dummy agent + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' + - name: Set up environment + run: | + curl -sSL https://install.python-poetry.org | python3 - + poetry install --without evaluation + wget https://huggingface.co/BAAI/bge-small-en-v1.5/raw/main/1_Pooling/config.json -P /tmp/llama_index/models--BAAI--bge-small-en-v1.5/snapshots/5c38ec7c405ec4b44b94cc5a9bb96e735b38267a/1_Pooling/ + - name: Run tests + run: | + poetry run python opendevin/main.py -t "do a flip" -m ollama/not-a-model -d ./workspace/ -c DummyAgent diff --git a/tests/integration/test_actions.py b/tests/integration/test_actions.py deleted file mode 100644 index 25328a7aafe..00000000000 --- a/tests/integration/test_actions.py +++ /dev/null @@ -1,15 +0,0 @@ -import asyncio - -from agenthub.dummy_agent import DummyAgent - -from opendevin.controller import AgentController -from opendevin.llm.llm import LLM - - -def test_actions_with_dummy_agent(): - llm = LLM('not-a-real-model') - agent = DummyAgent(llm=llm) - controller = AgentController(agent=agent) - - asyncio.run(controller.start('do a flip')) - # assertions are inside the DummyAgent From dc877947ba43b8ba5bba7ca9492ae01f545e7edf Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Sat, 27 Apr 2024 08:28:04 -0400 Subject: [PATCH 10/12] fix lint --- agenthub/dummy_agent/agent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agenthub/dummy_agent/agent.py b/agenthub/dummy_agent/agent.py index 1f5a3bda494..6708e539b5f 100644 --- a/agenthub/dummy_agent/agent.py +++ b/agenthub/dummy_agent/agent.py @@ -39,10 +39,10 @@ class DummyAgent(Agent): - ''' + """ The DummyAgent is used for e2e testing. It just sends the same set of actions deterministically, without making any LLM calls. - ''' + """ def __init__(self, llm: LLM): super().__init__(llm) From 6c5cd740b616426090a7ca97534e78c14c55cd15 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Mon, 29 Apr 2024 20:42:27 -0400 Subject: [PATCH 11/12] delint --- agenthub/__init__.py | 4 +-- agenthub/dummy_agent/__init__.py | 1 + agenthub/dummy_agent/agent.py | 26 +++++++++---------- .../python/agenthub/dummy_agent/agent.md | 5 ++-- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/agenthub/__init__.py b/agenthub/__init__.py index 705fffcc7a9..8c7c4027e0e 100644 --- a/agenthub/__init__.py +++ b/agenthub/__init__.py @@ -13,13 +13,11 @@ SWE_agent, codeact_agent, delegator_agent, + dummy_agent, monologue_agent, planner_agent, - delegator_agent, - dummy_agent, ) - __all__ = ['monologue_agent', 'codeact_agent', 'planner_agent', 'SWE_agent', 'delegator_agent', diff --git a/agenthub/dummy_agent/__init__.py b/agenthub/dummy_agent/__init__.py index 46f83207fc6..1c8698ccd19 100644 --- a/agenthub/dummy_agent/__init__.py +++ b/agenthub/dummy_agent/__init__.py @@ -1,4 +1,5 @@ from opendevin.agent import Agent + from .agent import DummyAgent Agent.register('DummyAgent', DummyAgent) diff --git a/agenthub/dummy_agent/agent.py b/agenthub/dummy_agent/agent.py index 6708e539b5f..64fe3bfe91b 100644 --- a/agenthub/dummy_agent/agent.py +++ b/agenthub/dummy_agent/agent.py @@ -1,29 +1,29 @@ import time from typing import List, TypedDict -from opendevin.agent import Agent -from opendevin.llm.llm import LLM -from opendevin.state import State from opendevin.action import ( Action, - CmdRunAction, - FileWriteAction, - FileReadAction, - AgentFinishAction, - AgentThinkAction, AddTaskAction, - ModifyTaskAction, + AgentFinishAction, AgentRecallAction, + AgentThinkAction, BrowseURLAction, + CmdRunAction, + FileReadAction, + FileWriteAction, + ModifyTaskAction, ) +from opendevin.agent import Agent +from opendevin.llm.llm import LLM from opendevin.observation import ( - Observation, - NullObservation, + AgentRecallObservation, CmdOutputObservation, - FileWriteObservation, FileReadObservation, - AgentRecallObservation, + FileWriteObservation, + NullObservation, + Observation, ) +from opendevin.state import State """ FIXME: There are a few problems this surfaced diff --git a/docs/modules/python/agenthub/dummy_agent/agent.md b/docs/modules/python/agenthub/dummy_agent/agent.md index c783e7061fa..e2738fb8b67 100644 --- a/docs/modules/python/agenthub/dummy_agent/agent.md +++ b/docs/modules/python/agenthub/dummy_agent/agent.md @@ -3,13 +3,12 @@ sidebar_label: agent title: agenthub.dummy_agent.agent --- -Module for a Dummy agent. - ## DummyAgent Objects ```python class DummyAgent(Agent) ``` -A dummy agent that does nothing but can be used in testing. +The DummyAgent is used for e2e testing. It just sends the same set of actions deterministically, +without making any LLM calls. From acd236f876f6bd070e14c5b4f3943488729b7e08 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Tue, 30 Apr 2024 12:40:16 -0400 Subject: [PATCH 12/12] Update .github/workflows/dummy-agent-test.yml Co-authored-by: Boxuan Li --- .github/workflows/dummy-agent-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dummy-agent-test.yml b/.github/workflows/dummy-agent-test.yml index 2de266efe29..0a853a7b4b3 100644 --- a/.github/workflows/dummy-agent-test.yml +++ b/.github/workflows/dummy-agent-test.yml @@ -8,7 +8,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.11' - name: Set up environment