Skip to main content

A Python package for prompt enhancement and multi-model interaction with OpenAI and Gemini.

Project description

PromptPrompter

A Python package for prompt enhancement and multi-model interaction with OpenAI and Gemini.

Installation

You can install PromptPrompter via pip:

pip install PromptPrompter

Or from source by cloning the repository and running:

pip install .

Usage

Here's an example of how to use PromptPrompter:

from prompt_enhancer import PromptEnhancer

# Initialize the PromptEnhancer with your API keys
enhancer = PromptEnhancer(openai_api_key="your_openai_api_key", gemini_api_key="your_gemini_api_key")

# Get the final answer for a given prompt
final_response = enhancer.get_final_answer(prompt="Explain quantum entanglement in simple terms", model="openai")
print(final_response)

API Key Management

You can set environment variables (OPENAI_API_KEY, GEMINI_API_KEY) or pass them as arguments when initializing the class or function.

Available OpenAI Models

The following OpenAI models can be used with the PromptEnhancer class:

  • gpt-4o
  • gpt-4o-mini
  • o1
  • o1-mini

Contributing

Contributions are welcome! Please read the CONTRIBUTING.md file for details on how to propose changes or submit pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Detailed Instructions

Setting Up the Environment

  1. Clone the Repository:

    git clone https://github.com/Ronican/PromptPrompter.git
    cd PromptPrompter
    
  2. Create a Virtual Environment:

    python3 -m venv venv
    
  3. Activate the Virtual Environment:

    • On macOS/Linux:
      source venv/bin/activate
      
    • On Windows:
      .\venv\Scripts\activate
      
  4. Install Dependencies:

    pip install -e .
    

Importing API Keys

You can set your API keys as environment variables or pass them directly when initializing the PromptEnhancer class.

Using Environment Variables

Set the environment variables in your shell:

  • On macOS/Linux:

    export OPENAI_API_KEY="your_openai_api_key"
    export GEMINI_API_KEY="your_gemini_api_key"
    
  • On Windows:

    set OPENAI_API_KEY=your_openai_api_key
    set GEMINI_API_KEY=your_gemini_api_key
    

Passing API Keys Directly

You can pass the API keys directly when initializing the PromptEnhancer class:

from prompt_enhancer import PromptEnhancer

enhancer = PromptEnhancer(
    openai_api_key="your_openai_api_key",
    gemini_api_key="your_gemini_api_key"
)

Examples

Check out the examples folder for detailed usage examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

promptprompter-0.1.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PromptPrompter-0.1.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file promptprompter-0.1.3.tar.gz.

File metadata

  • Download URL: promptprompter-0.1.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for promptprompter-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e9e8a0ec8f8bb6edf307cba06173921d15cf49849d23908f000d2380aa93bcb0
MD5 959d766e193db6db4c84eda387701304
BLAKE2b-256 15a1320942d2eac681ced62d22c2e3a3db0eb976b89ca1a3c4c6e0b0d3aef32e

See more details on using hashes here.

File details

Details for the file PromptPrompter-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: PromptPrompter-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for PromptPrompter-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 aefc1f2001e1f53d5daac1db42055d9a4676a58cef99b285625c44d4cf1964ca
MD5 e10abd5b17c85f93c464f2fea282d4e6
BLAKE2b-256 1120a68b20a9af7b986f55616327361c9f4e0e6445b2cffb20f09e641d7c2b89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page