-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add experiment logging support for BrainTrust #49
Open
ankrgyl
wants to merge
9
commits into
main
Choose a base branch
from
ankrgyl/braintrust
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3f0e6b1
Show duration and cost in UI
gogwilt 1d28682
Add initial braintrust support
ankrgyl a1cb280
Improve UX
ankrgyl 02c68f8
Update deps to global braintrust
ankrgyl f760bf7
Unset braintrust api summary if key unset
ankrgyl 7fdb6f7
Fix build
ankrgyl 5764c7e
Merge branch 'main' into ankrgyl/braintrust
abrenneke e9d6ea9
Merge branch 'main' into ankrgyl/braintrust
abrenneke f1942f7
WIP trivet plugin infra
abrenneke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-1.38 MB
.yarn/cache/@atlaskit-primitives-npm-1.0.8-efb5c38a4f-903765494b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.04 KB
.yarn/cache/@kwsites-promise-deferred-npm-1.1.1-82db04bcea-d8eab06cdd.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+46.7 KB
...etch-npm-2.6.11-160e4174c3-3e7af7c002.zip → ...etch-npm-2.6.12-48619ce9d6-9db93926c2.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+50.3 KB
.../tar-npm-6.1.13-3234e72781-b1254685cb.zip → .../tar-npm-6.1.15-44c3e71720-815c25f881.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,14 @@ | ||
import { plugins } from '@ironclad/rivet-core'; | ||
import { orderBy } from 'lodash-es'; | ||
|
||
const builtInPlugins = orderBy( | ||
[ | ||
{ | ||
label: 'Anthropic', | ||
value: 'anthropic', | ||
}, | ||
{ | ||
label: 'AssemblyAI', | ||
value: 'assemblyAi', | ||
}, | ||
{ | ||
label: 'Autoevals', | ||
value: 'autoevals', | ||
}, | ||
] as const, | ||
const pluginOptions = orderBy( | ||
Object.entries(plugins).map(([id, plugin]) => ({ | ||
value: id, | ||
label: plugin.name ?? plugin.id, | ||
})), | ||
'label', | ||
); | ||
|
||
export function useBuiltInPlugins() { | ||
return builtInPlugins; | ||
return pluginOptions; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { BuiltInPluginID } from '@ironclad/rivet-core'; | ||
import { useDependsOnPlugins } from './useDependsOnPlugins'; | ||
|
||
export function useIsPluginEnabled(plugin: BuiltInPluginID): boolean { | ||
const plugins = useDependsOnPlugins(); | ||
|
||
return plugins.some((p) => p.id === plugin); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { BTExperimentSummary } from '@ironclad/trivet'; | ||
import { atom } from 'recoil'; | ||
|
||
export type BraintrustSummariesState = { | ||
brainTrustSummaries?: Record<string, BTExperimentSummary>; | ||
}; | ||
|
||
export const braintrustSummariesState = atom<BraintrustSummariesState>({ | ||
key: 'braintrustSummariesState', | ||
default: {}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import anthropicPlugin from './plugins/anthropic/index.js'; | ||
import autoevalsPlugin from './plugins/autoevals/index.js'; | ||
import assemblyAiPlugin from './plugins/assemblyAi/index.js'; | ||
import { braintrustPlugin } from './plugins/braintrust/plugin.js'; | ||
|
||
export { anthropicPlugin, autoevalsPlugin, assemblyAiPlugin }; | ||
export { anthropicPlugin, autoevalsPlugin, assemblyAiPlugin, braintrustPlugin }; | ||
|
||
export const plugins = { | ||
anthropic: anthropicPlugin, | ||
autoevals: autoevalsPlugin, | ||
assemblyAi: assemblyAiPlugin, | ||
braintrust: braintrustPlugin, | ||
}; | ||
|
||
export type BuiltInPluginID = keyof typeof plugins; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { RivetPlugin } from '../../index.js'; | ||
|
||
export const braintrustPlugin: RivetPlugin = { | ||
id: 'braintrust', | ||
name: 'Braintrust', | ||
|
||
configSpec: { | ||
braintrustApiKey: { | ||
type: 'secret', | ||
label: 'Braintrust API Key', | ||
description: 'API key for Braintrust', | ||
pullEnvironmentVariable: 'BRAINTRUST_API_KEY', | ||
helperText: 'Alternatively, set the BRAINTRUST_API_KEY environment variable', | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the WIP section?