api

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

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