| Crates.io | kowalski-tools |
| lib.rs | kowalski-tools |
| version | 0.5.0 |
| created_at | 2025-06-28 21:12:57.055249+00 |
| updated_at | 2025-06-28 21:12:57.055249+00 |
| description | Kowalski Tooling: A Rust-based agent for interacting with Ollama models |
| homepage | https://github.com/yarenty/kowalski |
| repository | https://github.com/yarenty/kowalski |
| max_upload_size | |
| id | 1730130 |
| size | 150,882 |
A comprehensive toolkit for the Kowalski AI agent framework, providing specialized tools for data processing, code analysis, web scraping, document processing, and more.
Kowalski Tools is a modular collection of specialized tools designed to extend the capabilities of the Kowalski AI agent framework. Each tool implements the Tool trait from kowalski-core and provides domain-specific functionality for various data processing and analysis tasks.
The module supports optional features that can be enabled:
web - Web scraping and search functionalitypdf - PDF document processingdata - CSV and data analysis toolscode - Code analysis tools├── src/
│ ├── lib.rs # Main library entry point
│ ├── tool.rs # Tool manager and utilities
│ ├── data.rs # CSV and data processing tools
│ ├── code.rs # Code analysis tools
│ ├── web/ # Web-related tools
│ │ ├── mod.rs
│ │ ├── search.rs # Web search functionality
│ │ └── scrape.rs # Web scraping functionality
│ └── document/ # Document processing tools
│ ├── mod.rs
│ └── pdf.rs # PDF processing
Tool trait from kowalski-coreasync-traitKowalskiError typesThe ToolManager provides centralized tool registration and execution:
Location: src/data.rs
Tool Name: csv_tool
A comprehensive CSV processing and analysis tool with statistical capabilities.
Features:
process_csv and analyze_csvParameters:
content (required): CSV content to processmax_rows (optional): Maximum number of rows to processmax_columns (optional): Maximum number of columns to processOutput: JSON with headers, records, and statistical summary
Location: src/code.rs
Tool Name: java_analysis
Comprehensive Java code analysis with metrics and quality suggestions.
Features:
Parameters:
content (required): Java code to analyzeOutput: JSON with metrics, complexity analysis, suggestions, and syntax errors
Tool Name: python_analysis
Python-specific code analysis with PEP 8 compliance checking.
Features:
Parameters:
content (required): Python code to analyzeOutput: JSON with Python-specific metrics, PEP 8 violations, and suggestions
Tool Name: rust_analysis
Rust code analysis with safety and performance considerations.
Features:
Parameters:
content (required): Rust code to analyzeOutput: JSON with Rust-specific analysis, safety checks, and optimization suggestions
Location: src/web/
Tool Name: web_search
Performs web searches using multiple search providers.
Features:
Parameters:
query (required): Search query stringnum_results (optional): Number of results (default: 3)provider (optional): Search provider (default: duckduckgo)Output: JSON with search results and metadata
Tool Name: web_scrape
Scrapes web pages using CSS selectors with recursive link following.
Features:
Parameters:
url (required): URL to scrapeselectors (required): Array of CSS selectorsfollow_links (optional): Follow links recursively (default: false)max_depth (optional): Maximum recursion depth (default: 1)Output: JSON array of extracted content with metadata
Location: src/document/
Tool Name: pdf_tool
Comprehensive PDF processing with text, metadata, and image extraction.
Features:
Parameters:
file_path (required): Path to PDF fileextract_text (optional): Extract text content (default: true)extract_metadata (optional): Extract metadata (default: false)extract_images (optional): Extract images (default: false)Output: JSON with extracted content based on selected options
use kowalski_tools::{CsvTool, ToolManager};
let mut manager = ToolManager::new();
let csv_tool = CsvTool::new(1000, 50);
manager.register_tool(csv_tool);
// Execute CSV analysis
let input = ToolInput {
task_type: "analyze_csv".to_string(),
content: csv_content,
parameters: HashMap::new(),
};
let result = manager.execute_tool("csv_tool", input).await?;
use kowalski_tools::web::WebSearchTool;
let search_tool = WebSearchTool::new("duckduckgo".to_string());
let input = ToolInput {
task_type: "search".to_string(),
content: "".to_string(),
parameters: {
let mut params = HashMap::new();
params.insert("query".to_string(), json!("Rust programming"));
params.insert("num_results".to_string(), json!(5));
params
},
};
let result = search_tool.execute(input).await?;
All tools use the KowalskiError type for consistent error handling:
ToolExecution - Errors during tool executionToolConfig - Configuration errorsContentProcessing - Data processing errorsExecution - General execution errorsThe module includes comprehensive tests for each tool: