Text embeddings are a way to represent text as a vector. This enables you to use strings of text in a more quantitative way. For example, with text embeddings, we can calculate the cosine similarity of two strings, use advanced similarity searches powered by vector stores and much more.
Seaplane has built-in support for text embeddings in tasks. To use them import
Seaplane embeddings support two function calls.
embed_query()- Takes a single string as input and transforms it into a vector.
embed_documents()- Takes a list of strings and transforms them into a list of vectors.
from seaplane.integrations.langchain import seaplane_embeddings
from seaplane import task
# embed a single string
seaplane_embeddings.embed_query("Embed this string")
# embed a list of strings
seaplane_embeddings.embed_documents(["embed this string", "also embed this string"])