continue-custom/server/continuedev/libs/index/vectordb.py
Nate Sesti a85cb30cf9
Nate/better embeddings (#564)
* ♻️ refactoring codebase index folder

* ➕ tree_sitter dependency

* 🐛 solve a few indexing bugs

* ⚡️ code chunker

* ✏️ automatically remove trailing / from serverUrl

* 🎨 introduce Chunk class

* 🎨 finish chunking refactor
2023-10-18 21:43:25 -07:00

21 lines
508 B
Python

from abc import ABC, abstractmethod
from typing import List
from .chunkers.chunk import Chunk
class VectorDB(ABC):
@abstractmethod
def query(query: str, n: int = 4) -> List[Chunk]:
raise NotImplementedError
@abstractmethod
def insert(chunks: List[Chunk]):
raise NotImplementedError
class ChromaVectorDB(VectorDB):
def query(self, query: str, n: int = 4):
raise NotImplementedError
def insert(self, chunks: List[Chunk]):
raise NotImplementedError