feat : fix displaying problem + memory compression on loading + personality prompt + technical image

This commit is contained in:
martin legrand
2025-03-28 14:43:05 +01:00
parent 8cba1bad43
commit c862d496e3
32 changed files with 448 additions and 66 deletions
+5 -12
View File
@@ -53,13 +53,6 @@ def pretty_print(text, color = "info"):
print(colored(text, color_map[color]))
def animate_thinking(text, color="status", duration=2):
"""
Display an animated "thinking..." indicator in a separate thread.
Args:
text (str): Text to display
color (str): Color for the text
duration (float): How long to animate in seconds
"""
def _animate():
color_map = {
"success": (Fore.GREEN, "green"),
@@ -71,22 +64,22 @@ def animate_thinking(text, color="status", duration=2):
"default": (Fore.RESET, "black"),
"info": (Fore.CYAN, "cyan")
}
fore_color, term_color = color_map[color]
fore_color, term_color = color_map.get(color, color_map["default"])
spinner = itertools.cycle(['', '', '', '', '', '', '', '', '', ''])
end_time = time.time() + duration
while time.time() < end_time:
symbol = next(spinner)
if platform.system().lower() != "windows":
print(f"\r{fore_color}{symbol} {text}{Fore.RESET}", end="", flush=True)
print(f"{fore_color}{symbol} {text}{Fore.RESET}", flush=True)
else:
print(colored(f"\r{symbol} {text}", term_color), end="", flush=True)
print(colored(f"{symbol} {text}", term_color), flush=True)
time.sleep(0.1)
print("\033[1A\033[K", end="", flush=True)
print()
animation_thread = threading.Thread(target=_animate)
animation_thread.daemon = True
animation_thread.start()
animation_thread.join()
def timer_decorator(func):
"""