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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: bettertest-0.1.96.tar.gz
  • Upload date:
  • Size: 12.0 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.96.tar.gz
Algorithm Hash digest
SHA256 85e8a1b7228283dd07e005a8728d8384c28f50d8da77db05e615a32de7e263bb
MD5 13ceb561dbe402e5e380e90ffe033724
BLAKE2b-256 ff6d7f29ceb7365bd1166aa28ed85e04ed2089c09f8f118d9eff230d7137170a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bettertest-0.1.96-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.96-py3-none-any.whl
Algorithm Hash digest
SHA256 21ac56d46539321ee9dbf371544e2399ee2f0eb9a8eb9efe319cfb489944cc98
MD5 fa03dec0681916a4a345ba5ba4cf418e
BLAKE2b-256 1a3ace944a491cadf29075f97c2116d23fdcf086268ac5f0b64bf6322241c07c

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