1. Installation and Setup
Before proceeding with optimization, ensure that the Future AGI SDK is installed and properly configured with your API credentials. Installation2. Creating a Dataset
Optimization requires a structured dataset that serves as input for generating and refining AI responses. If you don’t have a dataset yet, follow these steps to create one.Initialize the Dataset Instance
TheDataset
class manages dataset creation and operations. First, define the dataset properties:
Creating a Dataset from a File
If you have a dataset in a CSV, JSON, or Excel file, upload it:4. Running a Prompt on the Dataset
Before optimizing a prompt, you need to define a baseline prompt. This serves as the starting point for evaluation.-
add_run_prompt()
adds a new prompt to the dataset. -
messages
define how the AI is instructed, with{{value_proposition}}
acting as a placeholder for dataset values.
Click here to learn more about the
add_run_prompt()
function.5. Evaluating AI Responses
Once the prompt has been run, we need to measure how effective the responses are using evaluation metrics.add_evaluation()
attaches an evaluation metric to analyze responses."tone_analysis"
is the evaluation’s name."Tone"
is a preset evaluation template.Click here to read more about the eval templates available at Future AGI.input_column_name="summary_prompt"
means it evaluates responses generated by our prompt.save_as_template=True
saves this evaluation for reuse in other experiments.
6. Running Optimization
Optimization improves AI-generated responses by adjusting prompt structure based on evaluation feedback. This process systematically iterates through prompt variations to find the most effective version.add_optimization()
starts an optimization process."optimized_prompt_1"
assigns a name to the optimized prompt."summary_prompt"
specifies which prompt is being optimized.