earshot-observability 0.1.0__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.
Files changed (49) hide show
  1. earshot/__init__.py +125 -0
  2. earshot/adapters/__init__.py +11 -0
  3. earshot/adapters/base.py +26 -0
  4. earshot/adapters/livekit.py +2084 -0
  5. earshot/adapters/pipecat.py +819 -0
  6. earshot/adapters/providers/__init__.py +15 -0
  7. earshot/adapters/providers/base.py +201 -0
  8. earshot/adapters/providers/cartesia.py +343 -0
  9. earshot/adapters/providers/deepgram.py +441 -0
  10. earshot/adapters/providers/openai_realtime.py +436 -0
  11. earshot/adapters/providers/sarvam.py +236 -0
  12. earshot/analysis.py +880 -0
  13. earshot/api.py +1410 -0
  14. earshot/browser_session.py +89 -0
  15. earshot/cli.py +371 -0
  16. earshot/clock.py +39 -0
  17. earshot/codec.py +318 -0
  18. earshot/connectors/__init__.py +38 -0
  19. earshot/connectors/elevenlabs.py +504 -0
  20. earshot/connectors/kernel.py +288 -0
  21. earshot/connectors/retell.py +301 -0
  22. earshot/connectors/ringg.py +269 -0
  23. earshot/connectors/types.py +148 -0
  24. earshot/connectors/vapi.py +343 -0
  25. earshot/context.py +129 -0
  26. earshot/contract.py +641 -0
  27. earshot/explanation.py +308 -0
  28. earshot/exporter.py +1183 -0
  29. earshot/generated/__init__.py +0 -0
  30. earshot/generated/earshot/__init__.py +0 -0
  31. earshot/generated/earshot/v1alpha1/__init__.py +0 -0
  32. earshot/generated/earshot/v1alpha1/incident_pb2.py +38 -0
  33. earshot/measurement_semantics.py +54 -0
  34. earshot/pipeline.py +676 -0
  35. earshot/privacy.py +1137 -0
  36. earshot/py.typed +1 -0
  37. earshot/recorder.py +1948 -0
  38. earshot/sdk.py +1292 -0
  39. earshot/storage.py +3110 -0
  40. earshot/validation.py +2235 -0
  41. earshot/versions.py +15 -0
  42. earshot/web/assets/index-DXBWyP_c.js +60 -0
  43. earshot/web/assets/index-DolUwwS_.css +1 -0
  44. earshot/web/index.html +13 -0
  45. earshot_observability-0.1.0.dist-info/METADATA +222 -0
  46. earshot_observability-0.1.0.dist-info/RECORD +49 -0
  47. earshot_observability-0.1.0.dist-info/WHEEL +4 -0
  48. earshot_observability-0.1.0.dist-info/entry_points.txt +2 -0
  49. earshot_observability-0.1.0.dist-info/licenses/LICENSE +201 -0
earshot/__init__.py ADDED
@@ -0,0 +1,125 @@
1
+ """Earshot Python SDK contract surface."""
2
+
3
+ from .codec import ( # noqa: F401 - legacy direct attributes; import from earshot.codec
4
+ JSON_MEDIA_TYPE,
5
+ PROTOBUF_MEDIA_TYPE,
6
+ IncidentCodecError,
7
+ IncidentDepthError,
8
+ analysis_input_sha256,
9
+ canonical_profile_json,
10
+ decode_incident_json,
11
+ decode_incident_protobuf,
12
+ decode_json,
13
+ decode_protobuf,
14
+ encode_incident_json,
15
+ encode_incident_protobuf,
16
+ encode_json,
17
+ encode_protobuf,
18
+ )
19
+ from .context import ( # noqa: F401 - legacy direct attributes; import from earshot.context
20
+ ContextSnapshot,
21
+ current_context,
22
+ current_conversation,
23
+ current_operation,
24
+ is_instrumentation_suppressed,
25
+ suppress_instrumentation,
26
+ )
27
+ from .contract import ( # noqa: F401 - legacy direct attributes; import from earshot.contract
28
+ SCHEMA_VERSION,
29
+ SEMANTIC_PROFILE_VERSION,
30
+ Adapter,
31
+ AnalysisMetric,
32
+ AnalysisProjections,
33
+ AnalysisSummary,
34
+ AudioFormat,
35
+ AudioStream,
36
+ BundleManifest,
37
+ ByteRange,
38
+ CaptureClassPolicy,
39
+ CausalLink,
40
+ ClockDomain,
41
+ ConsentRecord,
42
+ Coverage,
43
+ DerivedAnalysis,
44
+ Diagnosis,
45
+ ErrorRecord,
46
+ Event,
47
+ Evidence,
48
+ ExportPolicy,
49
+ IncidentBundle,
50
+ IncidentBundleJson,
51
+ IncidentProfile,
52
+ InterruptionProjection,
53
+ JsonRawOtlpChunk,
54
+ MediaLocator,
55
+ MediaRef,
56
+ Omission,
57
+ Operation,
58
+ Participant,
59
+ PrivacyManifest,
60
+ Producer,
61
+ QualityMeasurement,
62
+ QualitySample,
63
+ RawOtlpChunk,
64
+ RedactionRecord,
65
+ RetentionPolicy,
66
+ Session,
67
+ TimePoint,
68
+ TimeRange,
69
+ ToolAnalysis,
70
+ TurnMetrics,
71
+ TurnProjection,
72
+ )
73
+ from .pipeline import PipelineSession, TurnRecorder, pipeline # noqa: F401
74
+ from .privacy import ( # noqa: F401 - legacy direct attributes; import from earshot.privacy
75
+ CaptureClass,
76
+ CaptureGovernance,
77
+ CapturePolicy,
78
+ ConsentConfig,
79
+ ExportConfig,
80
+ ExportPolicyError,
81
+ RedactionConfig,
82
+ RetentionConfig,
83
+ assert_export_allowed,
84
+ )
85
+ from .recorder import IncidentRecorder, RecorderConfig, RecorderStatus # noqa: F401
86
+ from .sdk import ( # noqa: F401 - configure remains a compatibility attribute
87
+ Client,
88
+ ClientStatus,
89
+ SamplingDecision,
90
+ SdkConfig,
91
+ configure,
92
+ conversation,
93
+ flush,
94
+ get_client,
95
+ init,
96
+ session,
97
+ shutdown,
98
+ status,
99
+ )
100
+ from .validation import ( # noqa: F401 - legacy; import from earshot.validation
101
+ IncidentValidationError,
102
+ ValidationIssue,
103
+ ValidationReport,
104
+ assert_valid_incident,
105
+ validate_derived_analysis,
106
+ validate_incident,
107
+ )
108
+
109
+ __all__ = [
110
+ "CaptureClass",
111
+ "CapturePolicy",
112
+ "Client",
113
+ "ClientStatus",
114
+ "SamplingDecision",
115
+ "SdkConfig",
116
+ "conversation",
117
+ "flush",
118
+ "get_client",
119
+ "init",
120
+ "pipeline",
121
+ "session",
122
+ "shutdown",
123
+ "status",
124
+ "suppress_instrumentation",
125
+ ]
@@ -0,0 +1,11 @@
1
+ """Optional framework adapters.
2
+
3
+ Importing :mod:`earshot` never imports optional framework dependencies. Adapter
4
+ modules use duck-typed source records so their mapping logic remains testable
5
+ without installing a voice runtime.
6
+ """
7
+
8
+ from .livekit import LiveKitAdapter
9
+ from .pipecat import PipecatAdapter
10
+
11
+ __all__ = ["LiveKitAdapter", "PipecatAdapter"]
@@ -0,0 +1,26 @@
1
+ from __future__ import annotations
2
+
3
+ import hashlib
4
+ from collections.abc import Mapping
5
+ from typing import Any
6
+
7
+
8
+ class AdapterDependencyError(RuntimeError):
9
+ pass
10
+
11
+
12
+ def value(source: object, name: str, default: Any = None) -> Any:
13
+ if isinstance(source, Mapping):
14
+ return source.get(name, default)
15
+ return getattr(source, name, default)
16
+
17
+
18
+ def stable_id(prefix: str, *parts: object) -> str:
19
+ digest = hashlib.sha256("\x1f".join(map(str, parts)).encode()).hexdigest()[:24]
20
+ return f"{prefix}-{digest}"
21
+
22
+
23
+ def seconds_to_nano(value_in_seconds: object) -> int | None:
24
+ if isinstance(value_in_seconds, (int, float)) and value_in_seconds >= 0:
25
+ return round(float(value_in_seconds) * 1_000_000_000)
26
+ return None