chatbot-backend / src /embeddings /base_embedding.py
TalatMasood's picture
initial commit
640b1c8
raw
history blame
715 Bytes
# src/embeddings/base_embedding.py
from abc import ABC, abstractmethod
from typing import List, Union
class BaseEmbedding(ABC):
@abstractmethod
def embed_documents(self, texts: List[str]) -> List[List[float]]:
"""
Embed a list of documents
Args:
texts (List[str]): List of texts to embed
Returns:
List[List[float]]: List of embeddings
"""
pass
@abstractmethod
def embed_query(self, text: str) -> List[float]:
"""
Embed a single query
Args:
text (str): Text to embed
Returns:
List[float]: Embedding vector
"""
pass