Spaces:
Sleeping
Sleeping
Jatin Mehra commited on
Commit ·
e07bb41
1
Parent(s): d615a43
Add models and routes initialization for chat functionality
Browse files- backend/models.py +26 -0
- backend/routes/__init__.py +12 -0
backend/models.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pydantic import BaseModel
|
| 2 |
+
from typing import List, Dict, Any
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class ChatMessage(BaseModel):
|
| 6 |
+
message: str
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
class ChatResponse(BaseModel):
|
| 10 |
+
response: str
|
| 11 |
+
citations: List[Dict[str, Any]]
|
| 12 |
+
themes: Dict[str, Any]
|
| 13 |
+
timestamp: str
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class ProcessingStats(BaseModel):
|
| 17 |
+
total_files: int
|
| 18 |
+
total_documents: int
|
| 19 |
+
total_chunks: int
|
| 20 |
+
file_types: List[str]
|
| 21 |
+
type_counts: Dict[str, int]
|
| 22 |
+
processed_at: str
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
class APIKeyRequest(BaseModel):
|
| 26 |
+
api_key: str
|
backend/routes/__init__.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
# Add parent directory to path for imports
|
| 5 |
+
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
| 6 |
+
|
| 7 |
+
from .main_routes import router as main_router
|
| 8 |
+
from .upload_routes import router as upload_router
|
| 9 |
+
from .chat_routes import router as chat_router
|
| 10 |
+
from .store_routes import router as store_router
|
| 11 |
+
|
| 12 |
+
__all__ = ["main_router", "upload_router", "chat_router", "store_router"]
|