Metadata-Version: 2.4
Name: ai-parrot
Version: 0.20.1
Summary: Chatbot services for Navigator, based on Langchain
Author-email: Jesus Lara <jesuslara@phenobarbital.info>
License-Expression: MIT
Project-URL: Homepage, https://github.com/phenobarbital/ai-parrot
Project-URL: Source, https://github.com/phenobarbital/ai-parrot
Project-URL: Tracker, https://github.com/phenobarbital/ai-parrot/issues
Project-URL: Documentation, https://github.com/phenobarbital/ai-parrot/
Project-URL: Funding, https://paypal.me/phenobarbital
Project-URL: Say Thanks!, https://saythanks.io/to/phenobarbital
Keywords: asyncio,asyncpg,aioredis,aiomcache,artificial intelligence,ai,chatbot,agents
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Environment :: Web Environment
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Framework :: AsyncIO
Classifier: Typing :: Typed
Requires-Python: >=3.10.1
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Cython==3.0.11
Requires-Dist: faiss-cpu>=1.9.0
Requires-Dist: jq==1.7.0
Requires-Dist: rank_bm25==0.2.2
Requires-Dist: tabulate==0.9.0
Requires-Dist: sentencepiece==0.2.0
Requires-Dist: markdown2==2.5.4
Requires-Dist: psycopg-binary==3.2.6
Requires-Dist: python-datamodel>=0.10.17
Requires-Dist: backoff==2.2.1
Requires-Dist: asyncdb>=2.11.6
Requires-Dist: google-cloud-bigquery>=3.30.0
Requires-Dist: numexpr==2.10.2
Requires-Dist: fpdf==1.7.2
Requires-Dist: python-docx==1.1.2
Requires-Dist: typing_extensions<=4.14.0,>=4.13.2
Requires-Dist: navconfig[default]>=1.7.13
Requires-Dist: navigator-auth>=0.15.8
Requires-Dist: navigator-session>=0.6.5
Requires-Dist: navigator-api[locale,uvloop]>=2.13.5
Requires-Dist: matplotlib==3.10.0
Requires-Dist: seaborn==0.13.2
Requires-Dist: pydub==0.25.1
Requires-Dist: click>=8.1.7
Requires-Dist: async-notify[all]>=1.4.2
Requires-Dist: markitdown>=0.1.2
Requires-Dist: ddgs>=9.5.2
Requires-Dist: xmltodict>=0.14.2
Requires-Dist: pytesseract>=0.3.13
Requires-Dist: python-statemachine==2.5.0
Requires-Dist: aiohttp-swagger3==0.10.0
Requires-Dist: PyYAML>=6.0.2
Requires-Dist: python-arango-async==1.0.3
Requires-Dist: asyncdb[arangodb,bigquery,boto3,influxdb,mongodb]>=2.12.0
Requires-Dist: brotli==1.2.0
Requires-Dist: urllib3==2.6.3
Requires-Dist: aioquic==1.3.0
Requires-Dist: pylsqpack==0.3.23
Requires-Dist: aiohttp-sse-client==0.2.1
Requires-Dist: prance>=25.4.8.0
Requires-Dist: openapi-schema-validator==0.6.3
Requires-Dist: praw>=7.8.1
Requires-Dist: weasyprint==68.0
Requires-Dist: apscheduler==3.11.2
Provides-Extra: agents
Requires-Dist: sentence_transformers==5.0.0; extra == "agents"
Requires-Dist: yfinance==0.2.54; extra == "agents"
Requires-Dist: youtube_search==2.1.2; extra == "agents"
Requires-Dist: wikipedia==1.4.0; extra == "agents"
Requires-Dist: mediawikiapi==1.2; extra == "agents"
Requires-Dist: pyowm==3.3.0; extra == "agents"
Requires-Dist: stackapi==0.3.1; extra == "agents"
Requires-Dist: duckduckgo-search==7.5.0; extra == "agents"
Requires-Dist: google-search-results==2.4.2; extra == "agents"
Requires-Dist: google-api-python-client>=2.151.0; extra == "agents"
Requires-Dist: pomegranate>=1.1.1; extra == "agents"
Requires-Dist: networkx>=3.0; extra == "agents"
Requires-Dist: decorator>=5; extra == "agents"
Requires-Dist: autoviz==0.1.905; extra == "agents"
Requires-Dist: spacy==3.8.6; extra == "agents"
Requires-Dist: html2text==2025.4.15; extra == "agents"
Requires-Dist: httpx-sse==0.4.1; extra == "agents"
Requires-Dist: mcp==1.15.0; extra == "agents"
Requires-Dist: sse-starlette==3.0.2; extra == "agents"
Requires-Dist: requests-oauthlib==2.0.0; extra == "agents"
Requires-Dist: undetected-chromedriver==3.5.5; extra == "agents"
Requires-Dist: selenium==4.35.0; extra == "agents"
Requires-Dist: playwright==1.52.0; extra == "agents"
Requires-Dist: streamlit==1.50.0; extra == "agents"
Requires-Dist: jira==3.10.5; extra == "agents"
Requires-Dist: arxiv==2.2.0; extra == "agents"
Requires-Dist: docker==7.1.0; extra == "agents"
Requires-Dist: aiogoogle==5.17.0; extra == "agents"
Requires-Dist: rq==2.6.0; extra == "agents"
Requires-Dist: zeep[async]==4.3.1; extra == "agents"
Requires-Dist: branca==0.8.2; extra == "agents"
Requires-Dist: folium==0.20.0; extra == "agents"
Requires-Dist: webdriver-manager==4.0.2; extra == "agents"
Requires-Dist: prophet==1.2.1; extra == "agents"
Requires-Dist: folium==0.20.0; extra == "agents"
Requires-Dist: opensearch-py==3.1.0; extra == "agents"
Provides-Extra: loaders
Requires-Dist: mammoth==1.8.0; extra == "loaders"
Requires-Dist: markdownify==1.1.0; extra == "loaders"
Requires-Dist: python-docx==1.1.2; extra == "loaders"
Requires-Dist: pymupdf==1.26.3; extra == "loaders"
Requires-Dist: pymupdf4llm==0.0.27; extra == "loaders"
Requires-Dist: pdf4llm==0.0.27; extra == "loaders"
Requires-Dist: pytube==15.0.0; extra == "loaders"
Requires-Dist: youtube_transcript_api==1.0.3; extra == "loaders"
Requires-Dist: python-pptx==1.0.2; extra == "loaders"
Requires-Dist: yt-dlp==2025.8.22; extra == "loaders"
Requires-Dist: ebooklib>=0.19; extra == "loaders"
Requires-Dist: whisperx==3.4.2; extra == "loaders"
Requires-Dist: av==15.1.0; extra == "loaders"
Requires-Dist: resemblyzer==0.1.4; extra == "loaders"
Requires-Dist: pyannote-audio==3.4.0; extra == "loaders"
Requires-Dist: pyannote-core==5.0.0; extra == "loaders"
Requires-Dist: pyannote-database==5.1.3; extra == "loaders"
Requires-Dist: pyannote-metrics==3.2.1; extra == "loaders"
Requires-Dist: pyannote-pipeline==3.0.1; extra == "loaders"
Requires-Dist: pytorch-lightning==2.5.5; extra == "loaders"
Requires-Dist: pytorch-metric-learning==2.9.0; extra == "loaders"
Requires-Dist: nvidia-cudnn-cu12==9.1.0.70; extra == "loaders"
Requires-Dist: moviepy==2.2.1; extra == "loaders"
Requires-Dist: decorator>=5; extra == "loaders"
Requires-Dist: ffmpeg==1.4; extra == "loaders"
Requires-Dist: paddleocr==3.2.0; extra == "loaders"
Provides-Extra: vectors
Requires-Dist: torch==2.6.0; extra == "vectors"
Requires-Dist: torchaudio==2.6.0; extra == "vectors"
Requires-Dist: numpy<2.2,>=2.1; extra == "vectors"
Requires-Dist: tiktoken==0.9.0; extra == "vectors"
Requires-Dist: accelerate==0.34.2; extra == "vectors"
Requires-Dist: bitsandbytes==0.44.1; extra == "vectors"
Requires-Dist: datasets>=3.0.2; extra == "vectors"
Requires-Dist: safetensors>=0.4.3; extra == "vectors"
Requires-Dist: transformers<=4.51.3,>=4.51.1; extra == "vectors"
Requires-Dist: sentence-transformers>=5.0.0; extra == "vectors"
Requires-Dist: tokenizers<=0.21.1,>=0.20.0; extra == "vectors"
Requires-Dist: tensorflow>=2.19.1; extra == "vectors"
Requires-Dist: tf-keras==2.19.0; extra == "vectors"
Requires-Dist: simsimd>=4.3.1; extra == "vectors"
Requires-Dist: opencv-python==4.10.0.84; extra == "vectors"
Requires-Dist: chromadb==0.6.3; extra == "vectors"
Requires-Dist: bm25s[full]==0.2.14; extra == "vectors"
Provides-Extra: images
Requires-Dist: torchvision==0.21.0; extra == "images"
Requires-Dist: timm==1.0.15; extra == "images"
Requires-Dist: ultralytics==8.3.179; extra == "images"
Requires-Dist: albumentations==2.0.6; extra == "images"
Requires-Dist: filetype==1.2.0; extra == "images"
Requires-Dist: imagehash==4.3.1; extra == "images"
Requires-Dist: pgvector==0.4.1; extra == "images"
Requires-Dist: pyheif==0.8.0; extra == "images"
Requires-Dist: exif==1.6.1; extra == "images"
Requires-Dist: pillow-avif-plugin==1.5.2; extra == "images"
Requires-Dist: pillow-heif==0.22.0; extra == "images"
Requires-Dist: python-xmp-toolkit==2.0.2; extra == "images"
Requires-Dist: exifread==3.5.1; extra == "images"
Requires-Dist: transformers<=4.51.3,>=4.51.1; extra == "images"
Requires-Dist: ffmpeg==1.4; extra == "images"
Requires-Dist: holoviews==1.21.0; extra == "images"
Requires-Dist: bokeh==3.7.3; extra == "images"
Requires-Dist: pandas-bokeh==0.5.5; extra == "images"
Requires-Dist: plotly==5.22.0; extra == "images"
Requires-Dist: ipywidgets==8.1.0; extra == "images"
Requires-Dist: altair==5.5.0; extra == "images"
Provides-Extra: whisperx
Requires-Dist: whisperx==3.4.2; extra == "whisperx"
Requires-Dist: av==15.1.0; extra == "whisperx"
Requires-Dist: torch==2.6.0; extra == "whisperx"
Requires-Dist: torchaudio==2.6.0; extra == "whisperx"
Requires-Dist: torchvision==0.21.0; extra == "whisperx"
Requires-Dist: pyannote-audio==3.4.0; extra == "whisperx"
Requires-Dist: pyannote-core==5.0.0; extra == "whisperx"
Requires-Dist: pyannote-database==5.1.3; extra == "whisperx"
Requires-Dist: pyannote-metrics==3.2.1; extra == "whisperx"
Requires-Dist: pyannote-pipeline==3.0.1; extra == "whisperx"
Requires-Dist: pytorch-lightning==2.5.5; extra == "whisperx"
Requires-Dist: pytorch-metric-learning==2.9.0; extra == "whisperx"
Requires-Dist: nvidia-cudnn-cu12==9.1.0.70; extra == "whisperx"
Requires-Dist: torch-audiomentations==0.12.0; extra == "whisperx"
Requires-Dist: torch-pitch-shift==1.2.5; extra == "whisperx"
Requires-Dist: torchmetrics==1.8.2; extra == "whisperx"
Provides-Extra: anthropic
Requires-Dist: anthropic[aiohttp]==0.61.0; extra == "anthropic"
Requires-Dist: claude-agent-sdk>=0.1.0; extra == "anthropic"
Provides-Extra: openai
Requires-Dist: openai==2.8.1; extra == "openai"
Requires-Dist: tiktoken==0.9.0; extra == "openai"
Provides-Extra: google
Requires-Dist: google-api-python-client<=2.177.0,>=2.166.0; extra == "google"
Requires-Dist: google-cloud-texttospeech==2.27.0; extra == "google"
Requires-Dist: google-genai==1.52.0; extra == "google"
Requires-Dist: google-cloud-aiplatform==1.110.0; extra == "google"
Provides-Extra: groq
Requires-Dist: groq==0.33.0; extra == "groq"
Requires-Dist: typing_extensions<=4.14.1,>=4.13.2; extra == "groq"
Provides-Extra: llms
Requires-Dist: google-genai==1.52.0; extra == "llms"
Requires-Dist: openai==2.8.1; extra == "llms"
Requires-Dist: groq==0.33.0; extra == "llms"
Requires-Dist: anthropic[aiohttp]==0.61.0; extra == "llms"
Requires-Dist: claude-agent-sdk>=0.1.0; extra == "llms"
Requires-Dist: xai-sdk>=0.1.0; extra == "llms"
Provides-Extra: integrations
Requires-Dist: querysource>=3.17.9; extra == "integrations"
Requires-Dist: async-notify[all]>=1.5.2; extra == "integrations"
Provides-Extra: milvus
Requires-Dist: pymilvus==2.4.8; extra == "milvus"
Requires-Dist: milvus==2.3.5; extra == "milvus"
Provides-Extra: chroma
Requires-Dist: chroma==0.2.0; extra == "chroma"
Provides-Extra: eda
Requires-Dist: ydata-profiling==4.16.1; extra == "eda"
Requires-Dist: sweetviz==2.1.4; extra == "eda"
Provides-Extra: security
Requires-Dist: pytector[gguf]==0.2.0; extra == "security"
Provides-Extra: xai
Requires-Dist: xai-sdk>=0.1.0; extra == "xai"
Provides-Extra: all
Requires-Dist: ai-parrot[agents,chroma,images,llms,loaders,milvus,vectors]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.2.2; extra == "dev"
Requires-Dist: pytest-asyncio==1.2.0; extra == "dev"
Requires-Dist: pytest-xdist==3.3.1; extra == "dev"
Requires-Dist: pytest-assume==2.4.3; extra == "dev"
Requires-Dist: pytest-mock==3.15.1; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: pylint; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: coverage; extra == "dev"
Requires-Dist: maturin==1.9.6; extra == "dev"
Dynamic: license-file

# 🦜 AI-Parrot

**A unified Python library for building intelligent agents, chatbots, and LLM-powered applications**

AI-Parrot simplifies working with Large Language Models by providing a cohesive framework for creating conversational agents, managing tools, implementing RAG systems, and orchestrating complex AI workflows—all without the bloat of traditional frameworks.

## ✨ Key Features

### 🤖 Multi-Provider LLM Support
Connect seamlessly to multiple AI providers through a unified interface:
- **OpenAI** (GPT-4, GPT-3.5)
- **Anthropic Claude** (Claude 3.5 Sonnet, Opus)
- **Google GenAI** (Gemini models)
- **Groq** (Fast inference)

### 🛠️ Intelligent Agent System
Build sophisticated agents with built-in tool support and orchestration:
- **Tool Manager**: Share tools across multiple agents
- **Agent Registry**: Decorator-based agent creation and registration
- **Python Tool Calling**: Native support for calling Python functions as tools
- **Complex Toolkits**: Compose multiple tools into reusable toolkits

### 💬 Chatbot Creation
Create production-ready chatbots with minimal code:
- Conversational context management
- Multi-turn dialogue support
- Streaming responses
- Custom personality and behavior configuration

### 🗄️ Knowledge Base & RAG
Implement Retrieval-Augmented Generation with enterprise-grade components:
- **PgVector Integration**: PostgreSQL-based vector storage for semantic search
- **Document Loaders**: Transform any document format into AI-ready context
- **Open-Source Embeddings**: Hugging Face Transformers integration
- **Structured Outputs**: Type-safe responses from your LLMs

### 🌐 API & Server Capabilities
Deploy your AI applications with ease:
- **Bot Manager**: Centralized management for multiple bot instances
- **REST API**: Expose your agents and chatbots via HTTP endpoints
- **MCP Server**: Model Context Protocol support for standardized agent communication

### ⏰ Task Scheduling
Orchestrate agent actions over time:
- Schedule periodic agent tasks
- Trigger-based automation
- Asynchronous execution support
- Task dependency management

## 🚀 Quick Start

### Installation

```bash
pip install ai-parrot
```

### Create Your First Chatbot

```python
from ai_parrot import ChatBot, OpenAIClient

# Initialize LLM client
client = OpenAIClient(api_key="your-api-key")

# Create a chatbot
bot = ChatBot(
    name="assistant",
    client=client,
    system_prompt="You are a helpful AI assistant."
)

# Have a conversation
response = bot.chat("What's the weather like today?")
print(response)
```

### Build an Agent with Tools

```python
from ai_parrot import Agent, tool
from ai_parrot.registry import agent_registry

@tool
def calculate_sum(a: int, b: int) -> int:
    """Add two numbers together."""
    return a + b

@tool
def get_current_time() -> str:
    """Get the current time."""
    from datetime import datetime
    return datetime.now().strftime("%H:%M:%S")

# Register an agent with tools
@agent_registry.register("math_agent")
class MathAgent(Agent):
    def __init__(self):
        super().__init__(
            name="Math Helper",
            tools=[calculate_sum, get_current_time]
        )

# Use the agent
agent = agent_registry.get("math_agent")
result = agent.run("What's 42 plus 58? Also, what time is it?")
```

### Implement RAG with Vector Store

```python
from ai_parrot import RAGChatBot, PgVectorStore
from ai_parrot.loaders import PDFLoader, TextLoader

# Initialize vector store
vector_store = PgVectorStore(
    connection_string="postgresql://user:pass@localhost/db"
)

# Load and index documents
loader = PDFLoader()
documents = loader.load("./docs/manual.pdf")
vector_store.add_documents(documents)

# Create RAG-enabled chatbot
rag_bot = RAGChatBot(
    client=client,
    vector_store=vector_store,
    top_k=5
)

# Query with context
response = rag_bot.chat("How do I configure the settings?")
```

### Expose via API

```python
from ai_parrot import BotManager, create_api

# Create bot manager
manager = BotManager()
manager.register_bot("assistant", bot)
manager.register_agent("math_helper", agent)

# Create and run API server
app = create_api(manager)

# Run with: uvicorn main:app --reload
```

### Schedule Agent Tasks

```python
from ai_parrot import TaskScheduler

scheduler = TaskScheduler()

# Schedule a daily summary
@scheduler.schedule(cron="0 9 * * *")  # Every day at 9 AM
async def daily_summary():
    summary = await agent.run("Generate a summary of yesterday's activities")
    send_email(summary)

# Run the scheduler
scheduler.start()
```

## 🏗️ Architecture

AI-Parrot is designed with modularity and extensibility in mind:

```
┌─────────────────────────────────────────┐
│          Application Layer              │
│  (Chatbots, Agents, Custom Logic)       │
└──────────────┬──────────────────────────┘
               │
┌──────────────▼──────────────────────────┐
│         AI-Parrot Core                  │
│  • Agent Registry  • Tool Manager       │
│  • Bot Manager    • Task Scheduler      │
└──────────────┬──────────────────────────┘
               │
┌──────────────▼──────────────────────────┐
│      Provider Integrations              │
│  • OpenAI    • Claude    • Gemini       │
│  • Groq      • Hugging Face             │
└──────────────┬──────────────────────────┘
               │
┌──────────────▼──────────────────────────┐
│      Storage & Infrastructure           │
│  • PgVector  • Document Loaders         │
│  • MCP Server • API Layer               │
└─────────────────────────────────────────┘
```

## 🎯 Use Cases

- **Customer Support Bots**: Build intelligent support agents with knowledge base integration
- **Research Assistants**: Create agents that can search, analyze, and synthesize information
- **Automation Workflows**: Schedule and orchestrate AI-powered tasks
- **Internal Tools**: Expose LLM capabilities through APIs for your team
- **Multi-Agent Systems**: Coordinate multiple specialized agents working together

## 🗺️ Roadmap

- ✅ **Langchain Independence**: Removed heavyweight dependencies
- 🚧 **Complex Toolkits**: Advanced tool composition and chaining
- 🚧 **Model Interoperability**: Seamless LLM + Hugging Face model integration
- 📋 **Non-LLM Models**: Support for classification, NER, and other ML models
- 📋 **MCP Full Integration**: Complete Model Context Protocol implementation
- 📋 **Graph-Based RAG**: Knowledge graphs with ArangoDB for advanced reasoning

## 🤝 Contributing

Contributions are welcome! Whether it's bug fixes, new features, or documentation improvements, we appreciate your help in making AI-Parrot better.

## 📄 License

MIT License.

## 📚 Documentation

For detailed documentation, examples, and API reference, see the examples/ folder.

## 💬 Community & Support

- **Issues**: [GitHub Issues](your-github-repo/issues)
- **Discussions**: [GitHub Discussions](your-github-repo/discussions)

---

Built with ❤️ for developers who want powerful AI tools without the complexity.
