GetPrompt
client.Agents.GetPrompt(ctx, body) (*AgentGetPromptResponse, error)
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
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"),
)
response, err := client.Agents.GetPrompt(context.TODO(), gitpod.AgentGetPromptParams{
PromptID: gitpod.F("07e03a28-65a5-4d98-b532-8ea67b188048"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", 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"
}
}
}