Metadata-Version: 2.1
Name: agentu
Version: 0.1.0
Summary: A flexible Python package for creating AI agents with customizable tools
Author-email: Hemanth HM <hemanth.hm@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Hemanth HM <hemanth.hm@gmail.com>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/hemanth/agentu
Project-URL: Bug Tracker, https://github.com/hemanth/agentu/issues
Keywords: ai,agents,ollama,tools
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.1
Requires-Dist: duckduckgo-search>=4.1.1

# AgentU

Agentu is a flexible Python package for creating and managing AI agents with customizable tools using Ollama for evaluation.

## Installation

```bash
pip install agentu
```

## Quick Start - Using the Search Agent

The easiest way to get started is to use the built-in SearchAgent:

```python
from agentu import SearchAgent

# Create a search agent
agent = SearchAgent(
    name="research_assistant",
    model="llama3",
    max_results=3
)

# Perform a search
result = agent.search(
    query="Latest developments in quantum computing",
    region="wt-wt",  # worldwide
    safesearch="moderate"
)

# Print the results
print(result)
```

## Creating Custom Agents

You can also create custom agents with your own tools:

```python
from agentu import Agent, Tool, search_tool

# Create a new agent
agent = Agent("my_agent", model="llama3")

# Add the built-in search tool
agent.add_tool(search_tool)

# Add your own custom tool
def custom_tool(param1: str, param2: int) -> str:
    return f"{param1} repeated {param2} times"

my_tool = Tool(
    name="repeater",
    description="Repeats a string n times",
    function=custom_tool,
    parameters={
        "param1": "str: String to repeat",
        "param2": "int: Number of repetitions"
    }
)

agent.add_tool(my_tool)

# Use the agent
result = agent.process_input("Search for quantum computing and repeat the first title 3 times")
print(result)
```

## Features

- Built-in SearchAgent for easy web searches
- Integration with DuckDuckGo search
- Customizable search parameters (region, SafeSearch, etc.)
- Easy-to-use API for creating custom agents
- Type hints and comprehensive documentation

## Advanced Search Options

The SearchAgent supports various options:

```python
agent = SearchAgent()

# Custom number of results
result = agent.search("AI news", max_results=5)

# Region-specific search
result = agent.search("local news", region="us-en")

# SafeSearch settings
result = agent.search("images", safesearch="strict")
```


__Example output:__

```python
{
    "tool_used": "web_search",
    "parameters": {
        "query": "James Webb Space Telescope recent discoveries",
        "max_results": 3
    },
    "reasoning": "User wants information about the James Webb Space Telescope. Using web_search to find recent and relevant information.",
    "result": [
        {
            "title": "James Webb Space Telescope - NASA",
            "link": "https://www.nasa.gov/mission/webb/",
            "snippet": "The James Webb Space Telescope is the largest, most powerful space telescope ever built..."
        },
        # Additional results...
    ]
}
```

## Features

- Easy-to-use API for creating agents with custom tools
- Integration with Ollama for intelligent tool selection
- Built-in error handling and logging
- Type hints and comprehensive documentation
- Flexible tool system for adding new capabilities
