Skip to main content

Risk Detector

Minimal skeleton of dynamic risk classification chat assistant.

Installation

pip install -r requirements.txt
# or install the package
pip install .

CLI usage

The project exposes a command line interface providing helpers to manage rules and run the interactive dialog.

annex4risk-detector --help

Typical workflow:

# create database tables
annex4risk-detector init_db --db-url sqlite:///risk.db

# load YAML rules into the database
annex4risk-detector sync_rules --db-url sqlite:///risk.db --dir path/to/rules

# start an interactive classification chat
annex4risk-detector chat --db-url sqlite:///risk.db

See risk-detector --help for all available commands.

Demo script

For a quick demonstration with a temporary SQLite database and pre-filled answers that exercise all risk levels, run:

python demo_script.py

The script loads sample rules from test_rules/risk and shows how the dialog flows for scenarios ending in the prohibited, high_risk, not_high_risk (including Art. 6(3) derogation), and out_of_scope categories.

Serverless deployment

When deploying the Lambda handler, use a database reachable from the serverless environment (for example, an Amazon RDS PostgreSQL instance). Expose the connection string via the DB_URL environment variable – handler.py reads this variable and passes it to DialogOrchestrator.

Before deployment initialise the database and load the rules:

annex4risk-detector init_db --db-url "$DB_URL"
annex4risk-detector sync_rules --db-url "$DB_URL" --dir path/to/rules

These commands create tables including chat_answers and risk_outcomes which persist every answer and classification result.

Metadata

Release files for annex4risk-detector 1.4.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for annex4risk-detector 1.4.10
File Size Uploaded Provenance Actions
annex4risk_detector-1.4.10.tar.gz 31.9 kB Without provenance Details for annex4risk_detector-1.4.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for annex4risk-detector 1.4.10
File Interpreter ABI Platform Actions
annex4risk_detector-1.4.10-py3-none-any.whl Python 3 none any Details for annex4risk_detector-1.4.10-py3-none-any.whl

Total release size: 54.6 kB

Release files / annex4risk_detector-1.4.10.tar.gz

Download URL annex4risk_detector-1.4.10.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2fb35589897ecfef15fd56022d8e020b7303ba7b50f3b2715b290968ea913ed2
BLAKE2b-256 checksum
How to use checksums
64ca062332de16f63b9dc930afc6b663b377c3792dd1a19f2fe912d77d1bb07e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.32.5 requests-toolbelt/1.0.0 urllib3/2.0.7 tqdm/4.67.1 importlib-metadata/8.6.1 keyring/25.6.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.11.6

Release files / annex4risk_detector-1.4.10-py3-none-any.whl

Download URL annex4risk_detector-1.4.10-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a0935bea919819358e0a5b3088d7276ea0672aadefafad8a41bb05d22cb6d51
BLAKE2b-256 checksum
How to use checksums
7e479f43f99fc93ba9d02ec13efacd9e70d7f77d4aa5ba5b9e19815ab5484b68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.32.5 requests-toolbelt/1.0.0 urllib3/2.0.7 tqdm/4.67.1 importlib-metadata/8.6.1 keyring/25.6.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.11.6

Security for annex4risk-detector 1.4.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page