diff --git a/backend/app/schemas/knowledge.py b/backend/app/schemas/knowledge.py new file mode 100644 index 0000000..1c4e211 --- /dev/null +++ b/backend/app/schemas/knowledge.py @@ -0,0 +1,34 @@ +"""Knowledge base schemas.""" +from pydantic import BaseModel, Field +from typing import Optional, List +from datetime import datetime + + +class KnowledgeCreate(BaseModel): + title: str = Field(..., min_length=1, max_length=500) + content: str = "" + doc_type: str = "text" + source: str = "" + tags: str = "" + project_id: Optional[int] = None + + +class KnowledgeResponse(BaseModel): + id: int + project_id: Optional[int] = None + title: str + content: str + doc_type: str + source: str + tags: str + tenant_id: int + created_at: datetime + + model_config = {"from_attributes": True} + + +class KnowledgeSearchResult(BaseModel): + doc_id: int + title: str + snippet: str + score: float