style(agent): simplify output format by removing agent distinction in results

pull/819/head
Pavan Kumar 3 months ago committed by ascender1729
parent da6ba0dd97
commit 07f4c65bde

@ -137,23 +137,31 @@ class MultiAgentMathSystem:
results = asyncio.run(self.process_task(user_input)) results = asyncio.run(self.process_task(user_input))
print("\nResults:") responses = []
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:
if "error" in result: if "error" in result:
print(f"Error: {result['error']}") responses.append(f"Error: {result['error']}")
else: else:
# Only show the actual calculation result, not the system information
response = result["response"] response = result["response"]
if isinstance(response, str): if isinstance(response, str):
# Remove system information and keep only the calculation part # Clean up calculation results
if "=" in response: if "=" in response:
calculation = response.split("=")[-1].strip() calculation = response.split("=")[-1].strip()
print(f"Result: {calculation}") responses.append(calculation)
else: else:
# Remove system/agent information
clean_response = response.split("System:")[0].strip()
clean_response = clean_response.split("Human:")[0].strip()
if clean_response:
responses.append(clean_response)
if responses:
print("\nResult:")
print("-"*30)
for response in responses:
print(response) print(response)
print("="*50) print("-"*30)
except Exception as e: except Exception as e:
print(f"System error: {str(e)}") print(f"System error: {str(e)}")

Loading…
Cancel
Save