netra-sdk 0.1.17__tar.gz → 0.1.19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of netra-sdk might be problematic. Click here for more details.
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/PKG-INFO +7 -4
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/README.md +6 -3
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/anonymizer/anonymizer.py +7 -1
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/__init__.py +9 -6
- netra_sdk-0.1.19/netra/version.py +1 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/pyproject.toml +1 -1
- netra_sdk-0.1.17/netra/version.py +0 -1
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/LICENCE +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/anonymizer/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/anonymizer/base.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/anonymizer/fp_anonymizer.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/config.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/decorators.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/exceptions/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/exceptions/injection.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/exceptions/pii.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/input_scanner.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/aiohttp/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/aiohttp/version.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/cohere/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/cohere/version.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/fastapi/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/fastapi/version.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/google_genai/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/google_genai/config.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/google_genai/utils.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/google_genai/version.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/httpx/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/httpx/version.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/instruments.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/mistralai/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/mistralai/config.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/mistralai/utils.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/mistralai/version.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/openai/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/openai/version.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/openai/wrappers.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/weaviate/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/instrumentation/weaviate/version.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/pii.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/processors/__init__.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/processors/session_span_processor.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/scanner.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/session_manager.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/span_wrapper.py +0 -0
- {netra_sdk-0.1.17 → netra_sdk-0.1.19}/netra/tracer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: netra-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.19
|
|
4
4
|
Summary: A Python SDK for AI application observability that provides OpenTelemetry-based monitoring, tracing, and PII protection for LLM and vector database applications. Enables easy instrumentation, session tracking, and privacy-focused data collection for AI systems in production environments.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Keywords: netra,tracing,observability,sdk,ai,llm,vector,database
|
|
@@ -152,7 +152,7 @@ from netra import Netra
|
|
|
152
152
|
from netra.instrumentation.instruments import InstrumentSet
|
|
153
153
|
|
|
154
154
|
# Initialize with default settings
|
|
155
|
-
Netra.init(app_name="Your application name")
|
|
155
|
+
Netra.init(app_name="Your application name", instruments={InstrumentSet.OPENAI, InstrumentSet.ANTHROPIC})
|
|
156
156
|
|
|
157
157
|
# Or with custom configuration
|
|
158
158
|
api_key = "Your API key"
|
|
@@ -394,9 +394,10 @@ Track user sessions and add custom context:
|
|
|
394
394
|
|
|
395
395
|
```python
|
|
396
396
|
from netra import Netra
|
|
397
|
+
from netra.instrumentation.instruments import InstrumentSet
|
|
397
398
|
|
|
398
399
|
# Initialize SDK
|
|
399
|
-
Netra.init(app_name="My App")
|
|
400
|
+
Netra.init(app_name="My App", instruments={InstrumentSet.OPENAI})
|
|
400
401
|
|
|
401
402
|
# Set session identification
|
|
402
403
|
Netra.set_session_id("unique-session-id")
|
|
@@ -574,13 +575,15 @@ You can also configure the SDK programmatically when initializing:
|
|
|
574
575
|
|
|
575
576
|
```python
|
|
576
577
|
from netra import Netra
|
|
578
|
+
from netra.instrumentation.instruments import InstrumentSet
|
|
577
579
|
|
|
578
580
|
Netra.init(
|
|
579
581
|
app_name="my-ai-service",
|
|
580
582
|
environment="production",
|
|
581
583
|
resource_attributes={"team": "ai", "version": "1.0.0"},
|
|
582
584
|
trace_content=True,
|
|
583
|
-
disable_batch=False
|
|
585
|
+
disable_batch=False,
|
|
586
|
+
instruments={InstrumentSet.OPENAI}
|
|
584
587
|
)
|
|
585
588
|
```
|
|
586
589
|
|
|
@@ -74,7 +74,7 @@ from netra import Netra
|
|
|
74
74
|
from netra.instrumentation.instruments import InstrumentSet
|
|
75
75
|
|
|
76
76
|
# Initialize with default settings
|
|
77
|
-
Netra.init(app_name="Your application name")
|
|
77
|
+
Netra.init(app_name="Your application name", instruments={InstrumentSet.OPENAI, InstrumentSet.ANTHROPIC})
|
|
78
78
|
|
|
79
79
|
# Or with custom configuration
|
|
80
80
|
api_key = "Your API key"
|
|
@@ -316,9 +316,10 @@ Track user sessions and add custom context:
|
|
|
316
316
|
|
|
317
317
|
```python
|
|
318
318
|
from netra import Netra
|
|
319
|
+
from netra.instrumentation.instruments import InstrumentSet
|
|
319
320
|
|
|
320
321
|
# Initialize SDK
|
|
321
|
-
Netra.init(app_name="My App")
|
|
322
|
+
Netra.init(app_name="My App", instruments={InstrumentSet.OPENAI})
|
|
322
323
|
|
|
323
324
|
# Set session identification
|
|
324
325
|
Netra.set_session_id("unique-session-id")
|
|
@@ -496,13 +497,15 @@ You can also configure the SDK programmatically when initializing:
|
|
|
496
497
|
|
|
497
498
|
```python
|
|
498
499
|
from netra import Netra
|
|
500
|
+
from netra.instrumentation.instruments import InstrumentSet
|
|
499
501
|
|
|
500
502
|
Netra.init(
|
|
501
503
|
app_name="my-ai-service",
|
|
502
504
|
environment="production",
|
|
503
505
|
resource_attributes={"team": "ai", "version": "1.0.0"},
|
|
504
506
|
trace_content=True,
|
|
505
|
-
disable_batch=False
|
|
507
|
+
disable_batch=False,
|
|
508
|
+
instruments={InstrumentSet.OPENAI}
|
|
506
509
|
)
|
|
507
510
|
```
|
|
508
511
|
|
|
@@ -8,7 +8,13 @@ texts while maintaining privacy.
|
|
|
8
8
|
|
|
9
9
|
from typing import Callable, List, Optional
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
try:
|
|
12
|
+
from presidio_analyzer.recognizer_result import RecognizerResult
|
|
13
|
+
except Exception:
|
|
14
|
+
raise ImportError(
|
|
15
|
+
"PII Detetcion requires the 'presidio' packages: Install them explicitly as they are not available with the base SDK. Use pip install 'netra-sdk[presidio]' to install them."
|
|
16
|
+
)
|
|
17
|
+
|
|
12
18
|
|
|
13
19
|
from .base import AnonymizationResult, BaseAnonymizer
|
|
14
20
|
from .fp_anonymizer import FormatPreservingEmailAnonymizer
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
from contextlib import redirect_stderr, redirect_stdout
|
|
3
|
+
from io import StringIO
|
|
2
4
|
from typing import Any, Callable, Optional, Set
|
|
3
5
|
|
|
4
6
|
from traceloop.sdk import Instruments, Telemetry
|
|
@@ -55,12 +57,13 @@ def init_instrumentations(
|
|
|
55
57
|
}
|
|
56
58
|
)
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
with redirect_stdout(StringIO()), redirect_stderr(StringIO()):
|
|
61
|
+
init_instrumentations(
|
|
62
|
+
should_enrich_metrics=should_enrich_metrics,
|
|
63
|
+
base64_image_uploader=base64_image_uploader,
|
|
64
|
+
instruments=traceloop_instruments,
|
|
65
|
+
block_instruments=traceloop_block_instruments,
|
|
66
|
+
)
|
|
64
67
|
|
|
65
68
|
netra_custom_instruments = netra_custom_instruments or set(CustomInstruments)
|
|
66
69
|
netra_custom_instruments = netra_custom_instruments - netra_custom_block_instruments
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.19"
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "netra-sdk"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.19"
|
|
8
8
|
description = "A Python SDK for AI application observability that provides OpenTelemetry-based monitoring, tracing, and PII protection for LLM and vector database applications. Enables easy instrumentation, session tracking, and privacy-focused data collection for AI systems in production environments."
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "Sooraj Thomas",email = "sooraj@keyvalue.systems"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.17"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|