vesjanamimini's picture
Update app.py
3048921 verified
raw
history blame
823 Bytes
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)