Coverage for /home/admin/Documents/AI/applications/lexigram-dev/lexigram/experimental/ai/lexigram-ai-rag/src/lexigram/ai/rag/pipeline/base.py: 100%
7 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-25 07:19 +0800
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-25 07:19 +0800
1"""Base protocol and interfaces for pipeline stages."""
3from __future__ import annotations
5from typing import Protocol
7from lexigram.ai.rag.pipeline.types import PipelineContext
10class PipelineStageProtocol(Protocol):
11 """Protocol for pipeline stages.
13 Each stage processes the context and returns an updated context.
14 Stages should be independent and idempotent where possible.
15 """
17 async def process(self, context: PipelineContext) -> PipelineContext:
18 """Process the pipeline context.
20 Args:
21 context: The current pipeline context
23 Returns:
24 Updated pipeline context
26 Raises:
27 Exception: If stage processing fails and error strategy is FAIL_FAST
28 """
29 ...
31 @property
32 def name(self) -> str:
33 """Get the stage name.
35 Returns:
36 Name of the stage
37 """
38 ...