Metadata-Version: 2.4
Name: promptrend
Version: 1.0.0
Summary: Intent Classification and Contextual Bandit Recommendation System
Author-email: Your Name <your.email@example.com>
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi==0.68.0
Requires-Dist: uvicorn==0.15.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: pydantic-settings>=2.0.0
Requires-Dist: python-dotenv==0.19.0
Requires-Dist: sqlalchemy==1.4.23
Requires-Dist: psycopg2-binary==2.9.1
Requires-Dist: redis==4.1.0
Requires-Dist: torch>=2.0.0
Requires-Dist: transformers==4.11.3
Requires-Dist: scikit-learn==0.24.2
Requires-Dist: numpy==1.21.2
Requires-Dist: pandas==1.3.3
Requires-Dist: datasets==1.11.0
Requires-Dist: accelerate>=0.21.0
Provides-Extra: test
Requires-Dist: pytest==6.2.5; extra == "test"
Requires-Dist: httpx==0.18.2; extra == "test"
Requires-Dist: pytest-asyncio==0.15.1; extra == "test"
Dynamic: license-file

# PrompTrend: Intelligent Chat Support System

PrompTrend is an advanced chat support system that combines intent classification and contextual bandit algorithms to provide personalized recommendations and responses. The system uses BERT for intent classification and implements a contextual multi-armed bandit approach for dynamic learning from user interactions.

## 🌟 Key Features

- Intent classification using BERT
- Contextual bandit-based recommendation system
- Real-time user feedback processing
- Automatic question generation
- Redis caching for improved performance
- Comprehensive API documentation
- Robust error handling
- Database persistence with PostgreSQL

## 🛠️ Technology Stack

- **Framework**: FastAPI
- **ML Models**: BERT (Transformers), T5
- **Database**: PostgreSQL
- **Caching**: Redis
- **ML Libraries**: PyTorch, Scikit-learn
- **Testing**: Pytest
- **Documentation**: OpenAPI (Swagger)

## 📋 Prerequisites

- Python 3.8+
- PostgreSQL
- Redis
- CUDA-compatible GPU (optional, for faster model training)

## ⚙️ Installation

You can install PrompTrend directly via pip (once published):
```bash
pip install promptrend
```

For development, clone the repository and install in editable mode:
```bash
git clone https://github.com/yourusername/promptrend.git
cd promptrend
pip install -e .[test]
```

Set up environment variables:
```bash
python scripts/setup_env.py --env development
```

## 🚀 Running the Application

1. Start the Redis server:
```bash
redis-server
```

2. Start the application using the CLI:
```bash
promptrend-server
```

The API will be available at `http://localhost:8000`

## 📚 API Documentation

Once the application is running, you can access the interactive API documentation at:
- Swagger UI: `http://localhost:8000/docs`
- ReDoc: `http://localhost:8000/redoc`

## 🧪 Testing

The project includes comprehensive tests for all components. To run the tests:

```bash
# Run all tests
pytest

# Run tests with coverage report
pytest --cov=app tests/

# Run specific test file
pytest tests/test_intent_classifier.py
```

## 📂 Project Structure

```
promptrend/
├── api/
│   └── routes.py          # API endpoints
├── core/
│   ├── config.py          # Configuration management
│   ├── database.py        # Database setup
│   ├── models.py          # Data models
│   └── cache.py           # Redis cache implementation
├── services/
│   ├── intent_classifier.py    # BERT classifier
│   ├── recommender.py          # Contextual bandit
│   ├── recommendation_service.py
│   ├── question_generator.py   # T5 question generator
│   └── error_handler.py        # Error handling service
├── tests/
│   ├── test_intent_classifier.py
│   ├── test_recommender.py
│   ├── test_api.py
│   └── test_integration.py 
├── scripts/
│   └── setup_env.py
├── main.py
├── requirements.txt
└── README.md
```

## 🤝 Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## 📝 License

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

## 🙏 Acknowledgments

- Hugging Face for the Transformers library
- FastAPI team for the amazing framework
- The open-source community for various dependencies

## 📞 Contact

For questions and feedback, please create an issue in the GitHub repository.
