Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ManagedAgent from doc #563

Merged
merged 2 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions docs/source/en/guided_tour.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?")
Expand Down
3 changes: 1 addition & 2 deletions docs/source/hi/reference/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 2 additions & 5 deletions docs/source/hi/tutorials/inspect_runs.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,20 @@ SmolagentsInstrumentor().instrument(tracer_provider=trace_provider)
from smolagents import (
CodeAgent,
ToolCallingAgent,
ManagedAgent,
DuckDuckGoSearchTool,
VisitWebpageTool,
HfApiModel,
)

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,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/zh/reference/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down