mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-26 03:44:58 +08:00
14 lines
451 B
Python
14 lines
451 B
Python
from sqlalchemy import Column, Integer, ForeignKey, LargeBinary
|
|
from sqlalchemy.orm import declarative_base, relationship
|
|
|
|
Base = declarative_base()
|
|
|
|
|
|
class Vector(Base):
|
|
__tablename__ = 'vectors'
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
chunk_id = Column(Integer, ForeignKey('chunks.id'), unique=True)
|
|
embedding = Column(LargeBinary) # Store embeddings as binary
|
|
|
|
chunk = relationship('Chunk', back_populates='vector')
|