|
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") |
|
|
|
|
|
|
|
web_agent = ToolCallingAgent( |
|
tools=[DuckDuckGoSearchTool()], |
|
model=model, |
|
max_steps=5, |
|
name="My browser", |
|
description="Searching is easy" |
|
) |
|
|
|
with sandbox: |
|
result = web_agent.run("What are some recent breakthroughs in AI?") |
|
print(result) |
|
|