Support managed agents in ToolCallingAgent by albertvillanova · Pull Request #1456 · huggingface/smolagents (original) (raw)

Pull Request Overview

This PR adds support for managed agents in ToolCallingAgent, ensuring they are treated like tools when calling the model and surfaced in prompts.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file

File Description
tests/test_agents.py Added a test to verify that managed agents are passed to model.generate alongside tools
src/smolagents/prompts/toolcalling_agent.yaml Extended system prompt to list agent inputs and output types
src/smolagents/prompts/structured_code_agent.yaml Updated example agent signatures to include typed task argument and docstring
src/smolagents/prompts/code_agent.yaml Mirrored signature/docs update in code agent prompt
src/smolagents/agents.py In _setup_managed_agents, set inputs/output_type; merged managed agents into tools_to_call_from

Comments suppressed due to low confidence (2)

tests/test_agents.py:1089

    def test_toolcalling_agent_passes_both_tools_and_managed_agents(self, test_tool):

src/smolagents/prompts/toolcalling_agent.yaml:106

      Takes inputs: {{agent.inputs}}