netra-sdk 0.1.16__tar.gz → 0.1.17__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.

Files changed (47) hide show
  1. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/PKG-INFO +26 -6
  2. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/README.md +21 -3
  3. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/__init__.py +2 -1
  4. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/__init__.py +14 -2
  5. netra_sdk-0.1.17/netra/version.py +1 -0
  6. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/pyproject.toml +6 -3
  7. netra_sdk-0.1.16/netra/version.py +0 -1
  8. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/LICENCE +0 -0
  9. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/anonymizer/__init__.py +0 -0
  10. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/anonymizer/anonymizer.py +0 -0
  11. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/anonymizer/base.py +0 -0
  12. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/anonymizer/fp_anonymizer.py +0 -0
  13. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/config.py +0 -0
  14. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/decorators.py +0 -0
  15. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/exceptions/__init__.py +0 -0
  16. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/exceptions/injection.py +0 -0
  17. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/exceptions/pii.py +0 -0
  18. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/input_scanner.py +0 -0
  19. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/aiohttp/__init__.py +0 -0
  20. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/aiohttp/version.py +0 -0
  21. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/cohere/__init__.py +0 -0
  22. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/cohere/version.py +0 -0
  23. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/fastapi/__init__.py +0 -0
  24. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/fastapi/version.py +0 -0
  25. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/google_genai/__init__.py +0 -0
  26. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/google_genai/config.py +0 -0
  27. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/google_genai/utils.py +0 -0
  28. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/google_genai/version.py +0 -0
  29. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/httpx/__init__.py +0 -0
  30. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/httpx/version.py +0 -0
  31. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/instruments.py +0 -0
  32. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/mistralai/__init__.py +0 -0
  33. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/mistralai/config.py +0 -0
  34. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/mistralai/utils.py +0 -0
  35. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/mistralai/version.py +0 -0
  36. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/openai/__init__.py +0 -0
  37. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/openai/version.py +0 -0
  38. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/openai/wrappers.py +0 -0
  39. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/weaviate/__init__.py +0 -0
  40. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/instrumentation/weaviate/version.py +0 -0
  41. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/pii.py +0 -0
  42. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/processors/__init__.py +0 -0
  43. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/processors/session_span_processor.py +0 -0
  44. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/scanner.py +0 -0
  45. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/session_manager.py +0 -0
  46. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/span_wrapper.py +0 -0
  47. {netra_sdk-0.1.16 → netra_sdk-0.1.17}/netra/tracer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: netra-sdk
3
- Version: 0.1.16
3
+ Version: 0.1.17
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
@@ -18,7 +18,8 @@ Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Typing :: Typed
20
20
  Provides-Extra: llm-guard
21
- Requires-Dist: llm-guard (>=0.3.16,<0.4.0) ; extra == "llm-guard"
21
+ Provides-Extra: presidio
22
+ Requires-Dist: llm-guard (==0.3.16) ; extra == "llm-guard"
22
23
  Requires-Dist: opentelemetry-api (>=1.34.0,<2.0.0)
23
24
  Requires-Dist: opentelemetry-instrumentation-aio-pika (>=0.55b1,<1.0.0)
24
25
  Requires-Dist: opentelemetry-instrumentation-aiohttp-client (>=0.55b1,<1.0.0)
@@ -66,7 +67,8 @@ Requires-Dist: opentelemetry-instrumentation-tortoiseorm (>=0.55b1,<1.0.0)
66
67
  Requires-Dist: opentelemetry-instrumentation-urllib (>=0.55b1,<1.0.0)
67
68
  Requires-Dist: opentelemetry-instrumentation-urllib3 (>=0.55b1,<1.0.0)
68
69
  Requires-Dist: opentelemetry-sdk (>=1.34.0,<2.0.0)
69
- Requires-Dist: presidio-analyzer (>=2.2.358,<3.0.0)
70
+ Requires-Dist: presidio-analyzer (==2.2.358) ; extra == "presidio"
71
+ Requires-Dist: presidio-anonymizer (==2.2.358) ; extra == "presidio"
70
72
  Requires-Dist: traceloop-sdk (>=0.40.7,<0.43.0)
71
73
  Project-URL: Bug Tracker, https://github.com/KeyValueSoftwareSystems/netra-sdk-py/issues
72
74
  Project-URL: Documentation, https://github.com/KeyValueSoftwareSystems/netra-sdk-py/blob/main/README.md
@@ -108,6 +110,21 @@ poetry add netra-sdk
108
110
 
109
111
  Netra SDK supports optional dependencies for enhanced functionality:
110
112
 
113
+ #### Presidio for PII Detection
114
+ To use the PII detection features provided by Netra SDK:
115
+
116
+ ```bash
117
+ pip install 'netra-sdk[presidio]'
118
+ ```
119
+
120
+ Or, using Poetry:
121
+
122
+ ```bash
123
+ poetry add netra-sdk --extras "presidio"
124
+ ```
125
+
126
+
127
+
111
128
  #### LLM-Guard for Prompt Injection Protection
112
129
 
113
130
  To use the full functionality of prompt injection scanning provided by llm-guard:
@@ -132,6 +149,7 @@ Initialize the Netra SDK at the start of your application:
132
149
 
133
150
  ```python
134
151
  from netra import Netra
152
+ from netra.instrumentation.instruments import InstrumentSet
135
153
 
136
154
  # Initialize with default settings
137
155
  Netra.init(app_name="Your application name")
@@ -143,7 +161,8 @@ Netra.init(
143
161
  app_name="Your application name",
144
162
  headers=headers,
145
163
  trace_content=True,
146
- environment="Your Application environment"
164
+ environment="Your Application environment",
165
+ instruments={InstrumentSet.OPENAI, InstrumentSet.ANTHROPIC},
147
166
  )
148
167
  ```
149
168
 
@@ -573,7 +592,7 @@ Control which instrumentations are enabled:
573
592
  from netra import Netra
574
593
  from netra.instrumentation.instruments import InstrumentSet
575
594
 
576
- # Enable specific instruments only
595
+ # Enable specific instruments
577
596
  Netra.init(
578
597
  app_name="Selective App",
579
598
  instruments={
@@ -621,9 +640,10 @@ export NETRA_HEADERS="authorization=Bearer your-token"
621
640
 
622
641
  ```python
623
642
  from netra import Netra
643
+ from netra.instrumentation.instruments import InstrumentSet
624
644
 
625
645
  # Simple initialization - SDK automatically picks up environment variables
626
- Netra.init(app_name="Your App")
646
+ Netra.init(app_name="Your App", instruments={InstrumentSet})
627
647
  # No endpoint configuration needed in code!
628
648
  ```
629
649
 
@@ -32,6 +32,21 @@ poetry add netra-sdk
32
32
 
33
33
  Netra SDK supports optional dependencies for enhanced functionality:
34
34
 
35
+ #### Presidio for PII Detection
36
+ To use the PII detection features provided by Netra SDK:
37
+
38
+ ```bash
39
+ pip install 'netra-sdk[presidio]'
40
+ ```
41
+
42
+ Or, using Poetry:
43
+
44
+ ```bash
45
+ poetry add netra-sdk --extras "presidio"
46
+ ```
47
+
48
+
49
+
35
50
  #### LLM-Guard for Prompt Injection Protection
36
51
 
37
52
  To use the full functionality of prompt injection scanning provided by llm-guard:
@@ -56,6 +71,7 @@ Initialize the Netra SDK at the start of your application:
56
71
 
57
72
  ```python
58
73
  from netra import Netra
74
+ from netra.instrumentation.instruments import InstrumentSet
59
75
 
60
76
  # Initialize with default settings
61
77
  Netra.init(app_name="Your application name")
@@ -67,7 +83,8 @@ Netra.init(
67
83
  app_name="Your application name",
68
84
  headers=headers,
69
85
  trace_content=True,
70
- environment="Your Application environment"
86
+ environment="Your Application environment",
87
+ instruments={InstrumentSet.OPENAI, InstrumentSet.ANTHROPIC},
71
88
  )
72
89
  ```
73
90
 
@@ -497,7 +514,7 @@ Control which instrumentations are enabled:
497
514
  from netra import Netra
498
515
  from netra.instrumentation.instruments import InstrumentSet
499
516
 
500
- # Enable specific instruments only
517
+ # Enable specific instruments
501
518
  Netra.init(
502
519
  app_name="Selective App",
503
520
  instruments={
@@ -545,9 +562,10 @@ export NETRA_HEADERS="authorization=Bearer your-token"
545
562
 
546
563
  ```python
547
564
  from netra import Netra
565
+ from netra.instrumentation.instruments import InstrumentSet
548
566
 
549
567
  # Simple initialization - SDK automatically picks up environment variables
550
- Netra.init(app_name="Your App")
568
+ Netra.init(app_name="Your App", instruments={InstrumentSet})
551
569
  # No endpoint configuration needed in code!
552
570
  ```
553
571
 
@@ -2,7 +2,7 @@ import logging
2
2
  import threading
3
3
  from typing import Any, Dict, Optional, Set
4
4
 
5
- from netra.instrumentation.instruments import NetraInstruments
5
+ from netra.instrumentation.instruments import InstrumentSet, NetraInstruments
6
6
 
7
7
  from .config import Config
8
8
 
@@ -70,6 +70,7 @@ class Netra:
70
70
 
71
71
  # Instrument all supported modules
72
72
  # Pass trace_content flag to instrumentors that can capture prompts/completions
73
+
73
74
  init_instrumentations(
74
75
  should_enrich_metrics=True,
75
76
  base64_image_uploader=None,
@@ -31,6 +31,20 @@ def init_instrumentations(
31
31
  netra_custom_block_instruments.add(getattr(CustomInstruments, instrument.name))
32
32
  else:
33
33
  traceloop_block_instruments.add(getattr(Instruments, instrument.name))
34
+
35
+ # If no instruments are provided for instrumentation
36
+ if instruments is None:
37
+ traceloop_block_instruments = set(Instruments)
38
+ netra_custom_block_instruments = set(CustomInstruments)
39
+
40
+ # If only custom instruments from netra are provided for instrumentation
41
+ if instruments is not None and not traceloop_instruments and not traceloop_block_instruments:
42
+ traceloop_block_instruments = set(Instruments)
43
+
44
+ # If only traceloop instruments are provided for instrumentation
45
+ if instruments is not None and not netra_custom_instruments and not netra_custom_block_instruments:
46
+ netra_custom_block_instruments = set(CustomInstruments)
47
+
34
48
  traceloop_block_instruments.update(
35
49
  {
36
50
  Instruments.WEAVIATE,
@@ -40,8 +54,6 @@ def init_instrumentations(
40
54
  Instruments.OPENAI,
41
55
  }
42
56
  )
43
- if instruments is not None and traceloop_instruments is None and traceloop_block_instruments is None:
44
- traceloop_block_instruments = set(Instruments)
45
57
 
46
58
  init_instrumentations(
47
59
  should_enrich_metrics=should_enrich_metrics,
@@ -0,0 +1 @@
1
+ __version__ = "0.1.17"
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [project]
6
6
  name = "netra-sdk"
7
- version = "0.1.16"
7
+ version = "0.1.17"
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"}
@@ -33,7 +33,6 @@ dependencies = [
33
33
  "opentelemetry-sdk>=1.34.0,<2.0.0",
34
34
  "opentelemetry-instrumentation-fastapi>=0.55b1,<1.0.0",
35
35
  "traceloop-sdk>=0.40.7,<0.43.0",
36
- "presidio-analyzer>=2.2.358,<3.0.0",
37
36
  "opentelemetry-instrumentation-httpx>=0.55b1,<1.0.0",
38
37
  "opentelemetry-instrumentation-aiohttp-client>=0.55b1,<1.0.0",
39
38
  "opentelemetry-instrumentation-aio-pika>=0.55b1,<1.0.0",
@@ -91,7 +90,11 @@ include = "netra"
91
90
 
92
91
  [project.optional-dependencies]
93
92
  llm_guard = [
94
- "llm-guard>=0.3.16,<0.4.0",
93
+ "llm-guard==0.3.16",
94
+ ]
95
+ presidio = [
96
+ "presidio-analyzer==2.2.358",
97
+ "presidio-anonymizer==2.2.358",
95
98
  ]
96
99
 
97
100
  [tool.poetry.group.dev.dependencies]
@@ -1 +0,0 @@
1
- __version__ = "0.1.16"
File without changes
File without changes
File without changes
File without changes
File without changes