ListPrompts
client.agents.listPrompts(AgentListPromptsParams { token, pageSize, filter, pagination } params, RequestOptionsoptions?): PromptsPage<Prompt { id, metadata, spec } >
POST/gitpod.v1.AgentService/ListPrompts
Lists all prompts matching the specified criteria.
Use this method to find and browse prompts across your organization. Results are ordered by their creation time with the newest first.
Examples
-
List all prompts:
Retrieves all prompts with pagination.
pagination: pageSize: 10
ListPrompts
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const prompt of client.agents.listPrompts({ pagination: { pageSize: 10 } })) {
console.log(prompt.id);
}{
"pagination": {
"nextToken": "nextToken"
},
"prompts": [
{
"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
{
"pagination": {
"nextToken": "nextToken"
},
"prompts": [
{
"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"
}
}
]
}