-
-
Notifications
You must be signed in to change notification settings - Fork 100
Tools
Joe Curlee (w4ffl35) edited this page Dec 1, 2025
·
2 revisions
AI Runner provides a comprehensive set of tools that the LLM can use to interact with external services, manage knowledge, search the web, and more.
Tools are LangChain-compatible functions that extend the LLM's capabilities beyond text generation. The LLM autonomously decides when to use tools based on user requests.
| Tool | Description |
|---|---|
search_web |
Search the web using DuckDuckGo |
search_news |
Search recent news articles |
scrape_website |
Extract content from a specific URL |
Example:
User: "What's the latest news about AI?"
AI: [calls search_news(query="artificial intelligence news")]
| Tool | Description |
|---|---|
record_knowledge |
Save a fact to the knowledge base |
search_knowledge_base |
Search stored knowledge |
rag_search |
Search indexed documents |
Example:
User: "Remember that my favorite programming language is Python"
AI: [calls record_knowledge(text="User's favorite programming language is Python", section="Preferences")]
| Tool | Description |
|---|---|
get_current_datetime |
Get current date and time |
get_weather |
Get weather for a location |
calculate |
Perform mathematical calculations |
| Tool | Description |
|---|---|
update_mood |
Update the AI's emotional state |
clear_conversation |
Clear chat history |
toggle_tts |
Enable/disable text-to-speech |
| Tool | Description |
|---|---|
generate_image |
Generate images with Stable Diffusion |
describe_image |
Describe an image using vision model |
The AggregatedSearchTool provides a unified interface for searching multiple services:
from airunner.components.tools.search_tool import AggregatedSearchTool
# Search across multiple sources
results = await AggregatedSearchTool.aggregated_search(
query="python asyncio",
category="web"
)- DuckDuckGo - General web search
- Google Custom Search - Google search API
- Wikipedia - Encyclopedia search
- arXiv - Academic papers
- NewsAPI - News articles
- StackExchange - Q&A sites
- GitHub - Code repositories
- OpenLibrary - Book search
The WebContentExtractor extracts and processes content from web pages:
from airunner.components.tools.web_content_extractor import WebContentExtractor
# Extract main content from URL
content = WebContentExtractor.extract("https://example.com/article")
# Get clean text for RAG ingestion
clean_text = content.main_text- Main content extraction (removes ads, navigation)
- Metadata extraction (title, author, date)
- Clean text output for LLM processing
- Support for various content types
Tools use the @tool decorator for automatic registration:
from airunner.components.llm.core.tool_registry import tool, ToolCategory
@tool(
name="my_custom_tool",
category=ToolCategory.RESEARCH,
description="Does something useful",
keywords=["custom", "useful"], # For discovery
defer_loading=False, # True = loaded on-demand
requires_api=False, # True = needs API instance
)
def my_custom_tool(param1: str, param2: int = 10) -> str:
"""
Tool docstring used for LLM guidance.
Args:
param1: First parameter description
param2: Second parameter description
Returns:
Result description
"""
return f"Result: {param1}, {param2}"The LLM can execute Python code to orchestrate multiple tools:
# LLM calls execute_code tool
execute_code(code='''
# Batch search example
results = []
for query in ["topic1", "topic2", "topic3"]:
results.append(search_web(query=query))
result = {"searches": results}
''')This reduces round-trips and keeps intermediate data efficient.
See Tool-Agent-System for details.
pip install airunner[search]Some tools require API keys:
# Google Custom Search
export GOOGLE_API_KEY=your_key
export GOOGLE_CSE_ID=your_cse_id
# NewsAPI
export NEWS_API_KEY=your_key
# Weather
export OPENWEATHER_API_KEY=your_key- Tool-Agent-System - Complete tool/agent architecture
- Knowledge System - Long-term memory
- RAG Search - Document search
- Architecture - System design