From 5dfee63f16218bf075b0362bc69870c83175362d Mon Sep 17 00:00:00 2001 From: Pavan Kumar <66913595+ascender1729@users.noreply.github.com> Date: Fri, 18 Apr 2025 15:36:37 +0000 Subject: [PATCH] Assistant checkpoint: Clean up response display format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assistant generated file changes: - examples/mcp_example/mock_multi_agent.py: Clean up response display --- User prompt: why im getthin the th all the thisnds what the ussedshoudl get only that thisnthe usereshoudl get whr its reuntet esoleutjoin whic is not necessaly " Multi-Agent Math System Enter 'exit' to quit Enter a math problem: add 3 and235 ╭────────────────────────── Agent Name Calculator [Max Loops: 1 ] ──────────────────────────╮ │ Calculator: To add 3 and 235, you can perform the calculation: │ │ │ │ 3 + 235 = 238. │ ╰───────────────────────────────────────────────────────────────────────────────────────────╯ ================================================== Results: ================================================== [Calculator] -------------------------------------------------- System: : Your Name: Calculator Your Description: Calculator agent specializing in mathematical calculations. For Calculator: use add, multiply, divide operations. For Stock Analyst: use moving averages and percentage change calculations. You are Calculator, a math processing agent. You have access to these mathematical operations ONLY: addition, multiplication, and division. Only suggest calculations using these available tools. Do not attempt to solve problems requiring other operations like percentages, square roots, or advanced math. When users ask about capabilities, list only the basic operations you can perform. Human:: add 3 and235 Calculator: To add 3 and 235, you can perform the calculation: 3 + 235 = 238. ================================================== Enter a math problem: " Replit-Commit-Author: Assistant Replit-Commit-Session-Id: fb95cfda-0201-499a-811b-4d56364a96ec --- examples/mcp_example/mock_multi_agent.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/mcp_example/mock_multi_agent.py b/examples/mcp_example/mock_multi_agent.py index 9462674b..17ffeb04 100644 --- a/examples/mcp_example/mock_multi_agent.py +++ b/examples/mcp_example/mock_multi_agent.py @@ -137,20 +137,23 @@ class MultiAgentMathSystem: results = asyncio.run(self.process_task(user_input)) - print("\n" + "="*50) - print("Results:") + print("\nResults:") print("="*50) for result in results: if result["response"] is not None: # Only show responses from relevant agents if "error" in result: - print(f"\n[{result['agent']}]") - print("-"*50) print(f"Error: {result['error']}") else: - print(f"\n[{result['agent']}]") - print("-"*50) - print(f"{result['response']}") - print("\n" + "="*50) + # Only show the actual calculation result, not the system information + response = result["response"] + if isinstance(response, str): + # Remove system information and keep only the calculation part + if "=" in response: + calculation = response.split("=")[-1].strip() + print(f"Result: {calculation}") + else: + print(response) + print("="*50) except Exception as e: print(f"System error: {str(e)}")