ehl0wr0ld Rafael Uzarowski commited on
Commit
a561302
·
unverified ·
1 Parent(s): 60a0352

fix: do not crash if runtime parameter is not set in code exec (#641)

Browse files
python/tools/code_execution_tool.py CHANGED
@@ -71,7 +71,7 @@ class CodeExecution(Tool):
71
 
72
  def get_heading(self, text: str = ""):
73
  if not text:
74
- text = f"{self.name} - {self.args['runtime']}"
75
  text = truncate_text_string(text, 60)
76
  session = self.args.get("session", None)
77
  session_text = f"[{session}] " if session or session == 0 else ""
 
71
 
72
  def get_heading(self, text: str = ""):
73
  if not text:
74
+ text = f"{self.name} - {self.args['runtime'] if 'runtime' in self.args else 'unknown'}"
75
  text = truncate_text_string(text, 60)
76
  session = self.args.get("session", None)
77
  session_text = f"[{session}] " if session or session == 0 else ""