From 6b445be0161081a8af64e245ec7f53aac3ae6339 Mon Sep 17 00:00:00 2001 From: Sosokker Date: Mon, 12 May 2025 15:10:48 +0700 Subject: [PATCH] move pydantic model file structure --- pipeline/models/__init__.py | 0 pipeline/models/adapters.py | 25 +++++++++++++++++++++++++ pipeline/{ => models}/models.py | 0 3 files changed, 25 insertions(+) create mode 100644 pipeline/models/__init__.py create mode 100644 pipeline/models/adapters.py rename pipeline/{ => models}/models.py (100%) diff --git a/pipeline/models/__init__.py b/pipeline/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pipeline/models/adapters.py b/pipeline/models/adapters.py new file mode 100644 index 0000000..1f2c8dd --- /dev/null +++ b/pipeline/models/adapters.py @@ -0,0 +1,25 @@ +from typing import Any +from pydantic import BaseModel, Field + + +class AdapterRecord(BaseModel): + """ + Record output from each adapter. + """ + + source: str = Field(..., description="Source type") + data: dict[str, Any] = Field(..., description="Data output from the adapter") + + +class OutputData(BaseModel): + """ + Output data from a pipeline run. + """ + + records: list[AdapterRecord] = Field(..., description="List of adapter records") + unified: bool | None = Field( + default=False, description="Whether the records are unified" + ) + metadata: dict[str, Any] | None = Field( + default=None, description="Metadata about the run" + ) diff --git a/pipeline/models.py b/pipeline/models/models.py similarity index 100% rename from pipeline/models.py rename to pipeline/models/models.py