Metadata-Version: 2.2
Name: empire-chain
Version: 0.3.7
Summary: An orchestration framework for all your AI needs
Home-page: https://github.com/manas95826/empire-chain
Author: Manas Chopra
Author-email: manaschopra95826@gmail.com
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai
Requires-Dist: anthropic
Requires-Dist: groq
Requires-Dist: qdrant-client
Requires-Dist: chromadb
Requires-Dist: sentence-transformers
Requires-Dist: PyPDF2
Requires-Dist: python-docx
Requires-Dist: yfinance
Requires-Dist: duckduckgo-search
Requires-Dist: phidata
Requires-Dist: streamlit
Requires-Dist: numpy
Requires-Dist: Pillow
Requires-Dist: matplotlib
Requires-Dist: docling
Requires-Dist: tqdm
Requires-Dist: soundfile
Requires-Dist: kokoro_onnx
Requires-Dist: python-dotenv
Requires-Dist: crawl4ai
Dynamic: author
Dynamic: author-email
Dynamic: home-page
Dynamic: requires-python

# ⚔️🔗 EmpireChain

⚡ An orchestration framework for all your AI needs ⚡

```
    ███████╗███╗   ███╗██████╗ ██╗██████╗ ███████╗
    ██╔════╝████╗ ████║██╔══██╗██║██╔══██╗██╔════╝
    █████╗  ██╔████╔██║██████╔╝██║██████╔╝█████╗  
    ██╔══╝  ██║╚██╔╝██║██╔═══╝ ██║██╔══██╗██╔══╝  
    ███████╗██║ ╚═╝ ██║██║     ██║██║  ██║███████╗
    ╚══════╝╚═╝     ╚═╝╚═╝     ╚═╝╚═╝  ╚═╝╚══════╝
     ██████╗██╗  ██╗ █████╗ ██╗███╗   ██╗
    ██╔════╝██║  ██║██╔══██╗██║████╗  ██║
    ██║     ███████║███████║██║██╔██╗ ██║
    ██║     ██╔══██║██╔══██║██║██║╚██╗██║
    ╚██████╗██║  ██║██║  ██║██║██║ ╚████║
     ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝
    =============================================
         🔗 Chain Your AI Dreams Together 🔗
    =============================================
```

<p align="center">
  <a href="https://pypi.org/project/empire-chain/">
    <img src="https://img.shields.io/pypi/v/empire-chain" alt="PyPI version">
  </a>
  <a href="https://pypi.org/project/empire-chain/">
    <img src="https://img.shields.io/pypi/dm/empire-chain" alt="PyPI downloads">
  </a>
  <a href="https://github.com/manas95826/empire-chain/blob/main/LICENSE">
    <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
  </a>
  <a href="https://github.com/manas95826/empire-chain/stargazers">
    <img src="https://img.shields.io/github/stars/manas95826/empire-chain" alt="GitHub stars">
  </a>
</p>

## Features

- 🤖 Multiple LLM Support (OpenAI, Anthropic, Groq)
- 📚 Vector Store Integration (Qdrant, ChromaDB)
- 🔍 Advanced Document Processing
- 🎙️ Speech-to-Text Capabilities
- 🌐 Web Crawling with crawl4ai
- 📊 Data Visualization
- 🎯 RAG Applications
- 🤝 PhiData Agent Integration
- 💬 Interactive Chatbots
- 📝 Document Analysis with Docling
- 🤖 Agentic Framework

## Installation

```bash
pip install empire-chain
```

## Core Components

### Agent

```python
from empire_chain.agent import Agent
from dotenv import load_dotenv

load_dotenv()

def get_weather(location: str) -> str:
    """Simulated weather function"""
    return f"The weather in {location} is sunny!"

def calculate_distance(from_city: str, to_city: str) -> str:
    """Simulated distance calculator"""
    return f"The distance from {from_city} to {to_city} is 500km"

agent = Agent()
agent.register_function(get_weather)
agent.register_function(calculate_distance)
result = agent.process_query("What's the weather like in New York?")
print(result)
```

### Document Processing

```python
from empire_chain.file_reader import DocumentReader

reader = DocumentReader()
text = reader.read("your_file_path")  # Supports PDF, DOCX, and more
```

### Speech-to-Text

```python
from empire_chain.stt import GroqSTT

stt = GroqSTT()
text = stt.transcribe("audio_file.mp3")
```

### LLM Integration

```python
from empire_chain.llms import OpenAILLM, AnthropicLLM, GroqLLM

openai_llm = OpenAILLM("gpt-4")
anthropic_llm = AnthropicLLM("claude-3-sonnet")
groq_llm = GroqLLM("mixtral-8x7b")
```

### Vector Stores

```python
from empire_chain.vector_stores import QdrantVectorStore, ChromaVectorStore
from empire_chain.embeddings import OpenAIEmbeddings

vector_store = QdrantVectorStore(":memory:")
embeddings = OpenAIEmbeddings("text-embedding-3-small")
```

### Web Crawling

```python
from empire_chain.crawl4ai import Crawler

crawler = Crawler()
data = crawler.crawl("https://example.com")
```

### Data Visualization

```python
from empire_chain.visualizer import DataAnalyzer, ChartFactory

analyzer = DataAnalyzer()
analyzed_data = analyzer.analyze(your_data)
chart = ChartFactory.create_chart('Bar Graph', analyzed_data)
chart.show()
```

### Interactive Chatbots

```python
from empire_chain.streamlit import Chatbot, VisionChatbot, PDFChatbot

# Simple Chatbot
chatbot = Chatbot(llm=OpenAILLM("gpt-4"), title="Empire Chain Chatbot")
chatbot.chat()

# Vision Chatbot
vision_bot = VisionChatbot(title="Vision Assistant")
vision_bot.chat()

# PDF Chatbot
pdf_bot = PDFChatbot(
    title="PDF Assistant",
    llm=OpenAILLM("gpt-4"),
    vector_store=QdrantVectorStore(":memory:"),
    embeddings=OpenAIEmbeddings("text-embedding-3-small")
)
pdf_bot.chat()
```

### PhiData Agents

```python
from empire_chain.phidata_agents import PhiWebAgent, PhiFinanceAgent

web_agent = PhiWebAgent()
finance_agent = PhiFinanceAgent()

web_results = web_agent.generate("What are the latest AI developments?")
finance_results = finance_agent.generate("Analyze TSLA stock performance")
```

### Document Analysis with Docling

```python
from empire_chain.docling import Docling

docling = Docling()
analysis = docling.convert("input.pdf")
```

## Example Cookbooks

Check out our cookbooks directory for complete examples:
- RAG Applications (`cookbooks/empire_rag.py`)
- Web Crawling (`cookbooks/crawler.py`)
- Document Processing (`cookbooks/generalized_read_file.py`)
- Topic to Podcast (`cookbooks/topic-to-podcast.py`)
- Data Visualization (`cookbooks/visualize_data.py`)
- Chatbot Examples (`cookbooks/simple_chatbot.py`, `cookbooks/chat_with_image.py`, `cookbooks/chat_with_pdf.py`)
- PhiData Agent Usage (`cookbooks/phi_agents.py`)

## Contributing

```bash
git clone https://github.com/manas95826/empire-chain.git
cd empire-chain
pip install -e .
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

