repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | from abc import ABC, abstractmethod |
| #2 | from typing import Literal, Optional |
| #3 | |
| #4 | from mem0.configs.embeddings.base import BaseEmbedderConfig |
| #5 | |
| #6 | |
| #7 | class EmbeddingBase(ABC): |
| #8 | """Initialized a base embedding class |
| #9 | |
| #10 | :param config: Embedding configuration option class, defaults to None |
| #11 | :type config: Optional[BaseEmbedderConfig], optional |
| #12 | """ |
| #13 | |
| #14 | def __init__(self, config: Optional[BaseEmbedderConfig] = None): |
| #15 | if config is None: |
| #16 | self.config = BaseEmbedderConfig() |
| #17 | else: |
| #18 | self.config = config |
| #19 | |
| #20 | @abstractmethod |
| #21 | def embed(self, text, memory_action: Optional[Literal["add", "search", "update"]]): |
| #22 | """ |
| #23 | Get the embedding for the given text. |
| #24 | |
| #25 | Args: |
| #26 | text (str): The text to embed. |
| #27 | memory_action (optional): The type of embedding to use. Must be one of "add", "search", or "update". Defaults to None. |
| #28 | Returns: |
| #29 | list: The embedding vector. |
| #30 | """ |
| #31 | pass |
| #32 |