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

Uploaded Source

Built Distribution

bettertest-0.1.93-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bettertest-0.1.93.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.93.tar.gz
Algorithm Hash digest
SHA256 d6a3f82d21daa2a413a94423f9d42b57f0afe81be52ff481b0e2c3831ba1d5d7
MD5 6a20cf33e9fa2a64536916faf056a2e7
BLAKE2b-256 9b5c4923930aff84c80e00f77e9a24a9bd597f52d567a6396e7b68544c9543be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bettertest-0.1.93-py3-none-any.whl
  • Upload date:
  • Size: 13.2 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.93-py3-none-any.whl
Algorithm Hash digest
SHA256 27d1864727a309c20297f90d195dccd5783b4041d7cd7f1f7d5fa584d6a7bf29
MD5 39f7b802430395ba6a7c2fcbc356a860
BLAKE2b-256 01128b94ba4791c88988d7fe94ae7099235998360a10c9221e0a0ec82a22dde0

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