run_few_shot_optimization
Improves prompts by optimizing few-shot examples from a user-provided dataset, applying a specified method to match target responses or improve rubric scores.
Instructions
Applies few shot prompt optimization to a prompt using user provided dataset and method.
Args: prompt_to_optimize: The zero-based index of the prompt to improve. example_path: GCS path to the csv file containg few-shot examples method: The optimization method to use for few shot prompt improvement. The method should be one of the following: - TARGET_RESPONSE: Optimize the prompt to match the target response. - RUBRICS: Optimize the prompt to improve the rubrics scores.
Returns: Optimized prompt.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | ||
| example_path | Yes | ||
| prompt_to_optimize | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |