Abc
pipelines.extraction.llama.abc
Summary
Abstract contracts for the llama (structured-objects) extraction graph.
The llama family is "tabular-like" but the front stage differs: instead of reading table rows it starts from a LIST OF ALREADY-STRUCTURED OBJECTS (one per transaction — what LlamaCloud returns, or the cached fixture CSV standing in for it). The downstream stages reuse the shared core:
LlamaObjectsReaderPort: list of objects -> filtered records (drops B/F marker rows + pre-marker header rows, port of OGBucketFinderAdaptor.filter_txn_rows).LlamaExtractionPipeline: root matching the tabular run-driver shape, but routed throughobjects_readerinstead oftable_reader. It reusesImplIngestPort(list pass-through),ObjectsTxnDictsPort(stated balances trusted) andImplRawExpensePort.
Bank-specific wiring lives under banks/.
Classes
LlamaExtractionPipeline
Bases: ABC
Root — objects chain: ingest → objects_reader → txn_dicts → raw_expense.
Slot annotations
source: ExtractionSource ingest: IngestPort objects_reader: LlamaObjectsReaderPort txn_dicts: ObjectsTxnDictsPort raw_expense: RawExpensePort
Attributes:
| Name | Type | Description |
|---|---|---|
source |
ExtractionSource
|
The extraction source descriptor. |
pipeline |
str
|
Pipeline tag ("llama"). |
ingest |
IngestPort
|
Ingest stage. |
objects_reader |
LlamaObjectsReaderPort
|
Objects-reading stage. |
txn_dicts |
ObjectsTxnDictsPort
|
Objects-to-txn-dicts stage. |
raw_expense |
RawExpensePort
|
Terminal raw-expense stage. |
Functions
run
Run the llama objects extraction chain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source |
Raw extraction source. |
required |
Returns:
| Type | Description |
|---|---|
List[Any]
|
List[Any]: Raw expense records. |
LlamaObjectsReaderPort
Bases: ABC
list of structured objects → list of filtered records (in order).
Functions
read
abstractmethod
Read structured objects, dropping marker and header rows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
objects |
List of structured statement objects. |
required |
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List[Dict[str, Any]]: Filtered records in order. |