From 5d121ab7003790338abc9ed980ad5e65cf75c65e Mon Sep 17 00:00:00 2001 From: Xory Date: Wed, 6 Aug 2025 18:39:20 +0300 Subject: [PATCH] function calling & viewable CoT --- main.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 939bf97..7051bde 100644 --- a/main.py +++ b/main.py @@ -26,6 +26,7 @@ while True: tools=tools, stream=True) ran_tool = False + saw_content = False for chunk in stream: msg = chunk.message @@ -42,9 +43,14 @@ while True: }) ran_tool = True - # 2️⃣ normal user-visible text - elif msg.content: - print(msg.content, end="", flush=True) + if msg.thinking: + print(f"\033[90m{msg.thinking}", end="", flush=True) + + if msg.content: + if not saw_content: + print("") + saw_content = True + print(f"\033[97m{msg.content}", end="", flush=True) # loop again if we just satisfied a tool call if not ran_tool: