run_few_shot_optimization
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt_to_optimize": "<prompt_to_optimize>",
"example_path": "<example_path>",
"method": "<method>"
},
"name": "run_few_shot_optimization"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | Yes | ||
| example_path | Yes | ||
| prompt_to_optimize | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |