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 clientclient = Spro(api_key="your_api_key_here")# Step 2: Mask sensitive information using the 'secure' methodresult = client.secure("My name is John Doe, and my email is john.doe@example.com")# Step 3: Print the masked resultprint(result)
Asynchronous Example
For high-performance or non-blocking workflows, the SDK supports asynchronous operations:
import asyncio
asyncdefmain():# 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 resultprint(response)# Run the main function using asyncioasyncio.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.