Metadata-Version: 2.1
Name: michina
Version: 0.2.2
Summary: Integ test framework for LLMs.
Home-page: https://github.com/michina-ai/michina
Author: bkitano
Author-email: briankitano@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: build (>=0.10.0,<0.11.0)
Requires-Dist: langchain (>=0.0.240,<0.0.241)
Requires-Dist: openai (>=0.27.8,<0.28.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: twine (>=4.0.2,<5.0.0)
Requires-Dist: xmltodict (>=0.13.0,<0.14.0)
Project-URL: Repository, https://github.com/michina-ai/michina
Description-Content-Type: text/markdown

# Michina
From the quechua word for "pasture".

Unit testing and integration testing for LLMs.

## Features
- [openai] Can run in a Github Actions for workflow

## Todo
- Add monitoring

## Versions

### v0.2.1 -> v0.2.2
Fixing typo.

### v0.1.1 -> v0.2.0
This change allows you to configure the OpenAI model version to use.

The API was like this
```python
from src.prompts import check_for_political_content, respond_to_customer
from michina.checks import ToneCheck, ConsistencyCheck

"""
This is a consistency check. It tests whether your prompt's output 
is consistent with the goal of the test itself.
"""
def test_check_for_political_content_consistent():
    message = "I want to buy a campaign poster for Obama."
    statement = check_for_political_content(message)
    response = ConsistencyCheck.check(message, statement)
    assert response.judgment > 0.5
```
and now it's like this
```python
from src.prompts import check_for_political_content, respond_to_customer
from michina.checks import ToneCheck, ConsistencyCheck
from os import environ as env

michina_config = {
    'model': 'gpt-3.5-turbo',
    'temperature': 0,
    'openai_api_key': env["OPENAI_API_KEY"],
}

consistency = ConsistencyCheck(**michina_config)

def test_check_for_political_content_consistent():
    message = "I want to buy a campaign poster for Obama."
    statement = check_for_political_content(message)
    response = consistency.check(message, statement)
    assert response.judgment > 0.5
```
