sdk-python icon indicating copy to clipboard operation
sdk-python copied to clipboard

feat: add __str__ support for MultiAgentResult

Open ahmed-sekka opened this issue 10 months ago • 1 comments

Summary

  • Add __str__ method to MultiAgentResult to allow direct string conversion, matching the existing AgentResult.__str__ behavior
  • Enables str(result) to get combined text output from all agent results without manual unwrapping
  • Handles nested MultiAgentResult, exception nodes (skipped), and empty results

Test plan

  • [x] Unit test: single node result
  • [x] Unit test: multiple node results
  • [x] Unit test: empty results
  • [x] Unit test: exception nodes are skipped
  • [x] Unit test: nested MultiAgentResult

Closes #1561

ahmed-sekka avatar Jan 27 '26 11:01 ahmed-sekka

Hi, I'd like to pick this up. I noticed PR #1568 has been stale since the review feedback in February. My implementation addresses the reviewer's feedback. It matches the priority order from AgentResult.str (interrupts first), and also adds str to NodeResult for consistent behavior across the result hierarchy. Happy to submit a PR.

dosvk avatar Mar 27 '26 20:03 dosvk