Files
observability-blog-code/src/financial_classifier/events.py
T
Clelia (Astra) Bertelli ad1d6e34f0 first commit
2025-11-17 14:47:26 +01:00

20 lines
659 B
Python

from workflows.events import StartEvent, StopEvent, Event
from typing import Literal
from pydantic import ConfigDict
from .resources import CashflowStatement, IncomeStatement, BalanceSheet
class ProgressEvent(Event): # used to monitor progress
message: str
class InputDocumentEvent(StartEvent):
path: str
class ClassificationEvent(Event):
classification: Literal["income_statement", "cashflow_statement", "balance_sheet"]
reasons: str
class ExtractedDataEvent(StopEvent):
extracted_data: CashflowStatement | IncomeStatement | BalanceSheet | None
error: str | None = None
model_config = ConfigDict(arbitrary_types_allowed=True)