Skip to main content

dtx-apis-prompts-utils

Overview

dtx-apis-prompts-utils is a Python library designed for parsing and processing prompts within the Detoxio API ecosystem. This utility provides tools for managing complex prompt structures, base64 decoding, multi-turn interactions, and threat classification.

Features

  • Complex Prompt Handling: Parse and manage structured prompts with roles like USER, SYSTEM, and ASSISTANT.
  • Base64 Decoding: Automatically decode base64-encoded strings into JSON.
  • Multi-turn Prompts: Handle multi-turn conversation flows seamlessly.
  • Threat Classification: Integrate labels and categories for prompt-based threat classification.

Installation

To install the library, use:

pip install dtx-apis-prompts-utils

Usage

Parsing Prompts

from dtx_apis_prompts_utils import ComplexPromptMsgParser

parser = ComplexPromptMsgParser()
parsed_prompt = parser.parse(base64_encoded_or_json_string)

if parsed_prompt:
    print(parsed_prompt.prompt)

Multi-turn Conversations

from dtx_apis_prompts_utils import DtxPrompt

dtx_prompt = DtxPrompt(prompt="Hello, how are you?", safe=True, threat_class="LOW", threat_category="General")
generator = dtx_prompt.get_multi_turn_prompts_gen()

conversation = generator.next_prompt()
print(conversation)

License

This project is licensed under the Custom detoxio License

Metadata

Release files for dtx-apis-prompts-utils 0.2.1

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

Source distribution (sdist)

Source distribution for dtx-apis-prompts-utils 0.2.1
File Size Uploaded Provenance Actions
dtx_apis_prompts_utils-0.2.1.tar.gz 5.3 kB Without provenance Details for dtx_apis_prompts_utils-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dtx-apis-prompts-utils 0.2.1
File Interpreter ABI Platform Actions
dtx_apis_prompts_utils-0.2.1-py3-none-any.whl Python 3 none any Details for dtx_apis_prompts_utils-0.2.1-py3-none-any.whl

Total release size: 11.5 kB

Release files / dtx_apis_prompts_utils-0.2.1.tar.gz

Download URL dtx_apis_prompts_utils-0.2.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0b9d64e65ebd9122b52173719a246920b1d4846a6b701d12aa124f62a6c42f84
BLAKE2b-256 checksum
How to use checksums
085765f6a8470df021feefd89917d5c18aad436cbe584be49eb439af273f57f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.8 Linux/6.8.0-1017-azure

Release files / dtx_apis_prompts_utils-0.2.1-py3-none-any.whl

Download URL dtx_apis_prompts_utils-0.2.1-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40a9b6529fd59cc144518033248e6b5a4d3d7aabb4115ad2aa5492597cf849e6
BLAKE2b-256 checksum
How to use checksums
37e60bfd4e83aa7405305a696e9e1594ca6580fa3c9b7362fd3eff11ef6f9e6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.8 Linux/6.8.0-1017-azure

Security for dtx-apis-prompts-utils 0.2.1

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.

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