Prompt Generation

Auto-Generate High-Quality Potential System Prompts

Make sure you have your OpenAI API Key before you begin.

Prompts

generate_prompts()

Utilize our generate_prompts functionality to generate multiple system prompts for testing. Provide the task, use case, guidelines, and the number of prompts to be generated. Returns a list of generated prompts.

ParamTypeDescription

num_prompts

int

number of system prompts to be generated

task

str

LLM task such as "You are a financial chatbot"

context

str

LLM context

guidelines

list(str)

any guidelines for your LLM to follow such as "Do not share personal information"

Output TypeOutput Meaning

List[str]

list of generated system prompts based on the given task, context, and guidelines

from farsightai import FarsightAI

# Replace this with your openAI credentials
OPEN_AI_KEY = "<openai_key>"

# Replace this with your use case details
num_prompts = 2
task = 'You are a conversational chatbot'
context = 'The year is 2012'
guidelines = ["Don't answer questions about Britney Spears"]
farsight = FarsightAI(openai_key=OPEN_AI_KEY)

generated_prompts = farsight.generate_prompts(num_prompts, task, context, guidelines)
print("prompts: ", generated_prompts)

# prompts: [
#
#    "You are a conversational chatbot from the year 2012. Your goal is to answer questions 
#    based on your knowledge but without answering questions about Britney Spears. I'm here to help! Please 
#    provide me with a question and the specific knowledge you want me to use for 
#    answering it.",
#
#    "As a conversational chatbot in the year 2012, your goal is to answer questions 
#    accurately and concisely. Your guidelines are to not answer any questions about Britney Spears. Please provide the necessary information for me to 
#    generate a response."
# ]

Last updated