mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-11 20:27:44 +02:00
[eric] scheduled tasks: agent can now manage workflows itself + tons of safety, cross-platform polish, and edge-case fixes
This commit is contained in:
@@ -14,11 +14,8 @@ def debug(*args, mode:str='debug', override_max_chars:bool=False):
|
||||
calling_file_name = os.path.basename(code.co_filename)
|
||||
if calling_function_name == "<module>":
|
||||
calling_function_name = calling_file_name
|
||||
# Retrieve the file path of the calling function
|
||||
file_path = os.path.abspath(code.co_filename)
|
||||
# print(f"FILE PATH: {file_path}")
|
||||
t_color, t_is_on, t_emoji = Debugleton().find_file_info(file_path)
|
||||
# print(f"DEBUGGING: {t_color}, {t_is_on}")
|
||||
max_chars = 3000
|
||||
|
||||
with open(code.co_filename, 'r', encoding='utf-8') as f:
|
||||
@@ -44,7 +41,6 @@ def debug(*args, mode:str='debug', override_max_chars:bool=False):
|
||||
arg_value = arg_value[:int(max_chars/2)] + "...\n..." + arg_value[arg_len-int(max_chars/2):]
|
||||
|
||||
function_print_str = calling_function_name if 'self' not in frame.f_locals else f'{frame.f_locals["self"].__class__.__name__}.{calling_function_name}'
|
||||
# color = COLORS.get(function_print_str, white)
|
||||
color = hex_to_rgb(t_color)
|
||||
if arg_is_text:
|
||||
print_str = f"{t_emoji}{rgb_to_ansi(color)}{indent_str}[{function_print_str}] : {bold_and_italicize_text(arg_value)}\033[0m"
|
||||
@@ -52,6 +48,5 @@ def debug(*args, mode:str='debug', override_max_chars:bool=False):
|
||||
print_str = f"{t_emoji}{rgb_to_ansi(color)}{indent_str}[{function_print_str}] : {arg_name} = {arg_value}\033[0m"
|
||||
if t_is_on: log_config.debug_custom(print_str, mode)
|
||||
|
||||
# Assign the function to the module's __call__ attribute
|
||||
import sys
|
||||
sys.modules[__name__] = debug
|
||||
|
||||
Reference in New Issue
Block a user