From f2c09e0e7aaf2e5e196daa43b462be7768b3392c Mon Sep 17 00:00:00 2001 From: Aymeric Date: Sat, 8 Feb 2025 21:29:51 +0100 Subject: [PATCH] Remove ManagedAgent from doc --- docs/source/en/guided_tour.md | 13 ++++++------- 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, 10 insertions(+), 15 deletions(-) diff --git a/docs/source/en/guided_tour.md b/docs/source/en/guided_tour.md index 7e0545b65..3c0e774e6 100644 --- a/docs/source/en/guided_tour.md +++ b/docs/source/en/guided_tour.md @@ -344,25 +344,24 @@ It empirically yields better performance on most benchmarks. The reason for this You can easily build hierarchical multi-agent systems with `smolagents`. -To do so, encapsulate the agent in a [`ManagedAgent`] object. This object needs arguments `agent`, `name`, and a `description`, 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. +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. Here's an example of making an agent that managed a specific web search agent using our [`DuckDuckGoSearchTool`]: ```py -from smolagents import CodeAgent, HfApiModel, DuckDuckGoSearchTool, ManagedAgent +from smolagents import CodeAgent, HfApiModel, DuckDuckGoSearchTool model = HfApiModel() -web_agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=model) - -managed_web_agent = ManagedAgent( - agent=web_agent, +web_agent = CodeAgent( + tools=[DuckDuckGoSearchTool()], + model=model name="web_search", description="Runs web searches for you. Give it your query as an argument." ) 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 d49ecae62..973c9ecea 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 db85fc755..0669c4dcc 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 b8fdea376..5be1cc1cd 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