Package dev.braintrust.api
Interface BraintrustApiClient
- All Known Implementing Classes:
BraintrustApiClient.HttpImpl
Deprecated.
Deprecated. Please use
BraintrustOpenApiClient instead-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordDeprecated.Request body for BTQL queries.static final recordDeprecated.Response from a BTQL query.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.Represents a Braintrust function (scorer, prompt, tool, or task).static final recordDeprecated.Request body for invoking a function.static final recordDeprecated.static classDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated.static final recordDeprecated. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Execute a BTQL (Braintrust Query Language) query.fetchDatasetEvents(String datasetId, BraintrustApiClient.DatasetFetchRequest request) Deprecated.Fetch dataset events with paginationgetDataset(String datasetId) Deprecated.Get dataset metadata by IDgetFunction(String projectName, String slug, String version) Deprecated.Get a function by project name and slug, with optional version.getFunctionById(String functionId) Deprecated.Get a function by its ID.Deprecated.Creates an experiment.getOrCreateProject(String projectName) Deprecated.Creates or gets a project by name.Deprecated.Get project and org info for the given config.getProject(String projectId) Deprecated.Gets a project by ID.Deprecated.Get project and org info for the default project IDgetProjectAndOrgInfo(String projectId) Deprecated.Get project and org info for the given project IDDeprecated.Get a prompt by slug and optional versioninvokeFunction(String functionId, BraintrustApiClient.FunctionInvokeRequest request) Deprecated.Invoke a function (scorer, prompt, or tool) by its ID.listExperiments(String projectId) Deprecated.Lists experiments for a project.login()Deprecated.Attempt Braintrust loginstatic BraintrustApiClientof(BraintrustConfig config) Deprecated.Deprecated.queryDatasets(String projectName, String datasetName) Deprecated.Query datasets by project name and dataset name
-
Method Details
-
openApiClient
Deprecated.Create an openapi client with the same api key as this one.Convenience method for migrating to the new client. It's recommended to not use this method and simply migrate to the new BraintrustOpenApiClient
-
login
Deprecated.Attempt Braintrust login- Returns:
- LoginResponse containing organization info
- Throws:
LoginException- if login fails due to invalid credentials or network errors
-
getOrCreateProject
Deprecated.Creates or gets a project by name. -
getProject
Deprecated.Gets a project by ID. -
getOrCreateExperiment
BraintrustApiClient.Experiment getOrCreateExperiment(BraintrustApiClient.CreateExperimentRequest request) Deprecated.Creates an experiment. -
listExperiments
Deprecated.Lists experiments for a project. -
getProjectAndOrgInfo
Optional<BraintrustApiClient.OrganizationAndProjectInfo> getProjectAndOrgInfo()Deprecated.Get project and org info for the default project ID -
getProjectAndOrgInfo
Deprecated.Get project and org info for the given project ID -
getOrCreateProjectAndOrgInfo
BraintrustApiClient.OrganizationAndProjectInfo getOrCreateProjectAndOrgInfo(BraintrustConfig config) Deprecated.Get project and org info for the given config. Creating them if necessary -
getPrompt
Optional<BraintrustApiClient.Prompt> getPrompt(@Nonnull String projectName, @Nonnull String slug, @Nullable String version) Deprecated.Get a prompt by slug and optional version -
fetchDatasetEvents
BraintrustApiClient.DatasetFetchResponse fetchDatasetEvents(String datasetId, BraintrustApiClient.DatasetFetchRequest request) Deprecated.Fetch dataset events with pagination -
getDataset
Deprecated.Get dataset metadata by ID -
queryDatasets
Deprecated.Query datasets by project name and dataset name -
getFunction
Optional<BraintrustApiClient.Function> getFunction(@Nonnull String projectName, @Nonnull String slug, @Nullable String version) Deprecated.Get a function by project name and slug, with optional version.- Parameters:
projectName- the name of the project containing the functionslug- the unique slug identifier for the functionversion- optional version identifier (transaction id or version string)- Returns:
- the function if found
-
getFunctionById
Deprecated.Get a function by its ID.- Parameters:
functionId- the ID of the function- Returns:
- the function if found
-
invokeFunction
Object invokeFunction(@Nonnull String functionId, @Nonnull BraintrustApiClient.FunctionInvokeRequest request) Deprecated.Invoke a function (scorer, prompt, or tool) by its ID.- Parameters:
functionId- the ID of the function to invokerequest- the invocation request containing input, expected output, etc.- Returns:
- the result of the function invocation
-
btqlQuery
Deprecated.Execute a BTQL (Braintrust Query Language) query. Supports both BTQL pipe syntax and standard SQL syntax.- Parameters:
query- the BTQL/SQL query string- Returns:
- the query result containing rows of data
-
of
Deprecated.
-