diff --git a/app/schemas/__init__.py b/app/schemas/__init__.py index e69de29..2d03f4c 100644 --- a/app/schemas/__init__.py +++ b/app/schemas/__init__.py @@ -0,0 +1,4 @@ +from app.schemas.file import * +from app.schemas.content import * +from app.schemas.relationship import * +from app.schemas.document import * \ No newline at end of file diff --git a/app/schemas/content.py b/app/schemas/content.py new file mode 100644 index 0000000..d85f947 --- /dev/null +++ b/app/schemas/content.py @@ -0,0 +1,20 @@ +from uuid import UUID +from pydantic import BaseModel, ConfigDict + + +class ContentBase(BaseModel): + file_id: UUID + + chunk_index: int + + content_text: str + + +class ContentCreate(ContentBase): + pass + + +class ContentResponse(ContentBase): + id: UUID + + model_config = ConfigDict(from_attributes=True) \ No newline at end of file diff --git a/app/schemas/file.py b/app/schemas/file.py new file mode 100644 index 0000000..a392399 --- /dev/null +++ b/app/schemas/file.py @@ -0,0 +1,28 @@ +from uuid import UUID +from datetime import datetime +from pydantic import BaseModel, ConfigDict + + +class FileBase(BaseModel): + file_path: str + + +class FileCreate(FileBase): + pass + + +class FileResponse(BaseModel): + id: UUID + + file_path: str + file_hash: str + + mime_type: str + + last_modified: datetime + + indexed_at: datetime + + tags: list[str] + + model_config = ConfigDict(from_attributes=True) \ No newline at end of file diff --git a/app/schemas/relationship.py b/app/schemas/relationship.py new file mode 100644 index 0000000..cb6e1d7 --- /dev/null +++ b/app/schemas/relationship.py @@ -0,0 +1,19 @@ +from uuid import UUID +from pydantic import BaseModel, ConfigDict + + +class RelationshipBase(BaseModel): + source_file_id: UUID + target_file_id: UUID + similarity_score: float + + +class RelationshipCreate(RelationshipBase): + pass + + +class RelationshipResponse(RelationshipBase): + id: UUID + relation_type: str + + model_config = ConfigDict(from_attributes=True) \ No newline at end of file