haiku.rag/src/haiku/rag/embeddings/base.py
2025-06-15 21:27:20 +02:00

12 lines
316 B
Python

import functools
class EmbedderBase:
_model: str = ""
_vector_dim: int = 0
@functools.lru_cache(maxsize=128)
async def embed(self, text: str) -> list[float]:
raise NotImplementedError(
"Embedder is an abstract class. Please implement the embed method in a subclass."
)