Generation and Evaluation
Find your optimized system prompt automatically
Last updated
Find your optimized system prompt automatically
Last updated
Given shadow traffic of inputs you expect your system to handle, Farsight will automatically generate your use case information and iteratively generate and converge to an optimal system prompt.
Make sure you have your OpenAI API Key before you begin.
Best Prompt
get_best_system_prompts()
Generates, evaluates, and iteratively improves system prompts to produce the optimized system prompt based our your shadow traffic.
Not happy with your results? Set gpt_optimized=True
for better results utilizing gpt-4
for prompt generation calls although it increases some costs.
Param | Type | Description |
---|---|---|
Output Type | Output Definition |
---|---|
shadow_traffic
list[str]
list of shadow traffic inputs length must be greater or equal to 5
gpt_optimized
boolean
optional: if set to True, we optimized open-ai calls to generate the best prompts while minimizing costs. We use gpt-4 for num_iterations*num_prompts_per_iteration calls
num_prompts
int
optional: number of best prompts you would like to be returned (default: 3)
num_iterations
int
optional: number of total prompt optimizing iterations following the ORPO method (default: 3)
num_prompts_per_iteration
int
optional: number of prompts to be generated per iteration (default: 2)
num_inputs_to_test
int
optional: number of inputs to evaluate per generated prompt (default: 3)
rubric
str
optional: description of rubric, use our rubric development suggestions to easily create a rubric
reference_answer
str
optional: reference answer to insert into the prompt with a score of 5, use our rubric development suggestions to easily generate a reference answer
list[PromptEvaluation]
includes the top system prompts with the highest score of the generated prompts with all of the information in the PromptEvaluation object shown below.