Revert "feat(knowledgebase): replace litellm-pgvector connector with memory-retrieval"
This reverts commitabeadc49c8. Restores vendor/litellm-pgvector/ and the vector_store_registry wiring (in-band file_search tool-call support) at the user's request, after re-confirming against docs.litellm.ai/docs/completion/knowledgebase and litellm-pgvector's own README that pg_vector is still not an in-process vector_store_registry backend -- it requires this same standalone connector service either way, so there is no simpler 'native' path that was missed. Trading back in: 793 lines of vendored code, the untested Prisma migration, and the git-context build risk noted in VENDORED.md (all flagged as unverified against real hardware in issue #24), in exchange for the file_search in-band tool call memory-retrieval did not support. Conflicts resolved on top of later commits (Redis, update.sh key-minting fold-in): - .env.example / docs/memory-knowledgebase.md: kept the auto-mint-via- update.sh language, renamed MEMORY_RETRIEVAL_* back to LITELLM_PGVECTOR_*. - scripts/generate-secrets.sh: left deleted -- its job was folded into update.sh in24d749b, unrelated to this revert. - scripts/update.sh: renamed the MEMORY_RETRIEVAL_* secret/mint calls to LITELLM_PGVECTOR_* to match. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WHfjWrSEcGhCoeu6dQfDa
This commit is contained in:
Vendored
+86
@@ -0,0 +1,86 @@
|
||||
from typing import Optional, Dict, Any, List
|
||||
from pydantic import BaseModel
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class VectorStoreCreateRequest(BaseModel):
|
||||
name: str
|
||||
file_ids: Optional[List[str]] = None
|
||||
expires_after: Optional[Dict[str, Any]] = None
|
||||
chunking_strategy: Optional[Dict[str, Any]] = None
|
||||
metadata: Optional[Dict[str, Any]] = None
|
||||
|
||||
|
||||
class VectorStoreResponse(BaseModel):
|
||||
id: str
|
||||
object: str = "vector_store"
|
||||
created_at: int
|
||||
name: str
|
||||
usage_bytes: int
|
||||
file_counts: Dict[str, int]
|
||||
status: str
|
||||
expires_after: Optional[Dict[str, Any]] = None
|
||||
expires_at: Optional[int] = None
|
||||
last_active_at: Optional[int] = None
|
||||
metadata: Optional[Dict[str, Any]] = None
|
||||
|
||||
|
||||
class VectorStoreSearchRequest(BaseModel):
|
||||
query: str
|
||||
limit: Optional[int] = 20
|
||||
filters: Optional[Dict[str, Any]] = None
|
||||
return_metadata: Optional[bool] = True
|
||||
|
||||
|
||||
class ContentChunk(BaseModel):
|
||||
type: str = "text"
|
||||
text: str
|
||||
|
||||
|
||||
class SearchResult(BaseModel):
|
||||
file_id: str
|
||||
filename: str
|
||||
score: float
|
||||
attributes: Optional[Dict[str, Any]] = None
|
||||
content: List[ContentChunk]
|
||||
|
||||
|
||||
class VectorStoreSearchResponse(BaseModel):
|
||||
object: str = "vector_store.search_results.page"
|
||||
search_query: str
|
||||
data: List[SearchResult]
|
||||
has_more: bool = False
|
||||
next_page: Optional[str] = None
|
||||
|
||||
|
||||
class EmbeddingCreateRequest(BaseModel):
|
||||
content: str
|
||||
embedding: List[float]
|
||||
metadata: Optional[Dict[str, Any]] = None
|
||||
|
||||
|
||||
class EmbeddingResponse(BaseModel):
|
||||
id: str
|
||||
object: str = "embedding"
|
||||
vector_store_id: str
|
||||
content: str
|
||||
metadata: Optional[Dict[str, Any]] = None
|
||||
created_at: int
|
||||
|
||||
|
||||
class EmbeddingBatchCreateRequest(BaseModel):
|
||||
embeddings: List[EmbeddingCreateRequest]
|
||||
|
||||
|
||||
class EmbeddingBatchCreateResponse(BaseModel):
|
||||
object: str = "embedding.batch"
|
||||
data: List[EmbeddingResponse]
|
||||
created: int
|
||||
|
||||
|
||||
class VectorStoreListResponse(BaseModel):
|
||||
object: str = "list"
|
||||
data: List[VectorStoreResponse]
|
||||
first_id: Optional[str] = None
|
||||
last_id: Optional[str] = None
|
||||
has_more: bool = False
|
||||
Reference in New Issue
Block a user