Get started with the Netra Python SDK. Install netra-sdk, initialize Netra.init(), and begin tracing LLM calls and monitoring AI applications in minutes.
To use the PII detection features provided by Netra SDK:
pip install 'netra-sdk[presidio]'
poetry add netra-sdk --extras "presidio"
If you try to use the PII detection utility in Netra SDK without installing this dependency, you will receive an exception. So, always make sure to install the package if you plan to use this utility.
Follow the code below to initialize Netra in you application. By default, Netra will instrument all the installed packages.
from netra import Netrafrom netra.instrumentation.instruments import InstrumentSet# Initialize with default settingsNetra.init(app_name="Your application name")# Or with custom configurationapi_key = "Your API key"headers = f"x-api-key={api_key}"Netra.init( app_name="Your application name", headers=headers, trace_content=True, environment="Your Application environment")
Calling Netra.init() starts basic tracing, but to get useful insights, it is recommended to add custom annotations and manual instrumentation around important parts of your code.
Netra SDK provides decorators like @workflow, @agent, and @task for easy instrumentation of your code. For more details and usage examples, please refer to the Decorators section in our documentation.