LlamaIndex integration for Agent Toolbox API — search, extract, screenshot, weather, finance, email validation, and translation tools for AI agents
Project description
🧰 llamaindex-agent-toolbox
LlamaIndex integration for Agent Toolbox API — 7 tools giving your LlamaIndex agents real-world superpowers.
| Tool | Endpoint | Description |
|---|---|---|
AgentToolboxSearchTool |
/v1/search |
Web search via DuckDuckGo |
AgentToolboxExtractTool |
/v1/extract |
Extract content from any URL |
AgentToolboxScreenshotTool |
/v1/screenshot |
Capture web page screenshots |
AgentToolboxWeatherTool |
/v1/weather |
Current weather & forecasts |
AgentToolboxFinanceTool |
/v1/finance |
Stock quotes & exchange rates |
AgentToolboxEmailValidatorTool |
/v1/validate-email |
Email validation (MX + SMTP + disposable) |
AgentToolboxTranslateTool |
/v1/translate |
Translation with auto-detect & glossary |
Installation
pip install llamaindex-agent-toolbox
Quick Start
Get an API Key
curl -X POST https://api.sendtoclaw.com/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com"}'
Set Environment Variable
export AGENT_TOOLBOX_API_KEY="atb_your_key_here"
Use Tools Directly
from llamaindex_agent_toolbox import AgentToolboxSearchTool, AgentToolboxWeatherTool
# Initialize
search = AgentToolboxSearchTool()
weather = AgentToolboxWeatherTool()
# Call directly
result = search.call(query="latest AI news", count=3)
print(result.content)
result = weather.call(location="Tokyo")
print(result.content)
Use with a LlamaIndex Agent
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI
from llamaindex_agent_toolbox import (
AgentToolboxSearchTool,
AgentToolboxExtractTool,
AgentToolboxWeatherTool,
AgentToolboxTranslateTool,
)
# Initialize tools
tools = [
AgentToolboxSearchTool(),
AgentToolboxExtractTool(),
AgentToolboxWeatherTool(),
AgentToolboxTranslateTool(),
]
# Create agent
llm = OpenAI(model="gpt-4o")
agent = ReActAgent.from_tools(tools, llm=llm, verbose=True)
# Run
response = agent.chat("What's the weather in Paris? Translate the summary to Japanese.")
print(response)
Translation with Glossary
from llamaindex_agent_toolbox import AgentToolboxTranslateTool
translate = AgentToolboxTranslateTool()
# Simple translation
result = translate.call(text="Hello, how are you?", target="zh")
print(result.content) # 你好,你好吗?
# With glossary (preserve technical terms)
result = translate.call(
text="The API endpoint returns JSON data.",
target="zh",
glossary={"API": "API", "JSON": "JSON", "endpoint": "端点"},
)
print(result.content) # API 端点 返回 JSON 数据。
Email Validation
from llamaindex_agent_toolbox import AgentToolboxEmailValidatorTool
validator = AgentToolboxEmailValidatorTool()
result = validator.call(email="test@gmail.com")
print(result.content)
# {"email": "test@gmail.com", "verdict": "deliverable", "score": 0.95, ...}
Async Support
All tools support async via acall:
import asyncio
from llamaindex_agent_toolbox import AgentToolboxSearchTool
async def main():
search = AgentToolboxSearchTool()
result = await search.acall(query="async python", count=3)
print(result.content)
asyncio.run(main())
Configuration
API Key
Set via environment variable (recommended):
export AGENT_TOOLBOX_API_KEY="atb_your_key_here"
Or pass directly:
tool = AgentToolboxSearchTool(api_key="atb_your_key_here")
Custom Base URL
For self-hosted instances:
tool = AgentToolboxSearchTool(
api_key="your-key",
base_url="http://localhost:3100",
)
Or via environment variable:
export AGENT_TOOLBOX_BASE_URL="http://localhost:3100"
Links
- Agent Toolbox API — main project
- LangChain Integration — LangChain version
- OpenAPI Spec — full API documentation
- LlamaIndex — LlamaIndex framework
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llamaindex_agent_toolbox-0.1.0.tar.gz.
File metadata
- Download URL: llamaindex_agent_toolbox-0.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96cf546156c90457d2e0dcf6ae5ebfced7a331c994ce55303e85425d976202b6
|
|
| MD5 |
f6ad130492100ddede0565ce0926d612
|
|
| BLAKE2b-256 |
89f4e4e4cb7f7aa6c1ed8202b4e30117ce8fa0ad22fa4af8763efdb1e26e1923
|
File details
Details for the file llamaindex_agent_toolbox-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llamaindex_agent_toolbox-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
159d23c74ffec5b29f413650270db21d99a02cf617ce8ed197d2801aa498d599
|
|
| MD5 |
207b45f8596f731044847551b805d437
|
|
| BLAKE2b-256 |
dbc79358c38f2205ec2a5c7ce3a6cb857a3388bb3452c854da1f0192eccc2fc0
|