api

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 8 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 the Braintrust REST facade retained for compatibility. New REST integrations should use the public openapi package directly.

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 is the compatibility REST client for Braintrust. New REST resources are available through the public openapi package, not this facade.

Deprecated: Use openapi.Client or openapi.ClientWithResponses.

func NewClient deprecated

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).

Deprecated: Use openapi.NewClientWithResponses and configure bearer authentication with openapi.WithRequestEditorFn.

func NewWithHTTPSClient deprecated 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.

Deprecated: Use openapi.NewClientWithResponses with openapi.WithHTTPClient.

func (*API) Datasets deprecated

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

Datasets returns a client for dataset operations

Deprecated: Use the dataset operations on openapi.ClientWithResponses, such as openapi.ClientWithResponses.GetDatasetWithResponse.

func (*API) Experiments deprecated

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

Experiments is used to access the Experiments API

Deprecated: Use the experiment operations on openapi.ClientWithResponses, such as openapi.ClientWithResponses.GetExperimentWithResponse.

func (*API) Functions deprecated

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

Functions is used to access the Functions API

Deprecated: Use the function operations on openapi.ClientWithResponses, such as openapi.ClientWithResponses.GetFunctionWithResponse.

func (*API) GeneratedClient deprecated added in v0.19.0

func (a *API) GeneratedClient() *openapi.Client

GeneratedClient bridges compatibility APIs to generated REST operations while retaining this client's authentication, logging, and HTTP transport. A nil API or transport returns nil.

Deprecated: Construct new clients with openapi.NewClient or openapi.NewClientWithResponses. This bridge remains available to migrate callers that already hold an API.

func (*API) Projects deprecated

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

Projects returns a client for project operations

Deprecated: Use the project operations on openapi.ClientWithResponses, such as openapi.ClientWithResponses.GetProjectWithResponse.

func (*API) Prompts deprecated added in v0.13.0

func (a *API) Prompts() *prompts.API

Prompts returns a client for reading prompts

Deprecated: Use openapi.ClientWithResponses.GetPromptWithResponse or openapi.ClientWithResponses.GetPromptIdWithResponse. For renderable prompts, use braintrust.Client.LoadPrompt instead.

type Option deprecated

type Option func(*options)

Option configures an API client.

Deprecated: Use openapi.ClientOption when constructing a generated client.

func WithAPIURL deprecated

func WithAPIURL(url string) Option

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

Deprecated: Pass the server URL to openapi.NewClientWithResponses.

func WithLogger deprecated

func WithLogger(log logger.Logger) Option

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

Deprecated: Configure a logging HTTP transport with openapi.WithHTTPClient.

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.
Package prompts provides read access to the prompts stored in Braintrust.
Package prompts provides read access to the prompts stored in Braintrust.

Jump to

Keyboard shortcuts

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