Auto-Generated
Pipeline Stages
RdaktStage, DetectorStage, and aliases
RdaktStage (ABC)
Base class for pipeline stages. Implement both process (async) and process_sync methods.
from rdakt_ai import RdaktStageAbstract Methods
async def process(
self, text: str, context: RdaktContext, call_next: CallNext
) -> None: ...
def process_sync(
self, text: str, context: RdaktContext, call_next_sync: CallNextSync
) -> None: ...| Parameter | Type | Description |
|---|---|---|
text | str | Input text to analyze |
context | RdaktContext | Mutable context — append entities here |
call_next / call_next_sync | Callable | Invoke the next stage in the chain |
DetectorStage
Wraps any Detector protocol implementation into a pipeline stage.
from rdakt_ai import DetectorStage, RegexDetector
stage = DetectorStage(RegexDetector())| Parameter | Type | Description |
|---|---|---|
detector | Detector | Object with a detect(text: str) -> list[Entity] method |
Detector Protocol
class Detector:
def detect(self, text: str) -> list[Entity]: ...Any object matching this protocol can be wrapped in DetectorStage.
Aliases
RegexStage = DetectorStage # Backwards compatibility
NerStage = DetectorStage # Backwards compatibility