Skip to main content

Holistic AI SDK Library

Project description


Holistic AI

The Holistic AI SDK is a library that provides integration with the HAI Platform

Installation

Install the library with:

    pip install haisdk

How to use the haisdk for Quantitative Assessment

Create a config

    from haisdk.config import Config
    config = {
        'tenant_id': '',
        'api_key': '',
        'project_id': '',
        'solution_id': '',
        'instance_id': ''
    }
    session = Config(config=config)

Create an assessment

    from haisdk.assessment import Assess
    settings = {
        'task': '',
        'tbd': 'tbd'
    }
    assess = Assess(session=session, settings=settings)
    assess.run(input=...,output=...,pred=...,model=...)

How to use the haisdk for Safeguard Monitoring

Create a config

    from haisdk.safeguard.safeguard_processor import SafeguardProcessor

    config = {
        "tenant_id": "",
        "apikey": "",
        "api_name": "",
        "provider_name: ""
    }
    safeguard = SafeguardProcessor(config)

Prepare your data

data = {
    "sender_id": "",
    "data": {
        "message_groups": [
            {
                "prompt": {
                    "message": "",
                    "sender_type": "human",
                },
                "response": {
                    "message": "",
                    "sender_type": "provider",
                },
            },
        ]
    }
}

Analyse your data (either sync or async)

# sync operation
results = safeguard.analyse(test_data)
print(results)

# async operation
safeguard.analyse_async(test_data)

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

haisdk-0.0.17.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

haisdk-0.0.17-py3-none-any.whl (7.8 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