diff --git a/src/memory_manager/api/schemas.py b/src/memory_manager/api/schemas.py index 21a693d..77262aa 100644 --- a/src/memory_manager/api/schemas.py +++ b/src/memory_manager/api/schemas.py @@ -1,79 +1 @@ -"""Pydantic schemas for API request/response validation.""" - -from datetime import datetime -from typing import Any - -from pydantic import BaseModel, Field - -from memory_manager.db.models import MemoryCategory - - -class MemoryEntryCreate(BaseModel): - title: str = Field(..., min_length=1, max_length=255) - content: str = Field(..., min_length=1) - category: MemoryCategory - tags: list[str] = Field(default_factory=list) - agent_id: str | None = None - project_path: str | None = None - - -class MemoryEntryUpdate(BaseModel): - title: str | None = Field(None, min_length=1, max_length=255) - content: str | None = Field(None, min_length=1) - category: MemoryCategory | None = None - tags: list[str] | None = None - - -class MemoryEntryResponse(BaseModel): - id: int - title: str - content: str - category: str - tags: list[str] - agent_id: str - project_path: str - created_at: datetime | None - updated_at: datetime | None - - -class SearchQuery(BaseModel): - q: str = Field(..., min_length=1) - category: MemoryCategory | None = None - agent_id: str | None = None - project_path: str | None = None - limit: int = Field(default=100, ge=1, le=1000) - - -class CommitCreate(BaseModel): - message: str = Field(..., min_length=1) - agent_id: str | None = None - project_path: str | None = None - - -class CommitResponse(BaseModel): - id: int - hash: str - message: str - agent_id: str - project_path: str - snapshot: list[dict[str, Any]] - created_at: datetime | None - - -class DiffResponse(BaseModel): - commit1: dict[str, Any] - commit2: dict[str, Any] - added: list[dict[str, Any]] - removed: list[dict[str, Any]] - modified: list[dict[str, Any]] - - -class HealthResponse(BaseModel): - status: str - version: str - - -class StatsResponse(BaseModel): - total_entries: int - entries_by_category: dict[str, int] - total_commits: int +schemas content \ No newline at end of file