braintrust 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,111 @@
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>braintrust</title><meta name="description" content="Documentation for braintrust"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
2
+ <div class="tsd-toolbar-contents container">
3
+ <div class="table-cell" id="tsd-search" data-base=".">
4
+ <div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
5
+ <div class="field">
6
+ <div id="tsd-toolbar-links"></div></div>
7
+ <ul class="results">
8
+ <li class="state loading">Preparing search index...</li>
9
+ <li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">braintrust</a></div>
10
+ <div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
11
+ <div class="container container-main">
12
+ <div class="col-content">
13
+ <div class="tsd-page-title">
14
+ <h2>braintrust</h2></div>
15
+ <div class="tsd-panel tsd-typography"><a id="md:local-development" class="tsd-anchor"></a><h2><a href="#md:local-development">Local development</a></h2><a id="md:local-env-configuration" class="tsd-anchor"></a><h3><a href="#md:local-env-configuration">Local env configuration</a></h3><p>Copy development env file.</p>
16
+ <pre><code class="language-sh"><span class="hl-0">cd</span><span class="hl-1"> </span><span class="hl-2">./app</span><br/><span class="hl-0">cp</span><span class="hl-1"> </span><span class="hl-2">.env.development</span><span class="hl-1"> </span><span class="hl-2">.env.local</span>
17
+ </code><button>Copy</button></pre>
18
+ <a id="md:install-and-run-supabase" class="tsd-anchor"></a><h3><a href="#md:install-and-run-supabase">Install and run supabase</a></h3><pre><code class="language-sh"><span class="hl-0">cd</span><span class="hl-1"> </span><span class="hl-2">./app</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">install</span><br/><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">supabase</span><span class="hl-1"> </span><span class="hl-2">start</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">supabase</span><span class="hl-1"> </span><span class="hl-2">db</span><span class="hl-1"> </span><span class="hl-2">reset</span>
19
+ </code><button>Copy</button></pre>
20
+ <p>Supabase will spill out JWT secret, anon key, and service_role key—verify that they match values in .env file (they most likely do).</p>
21
+ <a id="md:start-frontend" class="tsd-anchor"></a><h3><a href="#md:start-frontend">Start frontend</a></h3><pre><code class="language-sh"><span class="hl-0">cd</span><span class="hl-1"> </span><span class="hl-2">./app</span><br/><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-2">run</span><span class="hl-1"> </span><span class="hl-2">dev</span>
22
+ </code><button>Copy</button></pre>
23
+ <a id="md:creating-a-user-account" class="tsd-anchor"></a><h3><a href="#md:creating-a-user-account">Creating a user account</a></h3><p>Running <code>supabase db reset</code> seeds the database with a default <code>braintrustdata.com</code> organization.</p>
24
+ <p>Open <a href="http://localhost:3000/app">http://localhost:3000/app</a> and sign in with test credentials: <code>ankur</code> / <code>ASDFasdf1!</code>. This will create a user record in supabase.</p>
25
+ <p>Open <a href="http://localhost:54323/project/default/editor">http://localhost:54323/project/default/editor</a> for Supabase table editor interface. Now we need to link new user to organization:</p>
26
+ <ol>
27
+ <li>Go to <code>organizations</code> table and save the organization&#39;s id.</li>
28
+ <li>Go to <code>users</code> table and save your user&#39;s id.</li>
29
+ <li>Go to <code>members</code> table and insert a row with <code>org_id</code> / <code>user_id</code> pair you saved.</li>
30
+ </ol>
31
+ <a id="md:run-api-server" class="tsd-anchor"></a><h3><a href="#md:run-api-server">Run API server</a></h3><p>Start database for API:</p>
32
+ <pre><code class="language-sh"><span class="hl-0">cd</span><span class="hl-1"> </span><span class="hl-2">./services</span><br/><span class="hl-0">docker</span><span class="hl-1"> </span><span class="hl-2">compose</span><span class="hl-1"> </span><span class="hl-2">up</span><span class="hl-1"> </span><span class="hl-3">-d</span>
33
+ </code><button>Copy</button></pre>
34
+ <p>Go to root directory, create and activate a Python virtual environment (or use <a href="https://direnv.net/">direnv</a> to do that for you):</p>
35
+ <pre><code class="language-sh"><span class="hl-0">python</span><span class="hl-1"> </span><span class="hl-3">-m</span><span class="hl-1"> </span><span class="hl-2">venv</span><span class="hl-1"> </span><span class="hl-2">./venv</span><br/><span class="hl-0">source</span><span class="hl-1"> </span><span class="hl-2">venv/bin/activate</span>
36
+ </code><button>Copy</button></pre>
37
+ <p>Install dependencies:</p>
38
+ <pre><code class="language-sh"><span class="hl-0">pip</span><span class="hl-1"> </span><span class="hl-2">install</span><span class="hl-1"> </span><span class="hl-3">-r</span><span class="hl-1"> </span><span class="hl-2">./requirements.txt</span><span class="hl-1"> </span><span class="hl-3">-r</span><span class="hl-1"> </span><span class="hl-2">./api/requirements.txt</span>
39
+ </code><button>Copy</button></pre>
40
+ <p>Start API server:</p>
41
+ <pre><code class="language-sh"><span class="hl-0">cd</span><span class="hl-1"> </span><span class="hl-2">api</span><br/><span class="hl-4">AWS_DEFAULT_REGION</span><span class="hl-1">=</span><span class="hl-2">us-west-2</span><span class="hl-1"> </span><span class="hl-0">chalice</span><span class="hl-1"> </span><span class="hl-2">local</span>
42
+ </code><button>Copy</button></pre>
43
+ <a id="md:running-example" class="tsd-anchor"></a><h3><a href="#md:running-example">Running example</a></h3><p>Clone <a href="https://github.com/braintrustdata/bt-demo">bt-demo</a>:</p>
44
+ <pre><code class="language-sh"><span class="hl-0">cd</span><span class="hl-1"> </span><span class="hl-2">..</span><br/><span class="hl-0">git</span><span class="hl-1"> </span><span class="hl-2">clone</span><span class="hl-1"> </span><span class="hl-2">git@github.com:braintrustdata/bt-demo.git</span><br/><span class="hl-0">cd</span><span class="hl-1"> </span><span class="hl-2">bt-demo</span>
45
+ </code><button>Copy</button></pre>
46
+ <p>Create a python virtual env for bt-demo (or use direnv):</p>
47
+ <pre><code class="language-sh"><span class="hl-0">python</span><span class="hl-1"> </span><span class="hl-3">-m</span><span class="hl-1"> </span><span class="hl-2">venv</span><span class="hl-1"> </span><span class="hl-2">./venv</span><br/><span class="hl-0">source</span><span class="hl-1"> </span><span class="hl-2">venv/bin/activate</span>
48
+ </code><button>Copy</button></pre>
49
+ <p>Install dependencies:</p>
50
+ <pre><code class="language-sh"><span class="hl-0">pip</span><span class="hl-1"> </span><span class="hl-2">install</span><span class="hl-1"> </span><span class="hl-3">-r</span><span class="hl-1"> </span><span class="hl-2">requirements.txt</span><br/><span class="hl-0">pip</span><span class="hl-1"> </span><span class="hl-2">install</span><span class="hl-1"> </span><span class="hl-3">-e</span><span class="hl-1"> </span><span class="hl-2">../braintrust/sdk</span>
51
+ </code><button>Copy</button></pre>
52
+ <p>Run the demo:</p>
53
+ <pre><code class="language-sh"><span class="hl-4">BRAINTRUST_API_URL</span><span class="hl-1">=</span><span class="hl-2">http://localhost:3000</span><span class="hl-1"> </span><span class="hl-0">python3</span><span class="hl-1"> </span><span class="hl-2">./evaluate.py</span>
54
+ </code><button>Copy</button></pre>
55
+ <p>The demo will ask you for a token. Go to <a href="http://localhost:3000/app/token">http://localhost:3000/app/token</a> and copy-paste token into the app.</p>
56
+ <p>Now if you navigate to <a href="http://localhost:3000/app/braintrustdata.com/text2sql">http://localhost:3000/app/braintrustdata.com/text2sql</a>, you should see the results of experiment.</p>
57
+ <p><strong>Generating types</strong></p>
58
+ <pre><code class="language-sh"><span class="hl-0">supabase</span><span class="hl-1"> </span><span class="hl-2">gen</span><span class="hl-1"> </span><span class="hl-2">types</span><span class="hl-1"> </span><span class="hl-2">typescript</span><span class="hl-1"> </span><span class="hl-3">--db-url</span><span class="hl-1"> </span><span class="hl-2">postgresql://postgres:postgres@localhost:54322/postgres</span><span class="hl-1"> &gt; </span><span class="hl-2">lib/database.types.ts</span>
59
+ </code><button>Copy</button></pre>
60
+ <p>This is the command provided by the Supabase CLI to generate types for database.
61
+ Make sure you have the Supabase CLI installed and that database is running.
62
+ This command will generate the TypeScript types for Supabase tables and update them in the lib/database.types.ts file.</p>
63
+ <p><code>types.ts</code> file created to define custom TypeScript types for specific tables in database.
64
+ After generating the types, in the types.ts file, update the custom types (Project, Experiment, and Organization) based on the newly generated types.</p>
65
+ </div></div>
66
+ <div class="col-sidebar">
67
+ <div class="page-menu">
68
+ <div class="tsd-navigation settings">
69
+ <details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
70
+ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)" id="icon-chevronDown"></path></svg>Settings</h3></summary>
71
+ <div class="tsd-accordion-details">
72
+ <div class="tsd-filter-visibility">
73
+ <h4 class="uppercase">Member Visibility</h4><form>
74
+ <ul id="tsd-filter-options">
75
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
76
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
77
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
78
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
79
+ <div class="tsd-theme-toggle">
80
+ <h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
81
+ <details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary">
82
+ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>On This Page</h3></summary>
83
+ <div class="tsd-accordion-details">
84
+ <ul>
85
+ <li>
86
+ <ul>
87
+ <li><a href="#md:local-development"><span>Local development</span></a></li>
88
+ <li>
89
+ <ul>
90
+ <li><a href="#md:local-env-configuration"><span>Local env configuration</span></a></li>
91
+ <li>
92
+ <ul>
93
+ <li><a href="#md:install-and-run-supabase"><span>Install and run supabase</span></a></li>
94
+ <li><a href="#md:start-frontend"><span>Start frontend</span></a></li>
95
+ <li><a href="#md:creating-a-user-account"><span>Creating a user account</span></a></li>
96
+ <li><a href="#md:run-api-server"><span>Run API server</span></a></li>
97
+ <li><a href="#md:running-example"><span>Running example</span></a></li></ul></li></ul></li></ul></li></ul></div></details></div>
98
+ <div class="site-menu">
99
+ <nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>braintrust</span></a>
100
+ <ul class="tsd-small-nested-navigation">
101
+ <li><a href="classes/Experiment.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>Experiment</span></a></li>
102
+ <li><a href="classes/HTTPConnection.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>HTTPConnection</span></a></li>
103
+ <li><a href="interfaces/Project.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>Project</span></a></li>
104
+ <li><a href="functions/init.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>init</span></a></li>
105
+ <li><a href="functions/initProject.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>init<wbr/>Project</span></a></li>
106
+ <li><a href="functions/log.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>log</span></a></li>
107
+ <li><a href="functions/login.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>login</span></a></li>
108
+ <li><a href="functions/summarize.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>summarize</span></a></li></ul></nav></div></div></div>
109
+ <div class="tsd-generator">
110
+ <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
111
+ <div class="overlay"></div></body></html>
@@ -0,0 +1,87 @@
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Project | braintrust</title><meta name="description" content="Documentation for braintrust"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
2
+ <div class="tsd-toolbar-contents container">
3
+ <div class="table-cell" id="tsd-search" data-base="..">
4
+ <div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
5
+ <div class="field">
6
+ <div id="tsd-toolbar-links"></div></div>
7
+ <ul class="results">
8
+ <li class="state loading">Preparing search index...</li>
9
+ <li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">braintrust</a></div>
10
+ <div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
11
+ <div class="container container-main">
12
+ <div class="col-content">
13
+ <div class="tsd-page-title">
14
+ <ul class="tsd-breadcrumb">
15
+ <li><a href="../modules.html">braintrust</a></li>
16
+ <li><a href="Project.html">Project</a></li></ul>
17
+ <h1>Interface Project</h1></div>
18
+ <section class="tsd-panel tsd-hierarchy">
19
+ <h4>Hierarchy</h4>
20
+ <ul class="tsd-hierarchy">
21
+ <li><span class="target">Project</span></li></ul></section><aside class="tsd-sources">
22
+ <ul>
23
+ <li>Defined in <a href="https://github.com/braintrustdata/braintrust/blob/bbd0243/sdk-js/src/index.ts#L124">index.ts:124</a></li></ul></aside>
24
+ <section class="tsd-panel-group tsd-index-group">
25
+ <section class="tsd-panel tsd-index-panel">
26
+ <details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
27
+ <h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex=0><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></svg> Index</h5></summary>
28
+ <div class="tsd-accordion-details">
29
+ <section class="tsd-index-section">
30
+ <h3 class="tsd-index-heading">Properties</h3>
31
+ <div class="tsd-index-list"><a href="Project.html#id" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g></svg><span>id</span></a>
32
+ <a href="Project.html#name" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>name</span></a>
33
+ <a href="Project.html#org_id" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>org_<wbr/>id</span></a>
34
+ </div></section></div></details></section></section>
35
+ <section class="tsd-panel-group tsd-member-group">
36
+ <h2>Properties</h2>
37
+ <section class="tsd-panel tsd-member"><a id="id" class="tsd-anchor"></a>
38
+ <h3 class="tsd-anchor-link"><span>id</span><a href="#id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" id="icon-anchor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></svg></a></h3>
39
+ <div class="tsd-signature"><span class="tsd-kind-property">id</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
40
+ <ul>
41
+ <li>Defined in <a href="https://github.com/braintrustdata/braintrust/blob/bbd0243/sdk-js/src/index.ts#L126">index.ts:126</a></li></ul></aside></section>
42
+ <section class="tsd-panel tsd-member"><a id="name" class="tsd-anchor"></a>
43
+ <h3 class="tsd-anchor-link"><span>name</span><a href="#name" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
44
+ <div class="tsd-signature"><span class="tsd-kind-property">name</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
45
+ <ul>
46
+ <li>Defined in <a href="https://github.com/braintrustdata/braintrust/blob/bbd0243/sdk-js/src/index.ts#L125">index.ts:125</a></li></ul></aside></section>
47
+ <section class="tsd-panel tsd-member"><a id="org_id" class="tsd-anchor"></a>
48
+ <h3 class="tsd-anchor-link"><span>org_<wbr/>id</span><a href="#org_id" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
49
+ <div class="tsd-signature"><span class="tsd-kind-property">org_<wbr/>id</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources">
50
+ <ul>
51
+ <li>Defined in <a href="https://github.com/braintrustdata/braintrust/blob/bbd0243/sdk-js/src/index.ts#L127">index.ts:127</a></li></ul></aside></section></section></div>
52
+ <div class="col-sidebar">
53
+ <div class="page-menu">
54
+ <div class="tsd-navigation settings">
55
+ <details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
56
+ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)" id="icon-chevronDown"></path></svg>Settings</h3></summary>
57
+ <div class="tsd-accordion-details">
58
+ <div class="tsd-filter-visibility">
59
+ <h4 class="uppercase">Member Visibility</h4><form>
60
+ <ul id="tsd-filter-options">
61
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
62
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
63
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
64
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
65
+ <div class="tsd-theme-toggle">
66
+ <h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
67
+ <details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary">
68
+ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>On This Page</h3></summary>
69
+ <div class="tsd-accordion-details">
70
+ <ul>
71
+ <li><a href="#id" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>id</span></a></li>
72
+ <li><a href="#name" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>name</span></a></li>
73
+ <li><a href="#org_id" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>org_<wbr/>id</span></a></li></ul></div></details></div>
74
+ <div class="site-menu">
75
+ <nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>braintrust</span></a>
76
+ <ul class="tsd-small-nested-navigation">
77
+ <li><a href="../classes/Experiment.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>Experiment</span></a></li>
78
+ <li><a href="../classes/HTTPConnection.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>HTTPConnection</span></a></li>
79
+ <li><a href="Project.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>Project</span></a></li>
80
+ <li><a href="../functions/init.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>init</span></a></li>
81
+ <li><a href="../functions/initProject.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>init<wbr/>Project</span></a></li>
82
+ <li><a href="../functions/log.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>log</span></a></li>
83
+ <li><a href="../functions/login.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>login</span></a></li>
84
+ <li><a href="../functions/summarize.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>summarize</span></a></li></ul></nav></div></div></div>
85
+ <div class="tsd-generator">
86
+ <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
87
+ <div class="overlay"></div></body></html>
@@ -0,0 +1,63 @@
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>braintrust</title><meta name="description" content="Documentation for braintrust"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script defer src="assets/main.js"></script><script async src="assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
2
+ <div class="tsd-toolbar-contents container">
3
+ <div class="table-cell" id="tsd-search" data-base=".">
4
+ <div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
5
+ <div class="field">
6
+ <div id="tsd-toolbar-links"></div></div>
7
+ <ul class="results">
8
+ <li class="state loading">Preparing search index...</li>
9
+ <li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">braintrust</a></div>
10
+ <div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
11
+ <div class="container container-main">
12
+ <div class="col-content">
13
+ <div class="tsd-page-title">
14
+ <h2>braintrust</h2></div>
15
+ <section class="tsd-panel-group tsd-index-group">
16
+ <section class="tsd-panel tsd-index-panel">
17
+ <h3 class="tsd-index-heading uppercase">Index</h3>
18
+ <section class="tsd-index-section">
19
+ <h3 class="tsd-index-heading">Classes</h3>
20
+ <div class="tsd-index-list"><a href="classes/Experiment.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>Experiment</span></a>
21
+ <a href="classes/HTTPConnection.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>HTTPConnection</span></a>
22
+ </div></section>
23
+ <section class="tsd-index-section">
24
+ <h3 class="tsd-index-heading">Interfaces</h3>
25
+ <div class="tsd-index-list"><a href="interfaces/Project.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>Project</span></a>
26
+ </div></section>
27
+ <section class="tsd-index-section">
28
+ <h3 class="tsd-index-heading">Functions</h3>
29
+ <div class="tsd-index-list"><a href="functions/init.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>init</span></a>
30
+ <a href="functions/initProject.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>init<wbr/>Project</span></a>
31
+ <a href="functions/log.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>log</span></a>
32
+ <a href="functions/login.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>login</span></a>
33
+ <a href="functions/summarize.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>summarize</span></a>
34
+ </div></section></section></section></div>
35
+ <div class="col-sidebar">
36
+ <div class="page-menu">
37
+ <div class="tsd-navigation settings">
38
+ <details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
39
+ <h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)" id="icon-chevronDown"></path></svg>Settings</h3></summary>
40
+ <div class="tsd-accordion-details">
41
+ <div class="tsd-filter-visibility">
42
+ <h4 class="uppercase">Member Visibility</h4><form>
43
+ <ul id="tsd-filter-options">
44
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
45
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
46
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
47
+ <li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
48
+ <div class="tsd-theme-toggle">
49
+ <h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div>
50
+ <div class="site-menu">
51
+ <nav class="tsd-navigation"><a href="modules.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>braintrust</span></a>
52
+ <ul class="tsd-small-nested-navigation">
53
+ <li><a href="classes/Experiment.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Experiment</span></a></li>
54
+ <li><a href="classes/HTTPConnection.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>HTTPConnection</span></a></li>
55
+ <li><a href="interfaces/Project.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Project</span></a></li>
56
+ <li><a href="functions/init.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>init</span></a></li>
57
+ <li><a href="functions/initProject.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>init<wbr/>Project</span></a></li>
58
+ <li><a href="functions/log.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>log</span></a></li>
59
+ <li><a href="functions/login.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>login</span></a></li>
60
+ <li><a href="functions/summarize.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-64"></use></svg><span>summarize</span></a></li></ul></nav></div></div></div>
61
+ <div class="tsd-generator">
62
+ <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
63
+ <div class="overlay"></div></body></html>
package/package.json CHANGED
@@ -1,15 +1,26 @@
1
1
  {
2
2
  "name": "braintrust",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "SDK for integrating BrainTrust",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "build": "tsc",
8
+ "watch": "tsc --watch",
9
+ "docs": "npx typedoc --plugin typedoc-plugin-markdown --out ../app/pages/docs/libs/js src/index.ts --publicPath /docs/libs/js/ --githubPages false --disableSources true --hideInPageTOC true",
8
10
  "test": "jest"
9
11
  },
10
12
  "author": "",
11
13
  "license": "MIT",
12
14
  "devDependencies": {
15
+ "@types/uuid": "^9.0.2",
16
+ "typedoc": "^0.24.8",
17
+ "typedoc-plugin-markdown": "^3.15.3",
13
18
  "typescript": "^5.1.6"
19
+ },
20
+ "dependencies": {
21
+ "@types/axios": "^0.14.0",
22
+ "@types/node": "^20.4.1",
23
+ "axios": "^1.4.0",
24
+ "uuid": "^9.0.0"
14
25
  }
15
26
  }
package/src/index.ts DELETED
@@ -1,112 +0,0 @@
1
- /**
2
- * Log in, and then initialize a new experiment in a specified project. If the project does not exist, it will be created.
3
- *
4
- * @param project The name of the project to create the experiment in.
5
- * @param options
6
- * @param options.experiment The name of the experiment to create. If not specified, a name will be generated automatically.
7
- * @param options.description An optional description of the experiment.
8
- * @param options.base_experiment An optional experiment name to use as a base. If specified, the new experiment will be summarized and compared to this
9
- * experiment. Otherwise, it will pick an experiment by finding the closest ancestor on the default (e.g. main) branch.
10
- * @param options.api_url The URL of the BrainTrust API. Defaults to https://www.braintrustdata.com.
11
- * @param options.api_key The API key to use. If the parameter is not specified, will try to use the `BRAINTRUST_API_KEY` environment variable. If no API
12
- * key is specified, will prompt the user to login.
13
- * @param options.org_name (Optional) The name of a specific organization to connect to. This is useful if you belong to multiple.
14
- * @param options.disable_cache Do not use cached login information.
15
- * @returns The experiment object.
16
- */
17
-
18
- export function init(
19
- project: string,
20
- {
21
- experiment,
22
- }: {
23
- readonly experiment?: string;
24
- readonly description?: string;
25
- readonly base_experiment?: string;
26
- readonly api_url?: string;
27
- readonly api_key?: string;
28
- readonly org_name?: string;
29
- readonly disable_cache?: boolean;
30
- }
31
- ) {
32
- // TODO
33
- return new Experiment(project);
34
- }
35
-
36
- export class Experiment {
37
- private _project: string;
38
-
39
- constructor(project: string) {
40
- this._project = project;
41
- }
42
-
43
- get project() {
44
- return this._project;
45
- }
46
-
47
- /**
48
- * Log a single event to the experiment. The event will be batched and uploaded behind the scenes.
49
- *
50
- * @param values
51
- * @param values.inputs The arguments that uniquely define a test case (an arbitrary, JSON serializable object). Later on,
52
- * BrainTrust will use the `inputs` to know whether two test casess are the same between experiments, so they should
53
- * not contain experiment-specific state. A simple rule of thumb is that if you run the same experiment twice, the
54
- * `inputs` should be identical.
55
- * @param values.output The output of your application, including post-processing (an arbitrary, JSON serializable object),
56
- * that allows you to determine whether the result is correct or not. For example, in an app that generates SQL queries,
57
- * the `output` should be the _result_ of the SQL query generated by the model, not the query itself, because there may
58
- * be multiple valid queries that answer a single question.
59
- * @param values.expected The ground truth value (an arbitrary, JSON serializable object) that you'd compare to `output` to
60
- * determine if your `output` value is correct or not. BrainTrust currently does not compare `output` to `expected` for
61
- * you, since there are so many different ways to do that correctly. Instead, these values are just used to help you
62
- * navigate your experiments while digging into analyses. However, we may later use these values to re-score outputs or
63
- * fine-tune your models.
64
- * @param values.scores A dictionary of numeric values (between 0 and 1) to log. The scores should give you a variety of signals
65
- * that help you determine how accurate the outputs are compared to what you expect and diagnose failures. For example, a
66
- * summarization app might have one score that tells you how accurate the summary is, and another that measures the word similarity
67
- * between the generated and grouth truth summary. The word similarity score could help you determine whether the summarization was
68
- * covering similar concepts or not. You can use these scores to help you sort, filter, and compare experiments.
69
- * @param values.metadata (Optional) a dictionary with additional data about the test example, model outputs, or just
70
- * about anything else that's relevant, that you can use to help find and analyze examples later. For example, you could log the
71
- * `prompt`, example's `id`, or anything else that would be useful to slice/dice later. The values in `metadata` can be any
72
- * JSON-serializable type, but its keys must be strings.
73
- * @returns The `id` of the logged event.
74
- */
75
- log({
76
- inputs,
77
- output,
78
- expected,
79
- scores,
80
- metadata,
81
- }: {
82
- readonly inputs: unknown;
83
- readonly output: unknown;
84
- readonly expected: unknown;
85
- readonly scores: Record<string, number>;
86
- readonly metadata?: Record<string, unknown>;
87
- }): string {
88
- // TODO
89
- (() => ({ inputs, output, expected, scores, metadata }))();
90
-
91
- return "foo";
92
- }
93
-
94
- /**
95
- * Summarize the experiment, including the scores (compared to the closest reference experiment) and metadata.
96
- *
97
- * @param options
98
- * @param summarize_scores Whether to summarize the scores. If False, only the metadata will be returned.
99
- * @param comparison_experiment_id The experiment to compare against. If None, the most recent experiment on the origin's main branch will be used.
100
- * @returns `ExperimentSummary`
101
- */
102
- summarize(
103
- options:
104
- | {
105
- readonly summarizeScores?: boolean;
106
- readonly comparisonExperimentId?: string;
107
- }
108
- | undefined = undefined
109
- ): string {
110
- return "Summary!";
111
- }
112
- }
package/tsconfig.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "incremental": true,
4
- "declaration": true,
5
- "outDir": "./dist",
6
- "lib": ["es6"],
7
- "module": "commonjs",
8
- "target": "es6",
9
- "moduleResolution": "node",
10
- "strict": true,
11
- "esModuleInterop": true
12
- },
13
- "include": ["src"],
14
- "exclude": ["node_modules/**"]
15
- }