mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-10 07:18:10 -05:00
Implement Planning (#267)
* add outline of agent * add plan class * add initial prompt * plumb plan through a bit * refactor state management * move task into state * fix errors * add prompt parsing * add task actions * better serialization * more serialization hacks * fix fn * fix recursion error * refine prompt * better description of run * update prompt * tighter planning mechanism * prompt tweaks * fix merge * fix lint issues * add error handling for tasks * add graphic for plans * remove base_path from file actions * rename subtask to task * better planning * prompt updates for verification * remove verify field * ruff * mypy * fix actions
This commit is contained in:
@@ -70,12 +70,12 @@ class CodeActAgent(Agent):
|
||||
|
||||
def step(self, state: State) -> Action:
|
||||
if len(self.messages) == 0:
|
||||
assert state.task, "Expecting instruction to be set"
|
||||
assert state.plan.main_goal, "Expecting instruction to be set"
|
||||
self.messages = [
|
||||
{"role": "system", "content": SYSTEM_MESSAGE},
|
||||
{"role": "user", "content": state.task},
|
||||
{"role": "user", "content": state.plan.main_goal},
|
||||
]
|
||||
print(colored("===USER:===\n" + state.task, "green"))
|
||||
print(colored("===USER:===\n" + state.plan.main_goal, "green"))
|
||||
updated_info = state.updated_info
|
||||
if updated_info:
|
||||
for prev_action, obs in updated_info:
|
||||
|
||||
Reference in New Issue
Block a user