Documentation
¶
Overview ¶
Package prompts provides read access to the prompts stored in Braintrust.
New integrations should use github.com/braintrustdata/braintrust-sdk-go/openapi for REST operations, or braintrust.Client.LoadPrompt for renderable prompts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API
deprecated
type API struct {
// contains filtered or unexported fields
}
API provides methods for reading prompts.
Deprecated: Use openapi.Client or openapi.ClientWithResponses.
func New
deprecated
New creates a new prompts API client.
Deprecated: Use openapi.NewClientWithResponses.
func (*API) Get
deprecated
Get returns a single prompt by ID. Version and Environment are optional; a pinned version wins over an environment.
Deprecated: Use openapi.ClientWithResponses.GetPromptIdWithResponse, or braintrust.Client.LoadPrompt to fetch and render a prompt.
func (*API) Query
deprecated
Query searches for prompts matching params.
Deprecated: Use openapi.ClientWithResponses.GetPromptWithResponse, or braintrust.Client.LoadPrompt to fetch and render a prompt.
type Prompt ¶
type Prompt struct {
ID string `json:"id"`
ProjectID string `json:"project_id"`
XactID string `json:"_xact_id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description,omitempty"`
PromptData json.RawMessage `json:"prompt_data"`
Tags []string `json:"tags,omitempty"`
}
Prompt is a prompt row as Braintrust stores it.
PromptData is left as raw JSON so that this package stays pure transport: the prompt package decodes it into a renderable prompt. Keeping the dependency pointing that way means the prompt package can use this one.
type QueryParams ¶
type QueryParams struct {
// Project identity (either/or).
ProjectName string
ProjectID string
// Slug filters by prompt slug.
Slug string
// Version pins to a specific prompt version.
Version string
// Environment loads the prompt deployed to an environment (dev, staging,
// production). Ignored when Version is set.
Environment string
// Limit caps the number of results.
Limit int
}
QueryParams selects which prompts to return.