Added support for google vector search - (matching engine) (#2177)
This commit is contained in:
29
mem0/configs/vector_stores/vertex_ai_vector_search.py
Normal file
29
mem0/configs/vector_stores/vertex_ai_vector_search.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class GoogleMatchingEngineConfig(BaseModel):
|
||||
project_id: str = Field(description="Google Cloud project ID")
|
||||
project_number: str = Field(description="Google Cloud project number")
|
||||
region: str = Field(description="Google Cloud region")
|
||||
endpoint_id: str = Field(description="Vertex AI Vector Search endpoint ID")
|
||||
index_id: str = Field(description="Vertex AI Vector Search index ID")
|
||||
deployment_index_id: str = Field(description="Deployment-specific index ID")
|
||||
collection_name: Optional[str] = Field(None, description="Collection name, defaults to index_id")
|
||||
credentials_path: Optional[str] = Field(None, description="Path to service account credentials file")
|
||||
vector_search_api_endpoint: Optional[str] = Field(None, description="Vector search API endpoint")
|
||||
|
||||
model_config = {
|
||||
"extra": "forbid"
|
||||
}
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
if not self.collection_name:
|
||||
self.collection_name = self.index_id
|
||||
|
||||
def model_post_init(self, _context) -> None:
|
||||
"""Set collection_name to index_id if not provided"""
|
||||
if self.collection_name is None:
|
||||
self.collection_name = self.index_id
|
||||
Reference in New Issue
Block a user