From aedfd0594cd7739b1920970cc14a6e9b7d8c4df9 Mon Sep 17 00:00:00 2001 From: liailing1026 <1815388873@qq.com> Date: Fri, 30 Jan 2026 15:21:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B3=A8=E9=87=8A=E5=A4=A7=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E6=95=B0=E6=8D=AE=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/AgentCoord/LLMAPI/LLMAPI.py | 44 +++++++++---------- .../PlanEngine/AgentSelectModify.py | 2 +- .../PlanEngine/AgentSelection_Generator.py | 2 +- .../PlanEngine/branch_PlanOutline.py | 2 +- .../PlanEngine/branch_TaskProcess.py | 2 +- .../PlanEngine/taskProcess_Generator.py | 2 +- .../RehearsalEngine_V2/Action/baseAction.py | 2 +- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/backend/AgentCoord/LLMAPI/LLMAPI.py b/backend/AgentCoord/LLMAPI/LLMAPI.py index 1809749..85dcafe 100644 --- a/backend/AgentCoord/LLMAPI/LLMAPI.py +++ b/backend/AgentCoord/LLMAPI/LLMAPI.py @@ -122,7 +122,7 @@ def _call_with_custom_config(messages: list[dict], stream: bool, model_config: d if full_reply_content is None: raise Exception(f"API returned None content for model {api_model}") - print(colored(full_reply_content, "blue", "on_white"), end="") + #print(colored(full_reply_content, "blue", "on_white"), end="") return full_reply_content except Exception as e: print_colored(f"Custom API error for model {api_model} :{str(e)}","red") @@ -151,9 +151,9 @@ async def _achat_completion_stream_custom(messages:list[dict], temp_async_client chunk_message = choices[0].delta if chunk_message is not None: collected_messages.append(chunk_message) - if chunk_message.content: - print(colored(chunk_message.content, "blue", "on_white"), end="") - print() + # if chunk_message.content: + # print(colored(chunk_message.content, "blue", "on_white"), end="") + # print() full_reply_content = "".join( [m.content or "" for m in collected_messages if m is not None] ) @@ -209,8 +209,8 @@ async def _achat_completion_stream_groq(messages: list[dict]) -> str: if full_reply_content is None: raise Exception("Groq API returned None content") - print(colored(full_reply_content, "blue", "on_white"), end="") - print() + # print(colored(full_reply_content, "blue", "on_white"), end="") + # print() return full_reply_content @@ -251,8 +251,8 @@ async def _achat_completion_stream_mixtral(messages: list[dict]) -> str: if full_reply_content is None: raise Exception("Mistral API returned None content") - print(colored(full_reply_content, "blue", "on_white"), end="") - print() + # print(colored(full_reply_content, "blue", "on_white"), end="") + # print() return full_reply_content @@ -277,12 +277,12 @@ async def _achat_completion_stream_gpt35(messages: list[dict]) -> str: chunk_message = choices[0].delta if chunk_message is not None: collected_messages.append(chunk_message) # save the message - if chunk_message.content: - print( - colored(chunk_message.content, "blue", "on_white"), - end="", - ) - print() + # if chunk_message.content: + # print( + # colored(chunk_message.content, "blue", "on_white"), + # end="", + # ) + # print() full_reply_content = "".join( [m.content or "" for m in collected_messages if m is not None] @@ -324,8 +324,8 @@ def _achat_completion_json(messages: list[dict] ) -> str: if full_reply_content is None: raise Exception("OpenAI API returned None content") - print(colored(full_reply_content, "blue", "on_white"), end="") - print() + # print(colored(full_reply_content, "blue", "on_white"), end="") + # print() return full_reply_content @@ -346,12 +346,12 @@ async def _achat_completion_stream(messages: list[dict]) -> str: chunk_message = choices[0].delta if chunk_message is not None: collected_messages.append(chunk_message) # save the message - if chunk_message.content: - print( - colored(chunk_message.content, "blue", "on_white"), - end="", - ) - print() + # if chunk_message.content: + # print( + # colored(chunk_message.content, "blue", "on_white"), + # end="", + # ) + # print() full_reply_content = "".join( [m.content or "" for m in collected_messages if m is not None] diff --git a/backend/AgentCoord/PlanEngine/AgentSelectModify.py b/backend/AgentCoord/PlanEngine/AgentSelectModify.py index a9b30f5..474b6ff 100644 --- a/backend/AgentCoord/PlanEngine/AgentSelectModify.py +++ b/backend/AgentCoord/PlanEngine/AgentSelectModify.py @@ -104,7 +104,7 @@ def agentAbilityScoring(Agent_Board, Ability_Requirement_List): ), }, ] - print(messages[1]["content"]) + #print(messages[1]["content"]) scoreTable[Ability_Requirement] = read_LLM_Completion(messages) return scoreTable diff --git a/backend/AgentCoord/PlanEngine/AgentSelection_Generator.py b/backend/AgentCoord/PlanEngine/AgentSelection_Generator.py index 310e8fb..537af82 100644 --- a/backend/AgentCoord/PlanEngine/AgentSelection_Generator.py +++ b/backend/AgentCoord/PlanEngine/AgentSelection_Generator.py @@ -100,7 +100,7 @@ def generate_AgentSelection(General_Goal, Current_Task, Agent_Board): ), }, ] - print(messages[1]["content"]) + #print(messages[1]["content"]) agentboard_set = {agent["Name"] for agent in Agent_Board} diff --git a/backend/AgentCoord/PlanEngine/branch_PlanOutline.py b/backend/AgentCoord/PlanEngine/branch_PlanOutline.py index 1403711..75aa749 100644 --- a/backend/AgentCoord/PlanEngine/branch_PlanOutline.py +++ b/backend/AgentCoord/PlanEngine/branch_PlanOutline.py @@ -87,7 +87,7 @@ def branch_PlanOutline( InitialObject_List=str(InitialObject_List), General_Goal=General_Goal, ) - print(prompt) + #print(prompt) branch_List = [] for _ in range(branch_Number): messages = [ diff --git a/backend/AgentCoord/PlanEngine/branch_TaskProcess.py b/backend/AgentCoord/PlanEngine/branch_TaskProcess.py index ccd96b1..278909c 100644 --- a/backend/AgentCoord/PlanEngine/branch_TaskProcess.py +++ b/backend/AgentCoord/PlanEngine/branch_TaskProcess.py @@ -155,7 +155,7 @@ def branch_TaskProcess( General_Goal=General_Goal, Act_Set=ACT_SET, ) - print(prompt) + #print(prompt) branch_List = [] for i in range(branch_Number): messages = [ diff --git a/backend/AgentCoord/PlanEngine/taskProcess_Generator.py b/backend/AgentCoord/PlanEngine/taskProcess_Generator.py index a93d27d..61cd620 100644 --- a/backend/AgentCoord/PlanEngine/taskProcess_Generator.py +++ b/backend/AgentCoord/PlanEngine/taskProcess_Generator.py @@ -124,7 +124,7 @@ def generate_TaskProcess(General_Goal, Current_Task_Description): ), }, ] - print(messages[1]["content"]) + #print(messages[1]["content"]) # write a callback function, if read_LLM_Completion(messages)["Task_Process_Plan"] dont have the right format, call this function again while True: diff --git a/backend/AgentCoord/RehearsalEngine_V2/Action/baseAction.py b/backend/AgentCoord/RehearsalEngine_V2/Action/baseAction.py index 6a2872c..a10e068 100644 --- a/backend/AgentCoord/RehearsalEngine_V2/Action/baseAction.py +++ b/backend/AgentCoord/RehearsalEngine_V2/Action/baseAction.py @@ -107,7 +107,7 @@ class BaseAction(): Action_Description = self.info["Description"], Action_Custom_Note = self.Action_Custom_Note ) - print_colored(text = prompt, text_color="red") + #print_colored(text = prompt, text_color="red") messages = [{"role":"system", "content": prompt}] ActionResult = LLM_Completion(messages,True,False,model_config=model_config) ActionInfo_with_Result = copy.deepcopy(self.info)