mirror of
https://github.com/run-llama/observability-blog-code.git
synced 2026-07-01 21:54:01 -04:00
20 lines
659 B
Python
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) |