braintrust

package
v0.0.0-...-9f72101 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultPrompter

func SetDefaultPrompter(t *Prompter)

func WithPrompt

func WithPrompt(slug string) agent.Option

func WithPrompter

func WithPrompter(prompter *Prompter, slug string) agent.Option

Types

type Message

type Message struct {
	Role    Role
	Content string
}

type Metadata

type Metadata struct {
	AutoApproveTools []string `json:"auto_approve_tools,omitempty"`
	Betas            []string `json:"betas,omitempty"`
	Skills           []Skill  `json:"skills,omitempty"`
	Tools            []Tool   `json:"tools,omitempty"`
}

type Prompt

type Prompt struct {
	Name           string
	Description    string
	Version        string
	Model          string
	Messages       []Message
	Temperature    *float32
	MaxTokens      *int64
	TopP           *float32
	TopK           *int32
	UseCache       *bool
	ToolChoice     *string // "none", "auto", "required", "function"
	ToolFunction   *string
	ResponseFormat *Response
	Reasoning      *Reasoning
	Metadata       *Metadata
}

func Load

func Load(ctx context.Context, slug string) (*Prompt, error)

type Prompter

type Prompter struct {
	// contains filtered or unexported fields
}

func DefaultPrompter

func DefaultPrompter() *Prompter

func NewPrompter

func NewPrompter(cli braintrust.Client, project string) *Prompter

func (*Prompter) Load

func (p *Prompter) Load(ctx context.Context, slug string) (*Prompt, error)

type Reasoning

type Reasoning struct {
	Enabled *bool   `json:"enabled,omitempty"`
	Budget  *int64  `json:"budget,omitempty"`
	Effort  *string `json:"effort,omitempty"` // "low", "medium", "high" (OpenAI specific)
}

type Response

type Response struct {
	Type   string  `json:"type,omitempty"` // text, json_object, json_schema
	Schema *Schema `json:"schema,omitempty"`
}

type Role

type Role string
const (
	RoleSystem    Role = "system"
	RoleUser      Role = "user"
	RoleAssistant Role = "assistant"
)

type Schema

type Schema struct {
	Name        string          `json:"name,omitempty"`
	Description string          `json:"description,omitempty"`
	Schema      json.RawMessage `json:"schema,omitempty"`
	Strict      bool            `json:"strict,omitempty"`
}

type Skill

type Skill struct {
	ID      string `json:"id,omitempty"`
	Type    string `json:"type,omitempty"`
	Version string `json:"version,omitempty"`
}

type Tool

type Tool struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL