Loading...
Loading...
Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.
npx skill4agent add google/skills agent-platform-prompt-managementgcloud auth login
gcloud auth application-default loginpython3 -m venv ~/prompt_agent_venv
source ~/prompt_agent_venv/bin/activatepip install google-cloud-aiplatform google-genai[!TIP] Placeholder Parameter Replacement: The Python scripts below use uppercase string placeholders (like,"PROJECT_ID", and"LOCATION_ID"). You MUST dynamically replace these placeholders with the actual Project ID, Region, and Prompt ID values provided in the user's prompt (or discovered context) before generating or providing the scripts."PROMPT_ID"
Promptfrom vertexai.preview import prompts
all_prompts = prompts.list()
for p in all_prompts:
print(f"Name: {p.display_name}, ID: {p.name}")from vertexai.preview import prompts
retrieved_prompt = prompts.get(prompt_id="projects/PROJECT_ID/locations/LOCATION_ID/prompts/PROMPT_ID")
# Versions are supported: prompts.get(prompt_id=..., version_id="2")
# Assemble with variables
assembled = retrieved_prompt.assemble(text="The quick brown fox...")
print(assembled)projects/PROJECT_ID/locations/LOCATION_ID/prompts/PROMPT_ID[!IMPORTANT] NEVER pre-emptively provide or execute any deletion code before receiving the user's response in a new turn. You must never speculate or assume that confirmation will be given. Asking for confirmation and providing the code in a single parallel turn is a severe safety violation.
from vertexai.preview import prompts
# Always use full resource name
resource_name = "projects/PROJECT_ID/locations/LOCATION_ID/prompts/PROMPT_ID"
prompts.delete(prompt_id=resource_name)gemini-2.5-prometadata_schema_urimetadata