AOAI-Prompt-Optimization-Tool

The Azure OpenAI Prompt Optimization Tool is an interactive Python application powered by OpenAI's GPT-3 technology and tkinter GUI framework. This tool evaluates user-provided prompts, optimizes them, and provides enhanced responses. It features dynamic input, response presentation, and user-friendly functionalities, all while leveraging the power of AI-driven language optimization.

Prerequisites

An existing Azure OpenAI resource and model deployment of a chat model (e.g. gpt-35-turbo, gpt-4)

Deploy the tool

Deploy from your local machine

  1. Create an environment variables file .env with your API Key, Endpoint, and Deployed Model name.
  1. Run the following command to install all dependencies.
pip install -r requirements.txt
  1. Run app.py file.

How it works

The interface consists of four main elements:

image

Once you enter and submit a prompt, the following response will be generated:

image

Optimization criteria

The tool analyzes the prompt to determine its optimization level based on several criteria that aim to make the prompt clear, effective, and well-structured for the intended purpose. Below are the criteria used to evaluate whether a prompt is optimized or not:

Overall, prompt optimization involves balancing these criteria to create a prompt that maximizes the AI model's ability to produce accurate, relevant, and contextually appropriate responses while minimizing the potential for misunderstandings or errors.