src.dackar.RCA.adapters.similar_event_adapter¶
similar_event_adapter.py — Protocol definition for Step 2d similar-event adapters.
The orchestrator accepts any object satisfying SimilarEventAdapter to query fleet and industry OE databases. The concrete production implementation is LLMOEAdapter (llm_oe_adapter.py). Tests may supply any mock that satisfies the protocol.
Attributes¶
Classes¶
Pluggable interface for fleet and industry OE similar-event queries. |
Module Contents¶
- src.dackar.RCA.adapters.similar_event_adapter.TIER_CONFIDENCE_MULTIPLIERS: Dict[str, float][source]¶
- class src.dackar.RCA.adapters.similar_event_adapter.SimilarEventAdapter[source]¶
Bases:
ProtocolPluggable interface for fleet and industry OE similar-event queries.
The orchestrator calls
query()once for fleet and once for industry when an adapter is injected. Each call must return a list of dicts compatible with thesimilar_event_list.jsonevent item schema.Contract: - Never raise on network/timeout/parse errors; return
[]instead. - SetdegradedtoTrueon the adapter instance when a call failsso the orchestrator can record the degraded tier.
confidence_weighton returned records should be the raw match score (0–1) before tier discount; the orchestrator applies the multiplier defined inTIER_CONFIDENCE_MULTIPLIERS.
- query(*, level, asset_id, component_ids, failure_mode_ids, event_type=None, actuation_type=None, max_results=5, timeout_seconds=10.0)[source]¶
Return a list of similar-event dicts for the given tier.
- Parameters:
level (Literal['fleet', 'industry'])
asset_id (Optional[str])
component_ids (List[str])
failure_mode_ids (List[str])
event_type (Optional[str])
actuation_type (Optional[str])
max_results (int)
timeout_seconds (float)
- Return type:
List[JsonDict]