models¶
models ¶
Core data models for execution results and metadata.
These models represent the outputs and state information from pipeline execution with type safety.
LLMResponse
dataclass
¶
LLMResponse(text: str, tokens_in: int, tokens_out: int, model: str, cost: Decimal, latency_ms: float, metadata: dict[str, Any] = dict())
Response from a single LLM invocation.
CostEstimate
dataclass
¶
CostEstimate(total_cost: Decimal, total_tokens: int, input_tokens: int, output_tokens: int, rows: int, breakdown_by_stage: dict[str, Decimal] = dict(), confidence: str = 'estimate')
Cost estimation for pipeline execution.
ProcessingStats
dataclass
¶
ProcessingStats(total_rows: int, processed_rows: int, failed_rows: int, skipped_rows: int, rows_per_second: float, total_duration_seconds: float, stage_durations: dict[str, float] = dict())
Statistics from pipeline execution.
ErrorInfo
dataclass
¶
ErrorInfo(row_index: int, stage_name: str, error_type: str, error_message: str, timestamp: datetime, context: dict[str, Any] = dict())
Information about an error during processing.
ExecutionResult
dataclass
¶
ExecutionResult(data: DataFrame, metrics: ProcessingStats, costs: CostEstimate, errors: list[ErrorInfo] = list(), execution_id: UUID = uuid4(), start_time: datetime = datetime.now(), end_time: datetime | None = None, success: bool = True, metadata: dict[str, Any] = dict())
Complete result from pipeline execution.
validate_output_quality ¶
Validate the quality of output data by checking for null/empty values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_columns
|
list[str]
|
List of output column names to check |
required |
Returns:
| Type | Description |
|---|---|
QualityReport
|
QualityReport with quality metrics and warnings |
Source code in ondine/core/models.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
QualityReport
dataclass
¶
WriteConfirmation
dataclass
¶
WriteConfirmation(path: str, rows_written: int, success: bool, timestamp: datetime = datetime.now(), metadata: dict[str, Any] = dict())
Confirmation of successful data write.
CheckpointInfo
dataclass
¶
CheckpointInfo(session_id: UUID, checkpoint_path: str, row_index: int, stage_index: int, timestamp: datetime, size_bytes: int)
Information about a checkpoint.
RowMetadata
dataclass
¶
RowMetadata(row_index: int, row_id: Any | None = None, batch_id: int | None = None, attempt: int = 1, custom: dict[str, Any] = dict())
Metadata for a single row during processing.
PromptBatch
dataclass
¶
Batch of prompts for processing.
ResponseBatch
dataclass
¶
ResponseBatch(responses: list[str], metadata: list[RowMetadata], tokens_used: int, cost: Decimal, batch_id: int, latencies_ms: list[float] = list())
Batch of responses from LLM.