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.
- earshot/__init__.py +125 -0
- earshot/adapters/__init__.py +11 -0
- earshot/adapters/base.py +26 -0
- earshot/adapters/livekit.py +2084 -0
- earshot/adapters/pipecat.py +819 -0
- earshot/adapters/providers/__init__.py +15 -0
- earshot/adapters/providers/base.py +201 -0
- earshot/adapters/providers/cartesia.py +343 -0
- earshot/adapters/providers/deepgram.py +441 -0
- earshot/adapters/providers/openai_realtime.py +436 -0
- earshot/adapters/providers/sarvam.py +236 -0
- earshot/analysis.py +880 -0
- earshot/api.py +1410 -0
- earshot/browser_session.py +89 -0
- earshot/cli.py +371 -0
- earshot/clock.py +39 -0
- earshot/codec.py +318 -0
- earshot/connectors/__init__.py +38 -0
- earshot/connectors/elevenlabs.py +504 -0
- earshot/connectors/kernel.py +288 -0
- earshot/connectors/retell.py +301 -0
- earshot/connectors/ringg.py +269 -0
- earshot/connectors/types.py +148 -0
- earshot/connectors/vapi.py +343 -0
- earshot/context.py +129 -0
- earshot/contract.py +641 -0
- earshot/explanation.py +308 -0
- earshot/exporter.py +1183 -0
- earshot/generated/__init__.py +0 -0
- earshot/generated/earshot/__init__.py +0 -0
- earshot/generated/earshot/v1alpha1/__init__.py +0 -0
- earshot/generated/earshot/v1alpha1/incident_pb2.py +38 -0
- earshot/measurement_semantics.py +54 -0
- earshot/pipeline.py +676 -0
- earshot/privacy.py +1137 -0
- earshot/py.typed +1 -0
- earshot/recorder.py +1948 -0
- earshot/sdk.py +1292 -0
- earshot/storage.py +3110 -0
- earshot/validation.py +2235 -0
- earshot/versions.py +15 -0
- earshot/web/assets/index-DXBWyP_c.js +60 -0
- earshot/web/assets/index-DolUwwS_.css +1 -0
- earshot/web/index.html +13 -0
- earshot_observability-0.1.0.dist-info/METADATA +222 -0
- earshot_observability-0.1.0.dist-info/RECORD +49 -0
- earshot_observability-0.1.0.dist-info/WHEEL +4 -0
- earshot_observability-0.1.0.dist-info/entry_points.txt +2 -0
- 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"]
|
earshot/adapters/base.py
ADDED
|
@@ -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
|