GetPrompt
client.agents.retrievePrompt(AgentRetrievePromptParams { promptId } body, RequestOptionsoptions?): AgentRetrievePromptResponse { prompt }
POST/gitpod.v1.AgentService/GetPrompt
Gets details about a specific prompt including name, description, and prompt content.
Use this method to:
- Retrieve prompt details for editing
- Get prompt content for execution
Examples
-
Get prompt details:
promptId: "07e03a28-65a5-4d98-b532-8ea67b188048"
GetPrompt
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const response = await client.agents.retrievePrompt({
promptId: '07e03a28-65a5-4d98-b532-8ea67b188048',
});
console.log(response.prompt);{
"prompt": {
"id": "id",
"metadata": {
"createdAt": "2019-12-27T18:11:19.117Z",
"creator": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"principal": "PRINCIPAL_UNSPECIFIED"
},
"description": "description",
"name": "name",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"updatedAt": "2019-12-27T18:11:19.117Z"
},
"spec": {
"command": "command",
"isCommand": true,
"isSkill": true,
"isTemplate": true,
"prompt": "prompt"
}
}
}Returns Examples
{
"prompt": {
"id": "id",
"metadata": {
"createdAt": "2019-12-27T18:11:19.117Z",
"creator": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"principal": "PRINCIPAL_UNSPECIFIED"
},
"description": "description",
"name": "name",
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"updatedAt": "2019-12-27T18:11:19.117Z"
},
"spec": {
"command": "command",
"isCommand": true,
"isSkill": true,
"isTemplate": true,
"prompt": "prompt"
}
}
}