sdk-python
sdk-python copied to clipboard
feat: add __str__ support for MultiAgentResult
Summary
- Add
__str__method toMultiAgentResultto allow direct string conversion, matching the existingAgentResult.__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
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.