api

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api provides a client for interacting with the Braintrust API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API is the main API client for Braintrust.

func NewClient

func NewClient(apiKey string, opts ...Option) *API

NewClient creates a new Braintrust API client with the given API key and options. The apiKey must be non-empty (validated at config level).

func NewWithHTTPSClient added in v0.1.0

func NewWithHTTPSClient(client *https.Client) *API

NewWithHTTPSClient creates a new Braintrust API client with the given https.Client. This is useful for tests that want to use a custom or VCR-wrapped client.

func (*API) Datasets

func (a *API) Datasets() *datasets.API

Datasets returns a client for dataset operations

func (*API) Experiments

func (a *API) Experiments() *experiments.API

Experiments is used to access the Experiments API

func (*API) Functions

func (a *API) Functions() *functions.API

Functions is used to access the Functions API

func (*API) Projects

func (a *API) Projects() *projects.API

Projects returns a client for project operations

type Option

type Option func(*options)

Option configures an API client.

func WithAPIURL

func WithAPIURL(url string) Option

WithAPIURL sets the API URL for the client. If not provided, defaults to "https://api.braintrust.dev".

func WithLogger

func WithLogger(log logger.Logger) Option

WithLogger sets a custom logger for the client. If not provided, no logging will occur.

Directories

Path Synopsis
Package datasets provides operations for managing Braintrust datasets.
Package datasets provides operations for managing Braintrust datasets.
Package experiments provides operations for managing Braintrust experiments.
Package experiments provides operations for managing Braintrust experiments.
Package functions provides operations for managing Braintrust functions (prompts, tools, scorers).
Package functions provides operations for managing Braintrust functions (prompts, tools, scorers).
Package projects provides operations for managing Braintrust projects.
Package projects provides operations for managing Braintrust projects.

Jump to

Keyboard shortcuts

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