Token导航 LogoToken导航TokenDH.com
效率需要联网clawhub未标认证来源可访问clear审计提醒

ai-agent-toolsAIAgent 工具

Agent Skill

ai-agent-tools 用于辅助 Python 项目开发、测试和数据处理,适合在 OpenClaw 中需要阅读 Python 代码、运行测试或整理脚本流程时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

26,568

周安装

1,107

GitHub Stars

公开资料未说明

下载量

8,856
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ai-agent-tools(AIAgent 工具)
来源仓库:https://github.com/cerbug45/ai-agent-tools
安装命令:
openclaw skills install ai-agent-tools
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install ai-agent-tools

简介

Python 库为 AI 代理工作流程提供文件处理、文本提取、数据转换、实用程序、内存存储和验证工具。

SKILL.md

AI Agent Tools - Python Utility Library for AI Agents

📖 Overview

This library provides ready-to-use Python functions that AI agents can leverage to perform various tasks including file operations, text analysis, data transformation, memory management, and validation.

⚡ Quick Start

Installation

Method 1: Clone from GitHub

git clone https://github.com/cerbug45/ai-agent-tools.git
cd ai-agent-tools

Method 2: Direct Download

wget https://raw.githubusercontent.com/cerbug45/ai-agent-tools/main/ai_agent_tools.py

Method 3: Copy-Paste

Simply copy the ai_agent_tools.py file into your project directory.

Requirements

  • Python 3.7 or higher
  • No external dependencies (uses only standard library)

🛠️ Available Tools

1. FileTools - File Operations

Operations for reading, writing, and managing files.

Available Methods:

from ai_agent_tools import FileTools

# Read a file
content = FileTools.read_file("path/to/file.txt")

# Write to a file
FileTools.write_file("path/to/file.txt", "Hello World!")

# List files in directory
files = FileTools.list_files(".", extension=".py")

# Check if file exists
exists = FileTools.file_exists("path/to/file.txt")

Use Cases:

  • Reading configuration files
  • Saving agent outputs
  • Listing available resources
  • Checking file existence before operations

2. TextTools - Text Processing

Extract information and process text data.

Available Methods:

from ai_agent_tools import TextTools

text = "Contact: john@example.com, phone: 0532 123 45 67"

# Extract emails
emails = TextTools.extract_emails(text)
# Output: ['john@example.com']

# Extract URLs
urls = TextTools.extract_urls("Visit https://example.com")
# Output: ['https://example.com']

# Extract phone numbers
phones = TextTools.extract_phone_numbers(text)
# Output: ['0532 123 45 67']

# Count words
count = TextTools.word_count("Hello world from AI")
# Output: 4

# Summarize text
summary = TextTools.summarize_text("Long text here...", max_length=50)

# Clean whitespace
clean = TextTools.clean_whitespace("Too   many    spaces")
# Output: "Too many spaces"

Use Cases:

  • Extracting contact information from documents
  • Cleaning and formatting text
  • Text summarization
  • Data extraction from unstructured text

3. DataTools - Data Transformation

Convert between different data formats.

Available Methods:

from ai_agent_tools import DataTools

# Save data as JSON
data = {"name": "Alice", "age": 30}
DataTools.save_json(data, "output.json")

# Load JSON file
loaded_data = DataTools.load_json("output.json")

# Convert CSV text to dictionary list
csv_text = """name,age,city
Alice,30,New York
Bob,25,London"""
data_list = DataTools.csv_to_dict(csv_text)
# Output: [{'name': 'Alice', 'age': '30', 'city': 'New York'}, ...]

# Convert dictionary list to CSV
data = [
    {"name": "Alice", "age": 30},
    {"name": "Bob", "age": 25}
]
csv = DataTools.dict_to_csv(data)

Use Cases:

  • Saving structured data
  • Converting between formats
  • Processing API responses
  • Generating reports

4. UtilityTools - General Utilities

Helper functions for common operations.

Available Methods:

from ai_agent_tools import UtilityTools

# Get current timestamp
timestamp = UtilityTools.get_timestamp()
# Output: "2026-02-15 14:30:25"

# Generate unique ID from text
id = UtilityTools.generate_id("user_john_doe")
# Output: "a3f5b2c1"

# Calculate percentage
percent = UtilityTools.calculate_percentage(25, 100)
# Output: 25.0

# Safe division (no divide by zero error)
result = UtilityTools.safe_divide(10, 0, default=0.0)
# Output: 0.0

Use Cases:

  • Timestamping events
  • Generating unique identifiers
  • Safe mathematical operations
  • Data analysis calculations

5. MemoryTools - Memory Management

Store and retrieve data during agent execution.

Available Methods:

from ai_agent_tools import MemoryTools

# Initialize memory
memory = MemoryTools()

# Store a value
memory.store("user_name", "Alice")
memory.store("session_id", "abc123")

# Retrieve a value
name = memory.retrieve("user_name")
# Output: "Alice"

# List all keys
keys = memory.list_keys()
# Output: ["user_name", "session_id"]

# Delete a value
memory.delete("session_id")

# Clear all memory
memory.clear()

Use Cases:

  • Maintaining conversation context
  • Storing intermediate results
  • Session management
  • Caching computed values

6. ValidationTools - Data Validation

Validate different types of data.

Available Methods:

from ai_agent_tools import ValidationTools

# Validate email
is_valid = ValidationTools.is_valid_email("user@example.com")
# Output: True

# Validate URL
is_valid = ValidationTools.is_valid_url("https://example.com")
# Output: True

# Validate phone number (Turkish format)
is_valid = ValidationTools.is_valid_phone("0532 123 45 67")
# Output: True

Use Cases:

  • Input validation
  • Data quality checks
  • Form validation
  • Pre-processing data

💡 Complete Usage Example

from ai_agent_tools import (
    FileTools, TextTools, DataTools, 
    UtilityTools, MemoryTools, ValidationTools
)

# Initialize memory for session
memory = MemoryTools()

# Read input file
text = FileTools.read_file("contacts.txt")

# Extract information
emails = TextTools.extract_emails(text)
phones = TextTools.extract_phone_numbers(text)

# Validate extracted data
valid_emails = [e for e in emails if ValidationTools.is_valid_email(e)]
valid_phones = [p for p in phones if ValidationTools.is_valid_phone(p)]

# Create structured data
contacts = []
for i, (email, phone) in enumerate(zip(valid_emails, valid_phones)):
    contact = {
        "id": UtilityTools.generate_id(f"contact_{i}"),
        "email": email,
        "phone": phone,
        "timestamp": UtilityTools.get_timestamp()
    }
    contacts.append(contact)

# Save results
DataTools.save_json(contacts, "output/contacts.json")

# Store in memory
memory.store("total_contacts", len(contacts))
memory.store("last_processed", UtilityTools.get_timestamp())

print(f"Processed {len(contacts)} contacts")
print(f"Saved to: output/contacts.json")

🎯 Best Practices

1. Error Handling

Always wrap file operations in try-except blocks:

try:
    content = FileTools.read_file("data.txt")
    # Process content
except Exception as e:
    print(f"Error reading file: {e}")

2. Memory Management

Clear memory when no longer needed:

memory = MemoryTools()
# ... use memory ...
memory.clear()  # Clean up

3. Data Validation

Always validate data before processing:

if ValidationTools.is_valid_email(email):
    # Process email
    pass
else:
    print(f"Invalid email: {email}")

4. Path Handling

Use absolute paths or ensure working directory is correct:

import os

base_dir = os.path.dirname(__file__)
filepath = os.path.join(base_dir, "data", "file.txt")
content = FileTools.read_file(filepath)

🔧 Advanced Usage

Chaining Operations

# Read -> Process -> Validate -> Save pipeline
text = FileTools.read_file("input.txt")
cleaned = TextTools.clean_whitespace(text)
emails = TextTools.extract_emails(cleaned)
valid = [e for e in emails if ValidationTools.is_valid_email(e)]
DataTools.save_json({"emails": valid}, "output.json")

Creating Custom Workflows

class DataProcessor:
    def __init__(self):
        self.memory = MemoryTools()
        
    def process_document(self, filepath):
        # Read
        text = FileTools.read_file(filepath)
        
        # Extract
        emails = TextTools.extract_emails(text)
        urls = TextTools.extract_urls(text)
        
        # Store results
        self.memory.store("emails", emails)
        self.memory.store("urls", urls)
        
        # Generate report
        report = {
            "timestamp": UtilityTools.get_timestamp(),
            "file": filepath,
            "emails_found": len(emails),
            "urls_found": len(urls)
        }
        
        return report

📦 Integration with AI Agents

Example: LangChain Integration

from langchain.tools import Tool
from ai_agent_tools import FileTools, TextTools

def create_file_reader_tool():
    return Tool(
        name="ReadFile",
        func=FileTools.read_file,
        description="Read contents of a file"
    )

def create_email_extractor_tool():
    return Tool(
        name="ExtractEmails",
        func=TextTools.extract_emails,
        description="Extract email addresses from text"
    )

tools = [create_file_reader_tool(), create_email_extractor_tool()]

Example: OpenAI Function Calling

tools = [
    {
        "type": "function",
        "function": {
            "name": "read_file",
            "description": "Read a file and return its contents",
            "parameters": {
                "type": "object",
                "properties": {
                    "filepath": {
                        "type": "string",
                        "description": "Path to the file"
                    }
                },
                "required": ["filepath"]
            }
        }
    }
]

# In your agent loop
def execute_function(name, arguments):
    if name == "read_file":
        return FileTools.read_file(arguments["filepath"])

🧪 Testing

Run the built-in test suite:

python ai_agent_tools.py

Expected output:

=== AI Ajanları İçin Araçlar Kütüphanesi ===

1. Dosya Araçları:
   Okunan içerik: Merhaba AI Ajanı!

2. Metin Araçları:
   Bulunan emailler: ['ali@example.com']
   Bulunan telefonlar: ['0532 123 45 67']

3. Veri Araçları:
   CSV çıktısı:
   isim,yaş
   Ali,25
   Ayşe,30

...

✓ Tüm araçlar test edildi!

🤝 Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/new-tool
  3. Commit your changes: git commit -am 'Add new tool'
  4. Push to the branch: git push origin feature/new-tool
  5. Submit a pull request

📝 License

This project is open source and available under the MIT License.

👤 Author

GitHub: @cerbug45

🐛 Issues & Support

Found a bug or need help? Please open an issue on GitHub: https://github.com/cerbug45/ai-agent-tools/issues

📚 Additional Resources

🔄 Version History

v1.0.0 (2026-02-15)

  • Initial release
  • 6 tool categories
  • 25+ utility functions
  • Full documentation
  • Test suite included

Happy Coding! 🚀

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

78.38%
按下载量换算6,941

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

未展示

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills