Skip to main content

GentelShield SDK for Python

Project description

GentelShield Python SDK

Welcome to the official Python SDK for the GentelShield API. This SDK provides a convenient way to integrate GentelShield's content moderation services into your Python applications.

Installation

You can install the SDK directly from PyPI using pip:

pip install gentelshield-python-sdk

Quick Start

Here's a simple example of how to configure the SDK and check a piece of text.

import gentelsdkcore
import gentelsdkshd

# 1. Initialize configuration
configuration = gentelsdkcore.Configuration()
configuration.ak = "YOUR_SHIELD_API_KEY"  # Replace with your actual API Key
# If you are accessing a private deployment, you might need to set the host
# configuration.host = "your_custom_domain.com"
gentelsdkcore.Configuration.set_default(configuration)

# 2. Create an API instance
api_instance = gentelsdkshd.SHDApi()

# 3. Create a request object for non-streaming text check
check_llm_text_trunk_request = gentelsdkshd.CheckLLMTextTrunkRequest(
    content="This is the text content you want to check."
)

try:
    # 4. Call the API and get the result
    result = api_instance.check_llm_text_trunk(check_llm_text_trunk_request)
    print(result)
except Exception as e:
    print(f"An error occurred: {e}")

Usage

The SDK provides three main functionalities:

  • CheckLLMTextStream: For streaming text content moderation.
  • CheckLLMTextTrunk: For non-streaming (batch) text content moderation.
  • CheckLLMPhoto: For image content moderation.

Please refer to the official documentation for more detailed examples and API references.

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

gentelshield-python-sdk-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

gentelshield_python_sdk-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file gentelshield-python-sdk-0.1.0.tar.gz.

File metadata

  • Download URL: gentelshield-python-sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.9

File hashes

Hashes for gentelshield-python-sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 41f498b82e82037871d1a28f246760bf4b9eb40876e71c451097c887211fdc16
MD5 1dd5860031f3ec96d88fea5880ece000
BLAKE2b-256 a8f11c833038d022dc21b12853aa0e98fa42beab380dadabfa828102e8689ae6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gentelshield_python_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8acd7b4af879dbaef91752096c44a841b74d899f26568a7aa608f30fce6a1a7a
MD5 2203cc0bf4d58f2be6780ea1fe531099
BLAKE2b-256 da391b3447098e8b944ae2832a3976d21c797ad228ceb38f823416a15baf63bf

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