Initial DocsMCP stack

This commit is contained in:
george
2026-06-05 23:02:55 +01:00
commit 421b6f973a
51 changed files with 7414 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
# Data Models for document processing and API responses
from typing import Any, Dict, List, Optional
class DocumentChunk:
"""Represents a chunk of text to be embedded."""
def __init__(
self,
text: str,
metadata: Optional[Dict[str, Any]] = None
):
self.text = text
self.metadata = metadata or {}
@property
def doc_id(self) -> str:
"""Generate a document ID from content."""
return f"doc-{hash(self.text)}"
class IngestResponse:
"""Response model for document ingestion."""
def __init__(
self,
success: bool,
chunks_count: int = 0,
error: Optional[str] = None
):
self.success = success
self.chunks_count = chunks_count
self.error = error
class SearchResponse:
"""Response model for search results."""
def __init__(
self,
results: List[Dict[str, Any]],
query: str,
total_results: int
):
self.results = results
self.query = query
self.total_results = total_results