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
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
Built Distribution
File details
Details for the file bettertest-0.1.97.tar.gz
.
File metadata
- Download URL: bettertest-0.1.97.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e47848aa04cf839edb6b1bb4322ded014ae09b82fa7a4fc9cbd56dcf7091fff3 |
|
MD5 | 5d958cb4276cb5c867adf84bcee6a2eb |
|
BLAKE2b-256 | c12cfa5cabce4409de275204348edf422f8094807a2f82acb6fb376657ddb0f2 |
File details
Details for the file bettertest-0.1.97-py3-none-any.whl
.
File metadata
- Download URL: bettertest-0.1.97-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9e572b1539c7b44c8b7014faa4c4f154512bcc6fcc8ccd100cf2ecdf9bb7122 |
|
MD5 | 574f2f0f2e6c68100e8aabbd6ad5ca07 |
|
BLAKE2b-256 | 1955b8d97057146e4b3a4b9d5e6ed7db84ef5ca10aacb3dc68d355051cd29de5 |