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", "your_openai_api_key")

Replace "your_email@example.com" with the appropriate email address. Replace "your_openai_api_key" with your openai api key. Here's where to find it.

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bettertest-0.1.94.tar.gz
  • Upload date:
  • Size: 11.9 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.94.tar.gz
Algorithm Hash digest
SHA256 7122d952b017139e64bf51ad633b3f38045e15670e685909ae6b91e42c4f4e76
MD5 a06c357126821d5797c6917d427e6d4d
BLAKE2b-256 0027f9e9422e97b7dfd47611d4cddf09625eb3b440f1b592a5934ef5f41a2719

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bettertest-0.1.94-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.94-py3-none-any.whl
Algorithm Hash digest
SHA256 dd088a4da6f154d0e6e244e996e0cc9024aa5cffe19481974b15efd28476c25b
MD5 9c931791a4b22b0db493617fa434ccb0
BLAKE2b-256 635df48001ea150c4c751e7827e2f794e58b5c00ca3845737a48f54a37c9db70

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