File size: 823 Bytes
3048921 6f46aeb 3048921 6f46aeb 3048921 f49bcc1 9951d91 3048921 f49bcc1 3048921 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
from smolagents import DuckDuckGoSearchTool, LiteLLMModel, ToolCallingAgent
from e2b import Sandbox
model = LiteLLMModel(
model_id="groq/meta-llama/llama-4-maverick-17b-128e-instruct",
api_key="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"
)
sandbox = Sandbox(template="", api_key="e2b_2139e46aaa78c6a307d269c2ffe98b05b4164b22") # You can specify CPU, memory, timeout, etc.
# Create web agent and manager agent structure
web_agent = ToolCallingAgent(
tools=[DuckDuckGoSearchTool()], # Add required tools
model=model, # Add model
max_steps=5, # Adjust steps
name="My browser", # Add name
description="Searching is easy" # Add description
)
with sandbox:
result = web_agent.run("What are some recent breakthroughs in AI?")
print(result)
|