Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions protollm/agents/universal_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def plan_node(
for attempt in range(max_retries):
try:
plan = planner.invoke({"input": query})

print('PLAN: \n' + str(plan.steps))
state["plan"] = plan.steps
return state

Expand Down Expand Up @@ -376,6 +376,7 @@ def replan_node(
"""
Refines or adjusts an existing execution plan based on previous steps and current state.
"""
print('Run RE-PLANNER')
llm = config["configurable"]["llm"]
max_retries = config["configurable"]["max_retries"]
tools_descp = config["configurable"]["tools_descp"]
Expand Down Expand Up @@ -408,17 +409,18 @@ def replan_node(

for attempt in range(max_retries):
try:
formatted_plan = format_plan(current_plan)
formatted_plan = str(current_plan)
formatted_past = str([i for i in set(past_steps)])

output = replanner.invoke(
{"input": query, "plan": formatted_plan, "past_steps": formatted_past}
)

if output.action == "response":
state["response"] = output.response
return state
else:
print('PLAN from RePlanner: \n' +str(output.steps or []))

state["plan"] = output.steps or []
state["next"] = "supervisor"
return state
Expand Down