Skip to main content

Step 1: Install Required Libraries

Step 2: Set Up API Configuration

Step 3: Define Your Models

Define the input and output models for your task. Here we define the input and output models for the textual entailment task, which involves a premise and a hypothesis.

Step 4: Create a Function

Create a function that encapsulates the task’s objective, how the prompt is structured, and the expected inputs and outputs. In this case, we define a function for the textual entailment task.

Step 5: Create a Dataset

Create a dataset that includes the input and output examples for your function.

Step 6: Add Dataset Items to the Magic Dataset

Add input and output examples to the magic dataset.

Step 7: Configure an Optimizer

Configure an optimizer that optimizes the function using the magic dataset. In this case, we configure an optimizer that optimizes the textual entailment function using the magic dataset as the test, train, and validation dataset.

Step 8: Run the Optimizer

For running the optimizer, we use the Zenbase API.
And wait for the optimization to complete.

Step 9: Use the Optimized Function

Use the optimized function with any input and get the optimized output.

Step 10: Analyze the Results

After the optimization is complete, we can analyze the results. And also we can find the best few-shot examples that has been added to the prompt.