Fix serialization inconsistency in MultiStepAgent.to_dict/from_dict for managed_agents by hazrmard · Pull Request #1577 · huggingface/smolagents (original) (raw)

Thanks for spotting the issue and proposing a fix.

Finally, I have aligned both the to_dict and from_dict methods to use a list instead of a dict for serializing managed_agents. This reduces redundant information (since the agent name is already stored within each agent's dict) and also aligns the behavior with how tools are serialized.

Final PR Changes: