Package dev.braintrust.api
Interface BraintrustApiClient
- All Known Implementing Classes:
BraintrustApiClient.HttpImpl,BraintrustApiClient.InMemoryImpl
public interface BraintrustApiClient
Provides the necessary API calls for the Braintrust SDK. Users of the SDK should favor using
Eval or BraintrustTracing-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic classstatic classImplementation for test doublingstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final recordstatic final record -
Method Summary
Modifier and TypeMethodDescriptionCreates an experiment.getOrCreateProject(String projectName) Creates or gets a project by name.Get project and org info for the given config.getProject(String projectId) Gets a project by ID.Get project and org info for the default project IDgetProjectAndOrgInfo(String projectId) Get project and org info for the given project IDGet a prompt by slug and optional versionstatic BraintrustApiClientof(BraintrustConfig config)
-
Method Details
-
getOrCreateProject
Creates or gets a project by name. -
getProject
Gets a project by ID. -
getOrCreateExperiment
BraintrustApiClient.Experiment getOrCreateExperiment(BraintrustApiClient.CreateExperimentRequest request) Creates an experiment. -
getProjectAndOrgInfo
Optional<BraintrustApiClient.OrganizationAndProjectInfo> getProjectAndOrgInfo()Get project and org info for the default project ID -
getProjectAndOrgInfo
Get project and org info for the given project ID -
getOrCreateProjectAndOrgInfo
BraintrustApiClient.OrganizationAndProjectInfo getOrCreateProjectAndOrgInfo(BraintrustConfig config) 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) Get a prompt by slug and optional version -
of
-