Interface for embedding models.
| 6 | |
| 7 | |
| 8 | class EmbeddingProvider(abc.ABC): |
| 9 | """Interface for embedding models.""" |
| 10 | |
| 11 | @abc.abstractmethod |
| 12 | def embed_query(self, text: str) -> List[float]: |
| 13 | """Embed query text.""" |
| 14 | |
| 15 | @abc.abstractmethod |
| 16 | def get_embedding_dim(self) -> int: |
| 17 | """Get the embedding dimensions.""" |
| 18 | pass |
| 19 | |
| 20 | @abc.abstractmethod |
| 21 | def init_provider(self, provider_cfg) -> None: |
| 22 | """Initialize a provider via a json config.""" |
| 23 | pass |
nothing calls this directly
no outgoing calls
no test coverage detected