From 3316dd7b114fe1c31db701173eae7fe1c68d3043 Mon Sep 17 00:00:00 2001 From: Aymeric Roucher <69208727+aymeric-roucher@users.noreply.github.com> Date: Thu, 13 Feb 2025 11:21:39 +0100 Subject: [PATCH] Remove ManagedAgent from doc (#563) --- docs/source/en/guided_tour.md | 7 ++++--- docs/source/hi/reference/agents.md | 3 +-- docs/source/hi/tutorials/inspect_runs.md | 7 ++----- docs/source/zh/reference/agents.md | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/source/en/guided_tour.md b/docs/source/en/guided_tour.md index dd8d5f2..9101d3d 100644 --- a/docs/source/en/guided_tour.md +++ b/docs/source/en/guided_tour.md @@ -358,7 +358,8 @@ It empirically yields better performance on most benchmarks. The reason for this You can easily build hierarchical multi-agent systems with `smolagents`. -To create a managed agent, give your `CodeAgent` or `ToolCallingAgent` the attributes `name` and `description` - these are mandatory to make the agent callable by its manager agent. The manager agent will receive the managed agent via its managed_agents argument during initialization. +To do so, just ensure your agent has `name` and`description` attributes, which will then be embedded in the manager agent's system prompt to let it know how to call this managed agent, as we also do for tools. +Then you can pass this managed agent in the parameter managed_agents upon initialization of the manager agent. Here's an example of making an agent that managed a specific web search agent using our [`DuckDuckGoSearchTool`]: @@ -367,7 +368,7 @@ from smolagents import CodeAgent, HfApiModel, DuckDuckGoSearchTool model = HfApiModel() -managed_web_agent = CodeAgent( +web_agent = CodeAgent( tools=[DuckDuckGoSearchTool()], model=model, name="web_search", @@ -375,7 +376,7 @@ managed_web_agent = CodeAgent( ) manager_agent = CodeAgent( - tools=[], model=model, managed_agents=[managed_web_agent] + tools=[], model=model, managed_agents=[web_agent] ) manager_agent.run("Who is the CEO of Hugging Face?") diff --git a/docs/source/hi/reference/agents.md b/docs/source/hi/reference/agents.md index 7d0f2d7..2e070cf 100644 --- a/docs/source/hi/reference/agents.md +++ b/docs/source/hi/reference/agents.md @@ -42,10 +42,9 @@ Agents और tools के बारे में अधिक जानने [[autodoc]] ToolCallingAgent - ### ManagedAgent -[[autodoc]] ManagedAgent +_This class is deprecated since 1.8.0: now you just need to pass name and description attributes to an agent to directly use it as previously done with a ManagedAgent._ ### stream_to_gradio diff --git a/docs/source/hi/tutorials/inspect_runs.md b/docs/source/hi/tutorials/inspect_runs.md index db85fc7..0669c4d 100644 --- a/docs/source/hi/tutorials/inspect_runs.md +++ b/docs/source/hi/tutorials/inspect_runs.md @@ -71,7 +71,6 @@ SmolagentsInstrumentor().instrument(tracer_provider=trace_provider) from smolagents import ( CodeAgent, ToolCallingAgent, - ManagedAgent, DuckDuckGoSearchTool, VisitWebpageTool, HfApiModel, @@ -79,15 +78,13 @@ from smolagents import ( model = HfApiModel() -agent = ToolCallingAgent( +managed_agent = ToolCallingAgent( tools=[DuckDuckGoSearchTool(), VisitWebpageTool()], model=model, -) -managed_agent = ManagedAgent( - agent=agent, name="managed_agent", description="This is an agent that can do web search.", ) + manager_agent = CodeAgent( tools=[], model=model, diff --git a/docs/source/zh/reference/agents.md b/docs/source/zh/reference/agents.md index 970372f..e5e5118 100644 --- a/docs/source/zh/reference/agents.md +++ b/docs/source/zh/reference/agents.md @@ -47,7 +47,7 @@ Both require arguments `model` and list of tools `tools` at initialization. ### ManagedAgent -_This class is deprecated since 1.8.0: now you just need to pass name and description attributes to an agent to use it as a ManagedAgent._ +_This class is deprecated since 1.8.0: now you just need to pass name and description attributes to an agent to directly use it as previously done with a ManagedAgent._ ### stream_to_gradio