base
Base classes for composable Rago pipelines.
Classes:
-
ParametersBase–Base class for declarative step configuration.
-
Pipeline–Composable pipeline of arbitrary Rago steps.
-
PipelineBase–Base pipeline class that can be built declaratively.
-
StepBase–Abstract base for all pipeline steps.
Functions:
-
config_to_dict–Normalize step configuration objects into a plain dictionary.
-
ensure_list–Normalize scalar or iterable values into a list.
ParametersBase
ParametersBase(**kwargs: Any)
Bases: UserDict[str, Any]
Base class for declarative step configuration.
Methods:
-
apply–Merge additional configuration into this object.
-
process–Return the input unchanged for configuration-only objects.
Attributes:
-
params(dict[str, Any]) –Expose the underlying parameter mapping.
Source code in src/rago/base.py
62 63 | |
params
property
params: dict[str, Any]
Expose the underlying parameter mapping.
apply
apply(parameters: Any) -> None
Merge additional configuration into this object.
Source code in src/rago/base.py
86 87 88 | |
Pipeline
Pipeline()
Bases: PipelineBase
Composable pipeline of arbitrary Rago steps.
Methods:
-
process–Run this pipeline when embedded as a step.
-
prompt–Run the pipeline and return the primary result value.
-
run–Run all configured steps for the given query and source.
Source code in src/rago/base.py
102 103 104 | |
process
Run this pipeline when embedded as a step.
Source code in src/rago/base.py
137 138 139 140 141 142 143 144 145 146 | |
prompt
prompt(
query: str,
source: Any = None,
data: Any = None,
**kwargs: Any,
) -> Any
Run the pipeline and return the primary result value.
Source code in src/rago/base.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
run
run(
query: str = '',
source: Any = None,
data: Any = None,
**kwargs: Any,
) -> Output
Run all configured steps for the given query and source.
Source code in src/rago/base.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | |
PipelineBase
PipelineBase()
Bases: ABC
Base pipeline class that can be built declaratively.
Methods:
Source code in src/rago/base.py
102 103 104 | |
process
Run this pipeline when embedded as a step.
Source code in src/rago/base.py
137 138 139 140 141 142 143 144 145 146 | |
run
abstractmethod
run(
query: str = '',
source: Any = None,
data: Any = None,
**kwargs: Any,
) -> Output
Run the pipeline.
Source code in src/rago/base.py
127 128 129 130 131 132 133 134 135 | |
StepBase
StepBase()
Bases: ABC
Abstract base for all pipeline steps.
Methods:
Source code in src/rago/base.py
154 155 156 | |
apply
apply(parameters: Any) -> None
Apply attached configuration to the step.
Source code in src/rago/base.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | |
config_to_dict
config_to_dict(parameters: Any) -> dict[str, Any]
Normalize step configuration objects into a plain dictionary.
Source code in src/rago/base.py
32 33 34 35 36 37 38 39 40 | |
ensure_list
ensure_list(value: Any) -> list[Any]
Normalize scalar or iterable values into a list.
Source code in src/rago/base.py
43 44 45 46 47 48 49 50 51 52 53 54 55 | |