Metadata-Version: 2.1
Name: hllama
Version: 0.0.7
Summary: hllama provides some useful utility functions for LLM.
Home-page: https://github.com/deep-diver/hllama
Author: chansung park
Author-email: deep.diver.csp@gmail.com
Keywords: LLM,Large Language Model,Verification,Utility
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# hllama

<img src="assets/hllama-logo.png" style="display: block; margin-left: auto; margin-right: auto;">

`hllama == Harness LLaMA`. `hllama` is a library which aims to provide a set of utility tools for large language models. 

## Install

```console
$ pip install hllama
```

## Usage

Test if JSON matches target structure

```python
from hllama import json_utils

A = {"key1": str, "key2": {"key3": str, "key4": int, "key5": list}}
B = {"key1": "hello", "key2": {"key3": "world", "key4": 100, "key5": [1, 2, 3]}}

result = json_utils.match_structure(A, B)
assert result is True
```

Test if there is JSON part in a string

```python
raw_string = "..."
result = json_utils.parse_json_snippet(raw_string)
assert isinstance(result, dict)
assert result is not None
```
