Skip to main content

SDK for integrating Braintrust

Project description

Braintrust

A Python library for logging data to Braintrust. braintrust is distributed as a library on PyPI. It is open source and available on GitHub.

Quickstart

Install the library with pip.

pip install braintrust

Then, run a simple experiment with the following code (replace YOUR_API_KEY with your Braintrust API key):

from braintrust import Eval

def is_equal(expected, output):
    return expected == output

Eval(
  "Say Hi Bot",
  data=lambda: [
      {
          "input": "Foo",
          "expected": "Hi Foo",
      },
      {
          "input": "Bar",
          "expected": "Hello Bar",
      },
  ],  # Replace with your eval dataset
  task=lambda input: "Hi " + input,  # Replace with your LLM call
  scores=[is_equal],
)

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

braintrust-0.0.161.tar.gz (73.3 kB view details)

Uploaded Source

Built Distribution

braintrust-0.0.161-py3-none-any.whl (84.6 kB view details)

Uploaded Python 3

File details

Details for the file braintrust-0.0.161.tar.gz.

File metadata

  • Download URL: braintrust-0.0.161.tar.gz
  • Upload date:
  • Size: 73.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for braintrust-0.0.161.tar.gz
Algorithm Hash digest
SHA256 4a36a1dbf61de69676202d9c46f38824c83ec6752848e7df1dcae2bf63082ed7
MD5 15692d03bdb2bef7e5dd049231ba3aef
BLAKE2b-256 5c32b9fb223b3f59d4746883faddfe126b8fe2bb391ee388252eee483f5141cd

See more details on using hashes here.

File details

Details for the file braintrust-0.0.161-py3-none-any.whl.

File metadata

File hashes

Hashes for braintrust-0.0.161-py3-none-any.whl
Algorithm Hash digest
SHA256 ca156bd84b6c19492928563a420868b77278de305f70d08228aa175c6a685801
MD5 7a84ef63c92d9e07045a0e8bebb84c10
BLAKE2b-256 f3429d7dc5a2467f2bfa4723e15125def44f3ab59f1af63716a6d907b192716d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page