ListPrompts
client.Agents.ListPrompts(ctx, params) (*PromptsPage[Prompt], error)
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
package main
import (
"context"
"fmt"
"github.com/gitpod-io/gitpod-sdk-go"
"github.com/gitpod-io/gitpod-sdk-go/option"
)
func main() {
client := gitpod.NewClient(
option.WithBearerToken("My Bearer Token"),
)
page, err := client.Agents.ListPrompts(context.TODO(), gitpod.AgentListPromptsParams{
Pagination: gitpod.F(gitpod.AgentListPromptsParamsPagination{
PageSize: gitpod.F(int64(10)),
}),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
{
"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"
}
}
]
}