Getting Started

Comprehensive guide to help you integrate Spro SDK seamlessly into your AI applications.

This guide introduces the Spro SDK and its key features to help you integrate it into your AI applications securely and easily.

Overview

The Spro SDK provides a secure method to mask sensitive information, protecting privacy during interactions with language models. It helps safeguard Personally Identifiable Information (PII) and keeps your data confidential.

Synchronous Example

For straightforward use cases, the SDK supports synchronous operations:

from spro import Spro

# Step 1: Set up the Spro client
client = Spro(api_key="your_api_key_here")

# Step 2: Mask sensitive information using the 'secure' method
result = client.secure("My name is John Doe, and my email is john.doe@example.com")

# Step 3: Print the masked result
print(result)

Asynchronous Example

For high-performance or non-blocking workflows, the SDK supports asynchronous operations:

import asyncio

async def main():
    # Step 1: Set up the AsyncSpro client
    client = AsyncSpro(api_key="your_api_key_here")
    # Step 2: Use the 'secure' method asynchronously to mask sensitive information
    response = await client.secure(
        "My name is John Doe, and my email is john.doe@example.com",
    )
    # Step 3: Print the masked result
    print(response)
# Run the main function using asyncio
asyncio.run(main())

To have more control over the masking process, you can customize the secure method using advanced options. For more information, refer to the Advanced Options guide.