Skip to main content

No project description provided

Project description

bettertest 📝🔍

⚡ A Python testing library for automatically evaluating and tracing LLM applications ⚡

Our goal with bettertest is to simplify the process of testing and debugging LLM applications. It automatically evaluates your model's responses against your solution answers (auto-eval) and provides tracing features out-of-the-box.

With bettertest, you can automatically test your LLM applications and view print statements for each run just by adding 'bettertest' to any print statement in your code.

Getting Started

Before using BetterTest, you need to install it via pip:

pip install bettertest

After installation, import the BetterTest library in your Python project:

from bettertest import BetterTest

Using BetterTest

Initialize BetterTest

Create an instance of the BetterTest class with the user's email:

bt = BetterTest("your_email@example.com")

Replace "your_email@example.com" with the appropriate email address.

Evaluate Model Responses

The eval() function takes in a list of questions, a list of answers, an LLM function, and an optional num_runs argument. It automatically evaluates the model's response against the solution answer and provides tracing for each run. Use it as follows:

questions = [...]  # List of questions
answers = [...]    # List of corresponding solution answers

def llm_function(question):
    # Your custom LLM function implementation goes here
    pass

bt = BetterTest("your_email@example.com")
bt.eval(questions, answers, llm_function)

Replace the llm_function with your LLM function, and customize num_runs if necessary. By default, num_runs is set to 1.

Contributing

We welcome contributions to InstructPrompt! Feel free to create issues/PR's/or DM us (👋 Hi I'm Krrish - +17708783106)

Changelog

The current version of BetterTest is 0.1.9.

License

BetterTest is released under the MIT License.

Project details


Download files

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

Source Distribution

bettertest-0.1.91.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

bettertest-0.1.91-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file bettertest-0.1.91.tar.gz.

File metadata

  • Download URL: bettertest-0.1.91.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/19.6.0

File hashes

Hashes for bettertest-0.1.91.tar.gz
Algorithm Hash digest
SHA256 543b7633adbc2bb1d8a2edb92774bb58ff6ae7c21200695eea83b76c0a4ed4ee
MD5 267ff7075c331860879a7e393d6565a0
BLAKE2b-256 e306a99bcf9890d15412788bf1d6452c33a498e2b6438be7f073578908d57544

See more details on using hashes here.

File details

Details for the file bettertest-0.1.91-py3-none-any.whl.

File metadata

  • Download URL: bettertest-0.1.91-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.3 Darwin/19.6.0

File hashes

Hashes for bettertest-0.1.91-py3-none-any.whl
Algorithm Hash digest
SHA256 a95541df7f3d6e573f5e14fccafb0d8027b9c57d66931fb5924bdff579804be2
MD5 0f12a19db08f4d76498b244637b5b3a1
BLAKE2b-256 06e1533c20f08471eda8e4086a3c7a7bed14d78273006d6fb4dadc95f1330607

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