Skip to main content

hllama provides some useful utility functions for LLM.

Project description

hllama

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

Install

$ pip install hllama

Usage

Test if JSON matches target structure

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

hllama-0.0.7-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

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