Skip to main content

A quality, clarity, and risk validation SDK for LLM inputs.

Project description

PromptClarity SDK

Guard prompts before they become bad outputs.

PromptClarity SDK is a pre-LLM validation layer that detects unclear, incomplete, risky, or low-quality prompts before they reach an AI system.

Positioning

PromptClarity SDK helps teams validate LLM inputs for:

  • prompt quality scoring
  • missing context detection
  • ambiguity detection
  • dataset metadata validation
  • agent-readiness checks
  • RAG-readiness checks
  • cost and token waste reduction
  • safer enterprise AI workflows

Enterprise tagline:

A quality, clarity, and risk validation SDK for LLM inputs.

Install

pip install promptclarity-sdk

Usage

from promptclarity import PromptClarity

guard = PromptClarity()

result = guard.validate("Analyze this data and give insights")

print(result.to_dict())

Example output:

{
    "status": "needs_clarification",
    "prompt_score": 42,
    "risk_level": "low",
    "missing_items": [
        "success criteria",
        "dataset details",
        "business objective",
        "output format",
    ],
    "recommendations": [
        "Define the success criteria for a useful answer.",
        "Describe the dataset, including source, fields, and size.",
        "State the business objective or decision the answer should support.",
        "Define the expected output format.",
        "Specify the type of analysis required.",
        "Mention whether you need EDA, prediction, reporting, or recommendations.",
    ],
}

Package Layout

promptclarity/
|-- analyzer.py          # prompt quality analyzer
|-- rules.py             # rule-based checks
|-- risk.py              # unsafe / sensitive / vague input checks
|-- metadata.py          # dataset/file metadata analysis
|-- recommender.py       # missing-detail suggestions
|-- prompt_builder.py    # improved prompt generator
`-- __init__.py

Development

python -m pytest

Release Checklist

  1. Update the version in pyproject.toml and promptclarity/__init__.py.
  2. Run python -m pytest.
  3. Build with python -m build.
  4. Check the distribution with python -m twine check dist/*.
  5. Upload to TestPyPI first, then PyPI.

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

promptclarity_sdk-0.1.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

promptclarity_sdk-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file promptclarity_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: promptclarity_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for promptclarity_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 91fd47dd690eb493537669335e4b700f7c032413ffbda4c49e083d8c9a37bf8b
MD5 cec88090acfc48da25b1ffdb1b89e308
BLAKE2b-256 13a469dc9ae23fc520a52bf3d57d9118e483d5bc5677b0fa3f2715af2263065f

See more details on using hashes here.

File details

Details for the file promptclarity_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for promptclarity_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a74b3112d61e23f041e5e3c524dd66987a9b94e0ffed5bf62162249092c93d0
MD5 bf29c7ad9c02c306a9182948161b31cb
BLAKE2b-256 fc22d3f399e032c75f014244a21224b6658e407a29b5c354257a9eba9ef5669f

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