Skip to content

Commit 52efa94

Browse files
committed
add process_task
1 parent 0382298 commit 52efa94

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/agent.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def execution_step(self, state: AgentState) -> AgentState:
238238
response = self.executor_agent.invoke(execution_prompt)
239239
state = self.executor_agent.process_response(response, state)
240240

241-
return {"action_log": state["action_log"]}
241+
return state
242242

243243
def evaluation_step(self, state: AgentState):
244244
#Convert action_logs to a summary of what the agent did, and then pass it to task_log
@@ -259,6 +259,24 @@ def evaluation_step(self, state: AgentState):
259259
print_h_bar()
260260
time.sleep(self.loop_delay)
261261
return state
262+
263+
def process_task(self, task: str): # Process a single task
264+
state = {
265+
"context": {},
266+
"current_task": task,
267+
"context_summary": "",
268+
"action_plan": [],
269+
"action_log": [],
270+
"task_log": [],
271+
}
272+
273+
state.update(self.observation_step(state))
274+
state.update(self.determination_step(state))
275+
state.update(self.division_step(state))
276+
state = self.execution_step(state)
277+
state.update(self.evaluation_step(state))
278+
279+
return state
262280

263281
def loop(self, task=None):
264282
# Check if LangChain enabled

0 commit comments

Comments
 (0)