From e7e72b251812237989a64a5be31f54f97cfcca84 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] style(response): simplify output to display only final agent answer and remove redundant metadata --- 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)}")