fix document api

This commit is contained in:
phernandez
2024-12-21 22:53:55 -06:00
parent 1db97b59a4
commit f4bc0cabd9
4 changed files with 229 additions and 86 deletions
+4 -16
View File
@@ -1,16 +1,4 @@
"""Request schemas for interacting with the knowledge graph.
This module defines all the request schemas for creating, retrieving, and managing
knowledge graph entities. Each schema includes validation rules and clear examples
of proper usage.
Request Types:
1. Entity Creation - Create new nodes in the graph
2. Observation Addition - Add facts to existing entities
3. Relation Creation - Connect entities with typed edges
4. Node Search - Find entities across the graph
5. Node Retrieval - Load specific entities by ID
"""
"""Request schemas for interacting with the knowledge graph."""
from typing import List, Optional, Annotated, Dict, Any
@@ -220,14 +208,14 @@ class DocumentCreate(BaseModel):
class DocumentUpdate(BaseModel):
id: int
checksum: str
"""Update an existing document by ID."""
id: int # Document ID is required for updates
content: str
doc_metadata: Optional[Dict[str, Any]] = None
class DocumentPatch(BaseModel):
id: int
checksum: str
content: Optional[str] = None
doc_metadata: Optional[Dict[str, Any]] = None