Spaces:
Running
Running
add temp db warning to vector store responses
Browse files- app/api/v1/vector_stores.py +6 -1
- app/models/schemas.py +1 -0
- deploy.py +1 -0
app/api/v1/vector_stores.py
CHANGED
|
@@ -6,6 +6,7 @@ import time
|
|
| 6 |
from fastapi import APIRouter, Depends, File, Form, HTTPException, Query, UploadFile, status
|
| 7 |
|
| 8 |
from app.api.deps import get_vector_store_service, require_auth
|
|
|
|
| 9 |
from app.core.logger import get_logger
|
| 10 |
from app.models.domain import ConversionError
|
| 11 |
from app.models.schemas import (
|
|
@@ -70,6 +71,7 @@ async def create_vector_store(
|
|
| 70 |
document_count=stats["document_count"],
|
| 71 |
created_at=stats["created_at"],
|
| 72 |
metadata=stats["metadata"],
|
|
|
|
| 73 |
)
|
| 74 |
|
| 75 |
|
|
@@ -99,6 +101,7 @@ async def list_vector_stores(
|
|
| 99 |
document_count=stats.get("document_count", 0),
|
| 100 |
created_at=r.created_at,
|
| 101 |
metadata=r.metadata,
|
|
|
|
| 102 |
))
|
| 103 |
return VectorStoreListResponse(success=True, total=len(stores), stores=stores)
|
| 104 |
|
|
@@ -126,7 +129,8 @@ async def get_vector_store(
|
|
| 126 |
embedding_dimension=stats["embedding_dimension"],
|
| 127 |
document_count=stats["document_count"],
|
| 128 |
created_at=stats["created_at"],
|
| 129 |
-
metadata=stats["
|
|
|
|
| 130 |
)
|
| 131 |
|
| 132 |
|
|
@@ -154,6 +158,7 @@ async def delete_vector_store(
|
|
| 154 |
document_count=0,
|
| 155 |
embedding_dimension=0,
|
| 156 |
created_at=record.created_at,
|
|
|
|
| 157 |
)
|
| 158 |
|
| 159 |
|
|
|
|
| 6 |
from fastapi import APIRouter, Depends, File, Form, HTTPException, Query, UploadFile, status
|
| 7 |
|
| 8 |
from app.api.deps import get_vector_store_service, require_auth
|
| 9 |
+
from app.core.auth.deps import get_temp_db_warning
|
| 10 |
from app.core.logger import get_logger
|
| 11 |
from app.models.domain import ConversionError
|
| 12 |
from app.models.schemas import (
|
|
|
|
| 71 |
document_count=stats["document_count"],
|
| 72 |
created_at=stats["created_at"],
|
| 73 |
metadata=stats["metadata"],
|
| 74 |
+
warning=get_temp_db_warning(),
|
| 75 |
)
|
| 76 |
|
| 77 |
|
|
|
|
| 101 |
document_count=stats.get("document_count", 0),
|
| 102 |
created_at=r.created_at,
|
| 103 |
metadata=r.metadata,
|
| 104 |
+
warning=get_temp_db_warning(),
|
| 105 |
))
|
| 106 |
return VectorStoreListResponse(success=True, total=len(stores), stores=stores)
|
| 107 |
|
|
|
|
| 129 |
embedding_dimension=stats["embedding_dimension"],
|
| 130 |
document_count=stats["document_count"],
|
| 131 |
created_at=stats["created_at"],
|
| 132 |
+
metadata=stats["metadata_json"],
|
| 133 |
+
warning=get_temp_db_warning(),
|
| 134 |
)
|
| 135 |
|
| 136 |
|
|
|
|
| 158 |
document_count=0,
|
| 159 |
embedding_dimension=0,
|
| 160 |
created_at=record.created_at,
|
| 161 |
+
warning=get_temp_db_warning(),
|
| 162 |
)
|
| 163 |
|
| 164 |
|
app/models/schemas.py
CHANGED
|
@@ -585,6 +585,7 @@ class VectorStoreResponse(BaseModel):
|
|
| 585 |
document_count: int
|
| 586 |
created_at: str
|
| 587 |
metadata: Dict[str, Any] = {}
|
|
|
|
| 588 |
|
| 589 |
|
| 590 |
class VectorStoreListResponse(BaseModel):
|
|
|
|
| 585 |
document_count: int
|
| 586 |
created_at: str
|
| 587 |
metadata: Dict[str, Any] = {}
|
| 588 |
+
warning: Optional[Dict[str, str]] = None
|
| 589 |
|
| 590 |
|
| 591 |
class VectorStoreListResponse(BaseModel):
|
deploy.py
CHANGED
|
@@ -636,6 +636,7 @@ def run_deployment(args: argparse.Namespace, env: dict[str, str]) -> int:
|
|
| 636 |
audit.set("backup_size", total_bytes)
|
| 637 |
audit.set("backup_status", "passed")
|
| 638 |
print(f" {_OK_ICON} Files: {file_count} | Size: {_human_size(total_bytes)}")
|
|
|
|
| 639 |
|
| 640 |
# ──────────────────────────────────────────────
|
| 641 |
# PHASE 2: GIT COMMIT & PUSH
|
|
|
|
| 636 |
audit.set("backup_size", total_bytes)
|
| 637 |
audit.set("backup_status", "passed")
|
| 638 |
print(f" {_OK_ICON} Files: {file_count} | Size: {_human_size(total_bytes)}")
|
| 639 |
+
print(f" {_WARN_ICON} Data added after this point WILL BE LOST until restore completes")
|
| 640 |
|
| 641 |
# ──────────────────────────────────────────────
|
| 642 |
# PHASE 2: GIT COMMIT & PUSH
|