From c6688355a7a127aa49f3212d379b46dace1e2094 Mon Sep 17 00:00:00 2001 From: martin legrand Date: Thu, 1 May 2025 22:10:54 +0200 Subject: [PATCH] set code safety on by default --- sources/agents/agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sources/agents/agent.py b/sources/agents/agent.py index 4e10c59..b4672a6 100644 --- a/sources/agents/agent.py +++ b/sources/agents/agent.py @@ -123,6 +123,8 @@ class Agent(): """ start_tag = "" end_tag = "" + if text is None: + return None start_idx = text.find(start_tag) end_idx = text.rfind(end_tag)+8 return text[start_idx:end_idx] @@ -240,7 +242,7 @@ class Agent(): if blocks != None: for block in blocks: self.show_block(block) - output = tool.execute([block]) + output = tool.execute([block], safety=True) feedback = tool.interpreter_feedback(output) # tool interpreter feedback success = not tool.execution_failure_check(output) self.blocks_result.append(executorResult(block, feedback, success, name))