Git Product home page Git Product logo

promptnado's Introduction

🌪️ Promptnado: Your AI-Powered Prompt Engineer

PyPI version

Meet Promptnado – your personal AI prompt engineer! 🚀 By harnessing the power of AI, Promptnado acts as your personal AI prompt engineer, automatically generating, testing, and refining prompts to meet your specific criteria. Say goodbye to manual prompt tweaking and hello to AI-driven prompting!

🌟 Features

  • AI-powered iteration automatically generates and refines prompts.
  • Use natural language instructions to define your prompt criteria.
  • Automated evaluation tests each generated prompt against your specifications.
  • Generate synthetic examples to boost your testing dataset.
  • Choose your preferred models for prompt generation, evaluation, and testing.
  • Evaluate not just text outputs, but also the model's ability to make correct function calls.
  • Support for diverse input formats including strings, input-output pairs, Langchain messages, and interpolated dictionaries.
  • Create new datasets on the fly or use your own for testing.

How Promptnado Works

  1. You provide a system prompt with the token to signify where our prompt changes will go.
  2. You provide example requests to test these changes, or promptnado will generate them for you.
  3. Promptnado's AI generates multiple prompt variations based on your instruction.
  4. Each prompt is tested against your examples and evaluated using AI.
  5. The process repeats, refining prompts until the evaluation results all pass.
  6. You get a finely-tuned prompt that meets your specific needs!

Installation

pip install promptnado

Quick Start

from promptnado import Promptnado

# The system prompt we want to optimize
# We set the <HERE> token to signify where our prompt changes will go
system_prompt = """You are a helpful assistant. 

Rules:
- You are only allowed to talk about coding
- <HERE>
- Try to be concise"""

# The goal of the prompt changes
instruction = "The agent should only respond in English."

# Let's set 2 examples to start
examples = ["¿Cómo estás?", "How do typescript generics work?"]

pn = Promptnado(system_prompt, instruction, examples, max_attempts=5)

# Generate 2 more examples
pn.generate_examples(count=2)

# Run the optimization
pn.run()

Why Promptnado?

Prompt engineering is an art and a science. Promptnado brings the power of AI to this process, allowing you to save time on manual prompt tweaking, discover optimal prompts you might never have thought of, ensure consistency and quality in your AI interactions, and adapt quickly to new tasks and requirements.

Whether you're a seasoned AI engineer or just getting started with language models, Promptnado empowers you to create more effective, targeted prompts with ease. It's like having an AI prompt engineer right at your fingertips

promptnado's People

Contributors

camronh avatar

Stargazers

 avatar Francisco Ingham avatar

Watchers

 avatar

Forkers

lgesuellip

promptnado's Issues

Use LangGraph

Not sure the added benefit to this one. Cleans up the traces?

Validate prompt

Validate the prompt includes the rule token and only once

Allow for no examples

For cases where we just invoke the model with no messages array. For example data extraction.

Count tokens

Count the total tokens used in the entire process. Could be used for cost estimations.

Pretty prompt delivery

Signify in a pretty way, what exactly was changed in the prompt. Probably should use colors?

Include context

What if I want to evaluate something based on certain context. Like preventing hallucinations.

Regression Testing

Allow to pass in a regression testing dataset to validate that results didnt degrade in other areas

Variables as examples

In some cases the examples should go into the prompt. For example a prompt that says:


{Summary}

We need a way to create a dataset with the fields we want to populate and run against those

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.