Full name: projects.locations.tuningJobs.optimizePrompt
Optimizes a prompt.
Given a prompt, this method returns a stream of optimized prompts expanded from the original prompt.
Endpoint
posthttps://aiplatform.googleapis.com/v1beta1/{parent}/tuningJobs:optimizePrompt
Path parameters
parentstring
Required. The resource name of the location to optimize the prompt in. Format: projects/{project}/locations/{location}
Request body
The request body contains data with the following structure:
Required. The content of the prompt to optimize.
Optional. The optimization strategy to use.
Response body
Response message for GenAiTuningService.OptimizePrompt
If successful, the response body contains data with the following structure:
Output only. The optimized prompt.
| JSON representation |
|---|
{
"content": {
object ( |
OptimizationTarget
The optimization strategy to use.
| Enums | |
|---|---|
OPTIMIZATION_TARGET_UNSPECIFIED |
Unspecified optimization target. Defaults to OPTIMIZATION_TARGET_GENERAL. |
OPTIMIZATION_TARGET_GENERAL |
Optimizes the prompt for quality using a zero-shot approach. |
OPTIMIZATION_TARGET_GEMINI_NANO |
Optimizes the prompt for Gemini Nano models. |
OPTIMIZATION_TARGET_FEW_SHOT_RUBRICS |
Optimizes the prompt using few-shot examples with rubrics. |
OPTIMIZATION_TARGET_FEW_SHOT_TARGET_RESPONSE |
Optimizes the prompt using few-shot examples with a target response. |