Skip to main content

A Python client for accessing the Tumeryk AI Trust Score API

Project description

AI Trust Score Client

A Python client for accessing the Tumeryk AI Trust Score API, which provides comprehensive trust and safety metrics for various AI models.

Installation

pip install ai-trust-score

Quick Start

from ai_trust_score import trust_score

# Using environment variables
# Set TUMERYK_USERNAME and TUMERYK_PASSWORD in your environment

# The client will auto-login if environment variables are set
scores = trust_score.get_trust_scores()
print(scores)

# Or login explicitly
trust_score.login(username="your_username", password="your_password")
scores = trust_score.get_trust_scores()

Advanced Usage

from ai_trust_score import TumerykTrustScoreClient

# Create a custom client instance
client = TumerykTrustScoreClient(
    base_url="https://trust-score.tmryk.com/",
    auth_url="https://chat.tmryk.com"
)

# Login
client.login(username="your_username", password="your_password")

# Get trust scores
scores = client.get_trust_scores()

# Access specific model scores
for model_id, data in scores["data"]["total_score"].items():
    print(f"Model: {model_id}")
    print(f"Total Score: {data['score']}")
    print("Information Codes:")
    for code, message in data["information_codes"].items():
        print(f"  {code}: {message}")
    
    # Print category scores
    category_scores = scores["data"]["category_score"][model_id]
    print("Category Scores:")
    for category, score in category_scores.items():
        print(f"  {category}: {score}")

Score Categories

The trust score evaluation includes the following categories:

  • Prompt Injection: Measures resistance to malicious prompts
  • Security: Overall security assessment
  • Sensitive Information Disclosure: Evaluation of data privacy
  • Insecure Output Handling: Assessment of output safety
  • Supply Chain Vulnerabilities: Analysis of dependencies
  • Hallucination: Measurement of response accuracy
  • Psychological Safety: Evaluation of emotional impact
  • Fairness: Assessment of bias and equality
  • Toxicity: Measurement of harmful content

Information Codes

The API may return various information codes indicating areas for improvement:

  • 301: Low Security Score
  • 303: Low Sensitive Information Disclosure Score
  • 307: Low Insecure Output Handling Score
  • 308: Low Supply Chain Vulnerabilities Score
  • 309: Low Hallucination Score

Environment Variables

Response Format

{
    "status": "success",
    "data": {
        "total_score": {
            "model_id": {
                "score": 800,
                "information_codes": {
                    "307": "Low Insecure Output Handling Score",
                    "308": "Low Supply Chain Vulnerabilities Score"
                }
            }
        },
        "category_score": {
            "model_id": {
                "Prompt Injection": 766,
                "Security": 925,
                "Sensitive Information Disclosure": 687,
                "Insecure Output Handling": 462,
                "Supply Chain Vulnerabilities": 780,
                "Hallucination": 637,
                "Psychological Safety": 833,
                "Fairness": 997,
                "Toxicity": 997
            }
        }
    }
}

Error Handling

The client includes built-in error handling for API requests. If a request fails, it will return a dictionary with an error message:

{
    "error": "Request failed: <error details>"
}

Support

For support, please contact support@tumeryk.com or visit our website at https://tumeryk.com.

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

ai_trust_score-1.0.7.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_trust_score-1.0.7-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file ai_trust_score-1.0.7.tar.gz.

File metadata

  • Download URL: ai_trust_score-1.0.7.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for ai_trust_score-1.0.7.tar.gz
Algorithm Hash digest
SHA256 e704cd0a68f647dc8163ea435239bb7b6085b60ed56eef0b7933b8773942803b
MD5 ba56457004c95a4f6d114d0276b9f977
BLAKE2b-256 f275d7680a29d0ebd18b5d48380611ad50cb79cdbb0c73aa3a4dab9a5a3dfe07

See more details on using hashes here.

File details

Details for the file ai_trust_score-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: ai_trust_score-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for ai_trust_score-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5492ea736fe715e611370684b2991505251eef5a11db7cf1866bb904e7a25677
MD5 2596677c2af4d355741a40503b1393e2
BLAKE2b-256 25996671518bece37d0d6987cd4dd84ce151f57b9a2f238bd75bf8e50e935a59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page