Skip to main content

No project description provided

Project description

PromptPalette

Open In Colab

PromptPalette is a powerful and flexible Python package designed to streamline the process of creating optimized prompts for large language models. It combines strategy selection and prompt writing to generate tailored system prompts for various AI applications.

Features

  • Automatic selection of appropriate prompting strategies based on given requirements and objectives
  • Crafting of detailed, task-specific prompts using selected strategies
  • Support for multiple AI providers (OpenAI, Anthropic)
  • Asynchronous operation for improved performance
  • Easy integration with existing AI workflows

Installation

You can install PromptPalette using pip:

pip install git+https://github.com/vatsalsaglani/promptpalette.git

Quick Start

Here's a simple example of how to use PromptPalette:

import asyncio
from promptpalette import Composer

api_key = "YOUR_API_KEY"
provider = "openai"  # or "claude"
model_name = "gpt-4o"  # or "claude-3-5-sonnet-20240620"

composer = Composer(api_key=api_key, provider=provider, model_name=model_name)

requirements_objectives = """Develop a chatbot that can provide personalized financial advice to users, including investment suggestions, budget planning, and explanations of complex financial concepts.
Key Requirements:

Personalized responses based on user's financial situation and goals
Ability to explain complex financial concepts in simple terms
Provide step-by-step guidance for creating budgets
Generate and explain investment portfolio recommendations
"""

async def main():
    prompt = await composer(requirements_objectives)
    print(prompt)

asyncio.run(main())

Advanced Usage

PromptPalette can handle a variety of tasks, from complex system designs to simple classification problems. Here's an example of using it for sentiment analysis:

async def main():
    prompt = await composer("I want to classify if a given tweet is positive or negative. And then provide tags or categories under positive or negative classified")
    print(prompt)

asyncio.run(main())

Configuration

PromptPalette supports different AI providers (openai and claude) and models. You can configure it by passing the appropriate parameters to the Composer class:

composer = Composer(api_key="YOUR_API_KEY", provider="openai", model_name="gpt-4o")

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

promptpalette-0.4.0.tar.gz (62.5 kB view details)

Uploaded Source

Built Distribution

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

promptpalette-0.4.0-py3-none-any.whl (89.8 kB view details)

Uploaded Python 3

File details

Details for the file promptpalette-0.4.0.tar.gz.

File metadata

  • Download URL: promptpalette-0.4.0.tar.gz
  • Upload date:
  • Size: 62.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1025-azure

File hashes

Hashes for promptpalette-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1024bf95cc44825a32304dc633a48c39d622e8324e4bc0722a56378739055b8e
MD5 d92c58b3e0811e10148ef64d99daafe2
BLAKE2b-256 e50aa5307ea0b6f8fd895586b0cf714b6c765a9edaa1de948bd56a776311439f

See more details on using hashes here.

File details

Details for the file promptpalette-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: promptpalette-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 89.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1025-azure

File hashes

Hashes for promptpalette-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10d847ad14b36ec85b5deb75d0fdc6d27e426ed22ffa17c63348cda96a2a7b8c
MD5 cd665d5c193b1d632fc3b03e55f75c01
BLAKE2b-256 db89ec66163c91f287d405530e3bb75aadaaf52560b0ecc536ddaddf61430a39

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