Metadata-Version: 2.4
Name: fastyr-ai-pipeline
Version: 0.1.0
Summary: A flexible AI pipeline for STT, LLM, and TTS
Home-page: https://github.com/cuuj69/fastyr
Author: William Jefferson Mensah
Author-email: mensahjefferson69@gmail.com
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
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
Classifier: Programming Language :: Python :: 3.11
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: fastapi>=0.68.0
Requires-Dist: uvicorn[standard]>=0.15.0
Requires-Dist: sqlalchemy[asyncio]>=1.4.0
Requires-Dist: alembic>=1.7.0
Requires-Dist: strawberry-graphql>=0.96.0
Requires-Dist: sentry-sdk>=1.5.0
Requires-Dist: structlog>=21.1.0
Requires-Dist: dependency-injector>=4.39.1
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: passlib>=1.7.4
Requires-Dist: python-multipart>=0.0.5
Requires-Dist: asyncpg>=0.25.0
Requires-Dist: prometheus-client>=0.12.0
Requires-Dist: gunicorn>=20.1.0
Requires-Dist: psycopg2-binary>=2.9.1
Requires-Dist: aiosqlite>=0.17.0
Requires-Dist: aiofiles>=23.2.1
Requires-Dist: PyJWT>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
Requires-Dist: coverage>=7.2.0; extra == "dev"
Requires-Dist: httpx>=0.24.0; extra == "dev"
Requires-Dist: aiohttp>=3.8.0; extra == "dev"
Requires-Dist: pytest-env>=1.0.0; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Fastyr AI Pipeline

A flexible and extensible Python library for building AI-powered conversational pipelines. Fastyr provides a clean interface between Speech-to-Text (STT), Language Model (LLM), and Text-to-Speech (TTS) services.

## Features

- Seamless integration of STT, LLM, and TTS services
- Easy provider switching with consistent interfaces
- Async/await support for optimal performance
- Built-in error handling and retries
- Flexible storage backend support

## Installation

```bash
pip install fastyr-ai-pipeline
```

## Quick Start

```python
import os
from fastyr.services.providers.pipeline_service import PipelineService
from fastyr.services.providers.deepgram_provider import DeepgramProvider
from fastyr.services.providers.openai_provider import OpenAIProvider
from fastyr.services.providers.elevenlabs_provider import ElevenLabsProvider
from fastyr.services.providers.local_storage_provider import LocalStorageProvider

# Initialize providers
storage = LocalStorageProvider(base_path="storage/audio")
pipeline = PipelineService(
    stt_provider=DeepgramProvider(api_key=os.getenv('DEEPGRAM_API_KEY')),
    llm_provider=OpenAIProvider(api_key=os.getenv('OPENAI_API_KEY')),
    tts_provider=ElevenLabsProvider(
        api_key=os.getenv('ELEVENLABS_API_KEY'),
        voice_id="your-voice-id"
    ),
    storage_provider=storage
)

# Process audio through the pipeline
result = await pipeline.process(request)
print(f"Processed audio available at: {result.audio_url}")
```

## Provider Interfaces

The library defines three core interfaces:

- **STTProvider**: `transcribe(audio_data: bytes, options: Dict) -> str`
- **LLMProvider**: `generate_response(prompt: str, options: Dict) -> str`
- **TTSProvider**: `synthesize(text: str, options: Dict) -> bytes`

### Implemented Providers

- **Deepgram** (STT): High-accuracy speech recognition with multi-language support
- **OpenAI** (LLM): GPT-3.5/4 integration with customizable prompts
- **ElevenLabs** (TTS): High-quality voice synthesis with multiple voice options

## Configuration

Set environment variables for your API keys:

```env
DEEPGRAM_API_KEY=your_deepgram_key
OPENAI_API_KEY=your_openai_key
ELEVENLABS_API_KEY=your_elevenlabs_key
```

## Custom Providers

Implement your own provider by extending the relevant interface:

```python
from fastyr.services.interfaces.stt_provider import STTProvider
from typing import Dict, Any

class CustomSTTProvider(STTProvider):
    async def transcribe(self, audio_data: bytes, options: Dict[str, Any] = None) -> str:
        # Your implementation
        pass
```

## Requirements

- Python 3.7+
- See `setup.py` for dependencies

## License

MIT License - see LICENSE file for details

## Author

William Jefferson Mensah - [GitHub](https://github.com/cuuj69)
