style(response): simplify output to display only final agent answer and remove redundant metadata

pull/819/head
Pavan Kumar 3 months ago committed by ascender1729
parent 9666c17e6c
commit e7e72b2518

@ -137,20 +137,23 @@ class MultiAgentMathSystem:
results = asyncio.run(self.process_task(user_input)) results = asyncio.run(self.process_task(user_input))
print("\n" + "="*50) print("\nResults:")
print("Results:")
print("="*50) print("="*50)
for result in results: for result in results:
if result["response"] is not None: # Only show responses from relevant agents if result["response"] is not None: # Only show responses from relevant agents
if "error" in result: if "error" in result:
print(f"\n[{result['agent']}]")
print("-"*50)
print(f"Error: {result['error']}") print(f"Error: {result['error']}")
else: else:
print(f"\n[{result['agent']}]") # Only show the actual calculation result, not the system information
print("-"*50) response = result["response"]
print(f"{result['response']}") if isinstance(response, str):
print("\n" + "="*50) # 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: except Exception as e:
print(f"System error: {str(e)}") print(f"System error: {str(e)}")

Loading…
Cancel
Save