Add config option for vertex embedding tasks (#2266)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Optional
|
||||
from typing import Literal, Optional
|
||||
|
||||
from sentence_transformers import SentenceTransformer
|
||||
|
||||
@@ -16,13 +16,13 @@ class HuggingFaceEmbedding(EmbeddingBase):
|
||||
|
||||
self.config.embedding_dims = self.config.embedding_dims or self.model.get_sentence_embedding_dimension()
|
||||
|
||||
def embed(self, text):
|
||||
def embed(self, text, memory_action:Optional[Literal["add", "search", "update"]] = None):
|
||||
"""
|
||||
Get the embedding for the given text using Hugging Face.
|
||||
|
||||
Args:
|
||||
text (str): The text to embed.
|
||||
|
||||
memory_action (optional): The type of embedding to use. Must be one of "add", "search", or "update". Defaults to None.
|
||||
Returns:
|
||||
list: The embedding vector.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user