Skip to content
Open
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
7 changes: 3 additions & 4 deletions superagi/agent/output_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ def _check_permission_in_restricted_mode(self, session, assistant_reply: str):

excluded_tools = [ToolExecutor.FINISH, '', None]

if self.agent_config["permission_type"].upper() == "RESTRICTED" and action.name not in excluded_tools and \
tools.get(action.name) and tools[action.name].permission_required:
if self.agent_config["permission_type"].upper() == "RESTRICTED" and action.name not in excluded_tools and \\n tools.get(action.name) and tools[action.name].permission_required:
new_agent_execution_permission = AgentExecutionPermission(
agent_execution_id=self.agent_execution_id,
status="PENDING",
Expand Down Expand Up @@ -146,7 +145,7 @@ def __init__(self, agent_execution_id: int, agent_config: dict):

def handle(self, session, assistant_reply):
assistant_reply = JsonCleaner.extract_json_array_section(assistant_reply)
tasks = eval(assistant_reply)
tasks = json.loads(assistant_reply)
tasks = np.array(tasks).flatten().tolist()
for task in reversed(tasks):
self.task_queue.add_task(task)
Expand Down Expand Up @@ -177,7 +176,7 @@ def __init__(self, agent_execution_id: int, agent_config: dict):

def handle(self, session, assistant_reply):
assistant_reply = JsonCleaner.extract_json_array_section(assistant_reply)
tasks = eval(assistant_reply)
tasks = json.loads(assistant_reply)
self.task_queue.clear_tasks()
for task in reversed(tasks):
self.task_queue.add_task(task)
Expand Down