feat(multiagent): add __str__ support to MultiAgentResult#2057
Open
Zelys-DFKH wants to merge 1 commit intostrands-agents:mainfrom
Open
feat(multiagent): add __str__ support to MultiAgentResult#2057Zelys-DFKH wants to merge 1 commit intostrands-agents:mainfrom
Zelys-DFKH wants to merge 1 commit intostrands-agents:mainfrom
Conversation
MultiAgentResult previously had no __str__ method, requiring users to manually unwrap nested results to get string output. AgentResult already supports str(result) directly. Now str(multi_agent_result) returns: - Interrupt descriptions if any interrupts are present - Concatenated text output from all node results otherwise Matches the priority order and pattern used by AgentResult.__str__. Fixes strands-agents#1561
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
MultiAgentResult had no
__str__method. AgentResult already supportsstr(result)directly atagent_result.py:47, but the multi-agent equivalent required manually unwrapping nested results to get string output.This adds
__str__to MultiAgentResult following the same priority order as AgentResult:get_agent_results()Now
str(multi_agent_result)works the same asstr(agent_result).Related Issues
Fixes #1561
Documentation PR
N/A
Type of Change
New feature
Testing
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.