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.138.tar.gz (55.0 kB view details)

Uploaded Source

Built Distribution

braintrust-0.0.138-py3-none-any.whl (60.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: braintrust-0.0.138.tar.gz
  • Upload date:
  • Size: 55.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/42.0 requests/2.32.2 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.66.3 importlib-metadata/6.8.0 keyring/24.2.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.11.8

File hashes

Hashes for braintrust-0.0.138.tar.gz
Algorithm Hash digest
SHA256 306da0bae8fa14aa237cb931a886b665f397559301d9c649de2d5bad4c89f36f
MD5 3a8c4199afd2692c88f11e27dacef81a
BLAKE2b-256 c75e0009d1bdbaaaadb83c45613f393cdd9b057e5281cdefd1cf53aed8ee647e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: braintrust-0.0.138-py3-none-any.whl
  • Upload date:
  • Size: 60.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/42.0 requests/2.32.2 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.66.3 importlib-metadata/6.8.0 keyring/24.2.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.11.8

File hashes

Hashes for braintrust-0.0.138-py3-none-any.whl
Algorithm Hash digest
SHA256 4d88cc57efa9883d09c66afca6f23bd107d1c363a1785044caa5d095d4c823ae
MD5 bafb5bdabf3946f1362efa30a003e9b4
BLAKE2b-256 3c928d6b211136fcf466d12d8c3709a3ec78a3775a1c279f47092e16e70d2e45

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