fix: Resolve import of optional package
Resolve issue with forced import of optional pgvector package. Fix COG-595
This commit is contained in:
parent
10dc6b1524
commit
f41228aa51
2 changed files with 3 additions and 2 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import asyncio
|
||||
from uuid import UUID
|
||||
from pgvector.sqlalchemy import Vector
|
||||
from typing import List, Optional, get_type_hints
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
from sqlalchemy import JSON, Column, Table, select, delete
|
||||
|
|
@ -68,6 +67,8 @@ class PGVectorAdapter(SQLAlchemyAdapter, VectorDBInterface):
|
|||
vector_size = self.embedding_engine.get_vector_size()
|
||||
|
||||
if not await self.has_collection(collection_name):
|
||||
|
||||
from pgvector.sqlalchemy import Vector
|
||||
class PGVectorDataPoint(Base):
|
||||
__tablename__ = collection_name
|
||||
__table_args__ = {"extend_existing": True}
|
||||
|
|
@ -105,6 +106,7 @@ class PGVectorAdapter(SQLAlchemyAdapter, VectorDBInterface):
|
|||
|
||||
vector_size = self.embedding_engine.get_vector_size()
|
||||
|
||||
from pgvector.sqlalchemy import Vector
|
||||
class PGVectorDataPoint(Base):
|
||||
__tablename__ = collection_name
|
||||
__table_args__ = {"extend_existing": True}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
from ...relational.ModelBase import Base
|
||||
from ..get_vector_engine import get_vector_engine, get_vectordb_config
|
||||
from sqlalchemy import text
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue