netra-sdk 0.1.40__py3-none-any.whl → 0.1.41__py3-none-any.whl
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/__init__.py +3 -3
- netra/config.py +0 -7
- netra/session_manager.py +6 -6
- netra/version.py +1 -1
- {netra_sdk-0.1.40.dist-info → netra_sdk-0.1.41.dist-info}/METADATA +1 -1
- {netra_sdk-0.1.40.dist-info → netra_sdk-0.1.41.dist-info}/RECORD +8 -8
- {netra_sdk-0.1.40.dist-info → netra_sdk-0.1.41.dist-info}/LICENCE +0 -0
- {netra_sdk-0.1.40.dist-info → netra_sdk-0.1.41.dist-info}/WHEEL +0 -0
netra/__init__.py
CHANGED
|
@@ -9,7 +9,7 @@ from opentelemetry.trace import SpanKind
|
|
|
9
9
|
|
|
10
10
|
from netra.instrumentation.instruments import InstrumentSet, NetraInstruments
|
|
11
11
|
|
|
12
|
-
from .config import Config
|
|
12
|
+
from .config import Config
|
|
13
13
|
|
|
14
14
|
# Instrumentor functions
|
|
15
15
|
from .instrumentation import init_instrumentations
|
|
@@ -249,13 +249,13 @@ class Netra:
|
|
|
249
249
|
logger.warning("Both event_name and attributes must be provided for custom events.")
|
|
250
250
|
|
|
251
251
|
@classmethod
|
|
252
|
-
def add_conversation(cls,
|
|
252
|
+
def add_conversation(cls, conversation_type: ConversationType, field_name: str, value: Any) -> None:
|
|
253
253
|
"""
|
|
254
254
|
Append a conversation entry and set span attribute 'conversation' as an array.
|
|
255
255
|
If a conversation array already exists for the current active span, this appends
|
|
256
256
|
to it; otherwise, it initializes a new array.
|
|
257
257
|
"""
|
|
258
|
-
SessionManager.add_conversation(
|
|
258
|
+
SessionManager.add_conversation(conversation_type=conversation_type, field_name=field_name, value=value)
|
|
259
259
|
|
|
260
260
|
@classmethod
|
|
261
261
|
def start_span(
|
netra/config.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import os
|
|
3
|
-
from enum import Enum
|
|
4
3
|
from typing import Any, Dict, List, Optional
|
|
5
4
|
|
|
6
5
|
from opentelemetry.util.re import parse_env_headers
|
|
@@ -8,12 +7,6 @@ from opentelemetry.util.re import parse_env_headers
|
|
|
8
7
|
from netra.version import __version__
|
|
9
8
|
|
|
10
9
|
|
|
11
|
-
class ConversationType(str, Enum):
|
|
12
|
-
INPUT = "input"
|
|
13
|
-
OUTPUT = "output"
|
|
14
|
-
SYSTEM = "system"
|
|
15
|
-
|
|
16
|
-
|
|
17
10
|
class Config:
|
|
18
11
|
"""
|
|
19
12
|
Holds configuration options for the tracer:
|
netra/session_manager.py
CHANGED
|
@@ -262,7 +262,7 @@ class SessionManager:
|
|
|
262
262
|
logger.exception(f"Failed to add custom event: {name} - {e}")
|
|
263
263
|
|
|
264
264
|
@staticmethod
|
|
265
|
-
def add_conversation(
|
|
265
|
+
def add_conversation(conversation_type: ConversationType, field_name: str, value: Any) -> None:
|
|
266
266
|
"""
|
|
267
267
|
Append a conversation entry and set span attribute 'conversation' as an array.
|
|
268
268
|
|
|
@@ -274,17 +274,17 @@ class SessionManager:
|
|
|
274
274
|
"""
|
|
275
275
|
|
|
276
276
|
# Hard runtime validation of input types and values
|
|
277
|
-
if not isinstance(
|
|
278
|
-
raise TypeError("
|
|
279
|
-
normalized_type =
|
|
277
|
+
if not isinstance(conversation_type, ConversationType):
|
|
278
|
+
raise TypeError("conversation_type must be a ConversationType enum value (input, output, system)")
|
|
279
|
+
normalized_type = conversation_type.value
|
|
280
280
|
|
|
281
281
|
if not isinstance(field_name, str):
|
|
282
282
|
raise TypeError(f"field_name must be a string, got {type(field_name)}")
|
|
283
283
|
if not field_name:
|
|
284
284
|
raise ValueError("field_name must be a non-empty string")
|
|
285
285
|
|
|
286
|
-
if value
|
|
287
|
-
raise ValueError("value must not be
|
|
286
|
+
if not value:
|
|
287
|
+
raise ValueError("value must not be empty")
|
|
288
288
|
|
|
289
289
|
try:
|
|
290
290
|
span = trace.get_current_span()
|
netra/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.41"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: netra-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.41
|
|
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
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
netra/__init__.py,sha256=
|
|
1
|
+
netra/__init__.py,sha256=imPVPlcpM85yPJNXMexewJ7p30blBbbY6hn8_lOrjlA,10365
|
|
2
2
|
netra/anonymizer/__init__.py,sha256=KeGPPZqKVZbtkbirEKYTYhj6aZHlakjdQhD7QHqBRio,133
|
|
3
3
|
netra/anonymizer/anonymizer.py,sha256=IcrYkdwWrFauGWUeAW-0RwrSUM8VSZCFNtoywZhvIqU,3778
|
|
4
4
|
netra/anonymizer/base.py,sha256=ytPxHCUD2OXlEY6fNTuMmwImNdIjgj294I41FIgoXpU,5946
|
|
5
5
|
netra/anonymizer/fp_anonymizer.py,sha256=_6svIYmE0eejdIMkhKBUWCNjGtGimtrGtbLvPSOp8W4,6493
|
|
6
|
-
netra/config.py,sha256=
|
|
6
|
+
netra/config.py,sha256=51m8R0NoOrw58gMV7arOniEuFdJ7EIu3PNdFtIQ5xfg,6893
|
|
7
7
|
netra/decorators.py,sha256=qZFHrwdj10FsTFqggo3XjdGB12aMxsrrDMMmslDqZ-0,17424
|
|
8
8
|
netra/exceptions/__init__.py,sha256=uDgcBxmC4WhdS7HRYQk_TtJyxH1s1o6wZmcsnSHLAcM,174
|
|
9
9
|
netra/exceptions/injection.py,sha256=ke4eUXRYUFJkMZgdSyPPkPt5PdxToTI6xLEBI0hTWUQ,1332
|
|
@@ -45,11 +45,11 @@ netra/processors/instrumentation_span_processor.py,sha256=VzurzwtGleFltxzKD_gjVk
|
|
|
45
45
|
netra/processors/scrubbing_span_processor.py,sha256=dJ86Ncmjvmrhm_uAdGTwcGvRpZbVVWqD9AOFwEMWHZY,6701
|
|
46
46
|
netra/processors/session_span_processor.py,sha256=qcsBl-LnILWefsftI8NQhXDGb94OWPc8LvzhVA0JS_c,2432
|
|
47
47
|
netra/scanner.py,sha256=kyDpeZiscCPb6pjuhS-sfsVj-dviBFRepdUWh0sLoEY,11554
|
|
48
|
-
netra/session_manager.py,sha256=
|
|
48
|
+
netra/session_manager.py,sha256=wRGaZZQr1-OeG2ZpuiOAT_A53sQaLa-KHECZCXEc6gg,12492
|
|
49
49
|
netra/span_wrapper.py,sha256=IygQX78xQRlL_Z1MfKfUbv0okihx92qNClnRlYFtRNc,8004
|
|
50
50
|
netra/tracer.py,sha256=FJO8Cine-WL9K_4wn6RVjQOgX6c1JCp_8QowUbRSVHk,7718
|
|
51
|
-
netra/version.py,sha256=
|
|
52
|
-
netra_sdk-0.1.
|
|
53
|
-
netra_sdk-0.1.
|
|
54
|
-
netra_sdk-0.1.
|
|
55
|
-
netra_sdk-0.1.
|
|
51
|
+
netra/version.py,sha256=y9uk7vaddYq7x48m1qAG2qgbHu814vUzjs_fjnrQ3Es,23
|
|
52
|
+
netra_sdk-0.1.41.dist-info/LICENCE,sha256=8B_UoZ-BAl0AqiHAHUETCgd3I2B9yYJ1WEQtVb_qFMA,11359
|
|
53
|
+
netra_sdk-0.1.41.dist-info/METADATA,sha256=nhjMP6HyrFA9ZgJ3sF_lOywJKX8InO5Y75MmhDUah0c,28210
|
|
54
|
+
netra_sdk-0.1.41.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
55
|
+
netra_sdk-0.1.41.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|