sparksearch-demo / SmartSearch /embedding_provider.py
teddyllm's picture
Upload 20 files
bd3532f verified
raw
history blame contribute delete
431 Bytes
from abc import ABC, abstractmethod
from typing import List
import numpy as np
class EmbeddingProvider(ABC):
"""
Abstract class for the llm providers
"""
@abstractmethod
def embed_documents(self, documents: List[str]) -> np.ndarray:
"""Embed a list of documents"""
pass
@abstractmethod
def embed_query(self, query: str) -> np.ndarray:
"""Embed a query"""
pass