Documentation
¶
Overview ¶
Package api provides the Braintrust REST facade retained for compatibility. New REST integrations should use the public openapi package directly.
Index ¶
- type APIdeprecated
- func (a *API) Datasets() *datasets.APIdeprecated
- func (a *API) Experiments() *experiments.APIdeprecated
- func (a *API) Functions() *functions.APIdeprecated
- func (a *API) GeneratedClient() *openapi.Clientdeprecated
- func (a *API) Projects() *projects.APIdeprecated
- func (a *API) Prompts() *prompts.APIdeprecated
- type Optiondeprecated
- func WithAPIURL(url string) Optiondeprecated
- func WithLogger(log logger.Logger) Optiondeprecated
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
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
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
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
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
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
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
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
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
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. |