xprompt 1.0.0
Simplify system prompt generation for language models with ease.

# XPrompt

[![PyPI Version](https://img.shields.io/pypi/v/xprompt.svg)](https://pypi.org/project/xprompt/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

## Description

XPrompt is a Python package that simplifies prompt generation for language models. It provides an intuitive interface to create system prompts based on defined tasks, allowing you to harness the power of language models effectively.

## Key Features

- 🚀 Easy-to-use prompt generation for various tasks
- ⚙️ Fine-tune system prompts for optimal performance
- 🔧 Configurable options for different models and prompt lengths
- 🌐 Integration with OpenAI API for seamless prompt generation

## Installation

🎉 Get Started
```shell
pip install xprompt
```

🔥 Example Usage

```
from xprompt import generate_optimal_prompt

# Define your main task and test cases
main_task = "Given a prompt, generate a landing page headline."

test_cases = ["Promoting an innovative new fitness app, Smartly", 
                "Why a vegan diet is beneficial for your health",
                "Introducing a new online course on digital marketing",
                "Launching a new line of eco-friendly clothing",
                "Promoting a new travel blog focusing on budget travel"]

api_key = "YOUR OPENAI API KEY"

# Generate the optimal system prompt
best_system_prompt, promt_df = generate_optimal_prompt(main_task, test_cases, api_key=api_key)

# Use the generated prompt for your language model
messages=[
            {"role": "system", "content": best_system_prompt},
            {"role": "user", "content": f""}
],
```

## How It Works

🔮 Prompt Generation: Using GPT-4 and GPT-3.5-Turbo, XPrompt can generate a variety of prompts based on a given use-case and test cases.

🧪 Prompt Testing: The real magic happens during testing. Each prompt is evaluated against the test cases, comparing their performance and ranking them using an ELO rating system.

🏆 ELO Rating System: Prompts start with an initial ELO rating of 1200. As they compete against each other in generating responses to the test cases, their ELO ratings dynamically change based on their performance. This allows you to easily identify the most effective prompts.


## Acknowledgements

🙌 Special thanks to [mshumer](https://github.com/mshumer/) for their inspiring notebook! 🎉 Their valuable contribution served as a guiding light throughout the development of this project. 🌟

🤝 We extend our gratitude to them for their creativity and innovative ideas. 😊 Their work has been an inspiration, and we are grateful for the knowledge and insights gained from their notebook. 📚

👏 We also want to express our appreciation to the open-source community for their continuous support and contributions. 🌍 Without their collective effort, projects like this would not be possible. 🙏

🌟 Thank you all for being a part of this amazing journey! 🚀

## 🤝 Contributing
We welcome contributions! See our Contribution Guidelines for detailed instructions.

## 📃 License
This project is licensed under the MIT License. See the LICENSE file for more details.

## 📧 Contact
Have any questions or suggestions? Reach out to us at themanojdesai@gmail.com.

Let's level up your language model experiments with XPrompt! 💪💡.