)
documents = [
    "This is an example document.",
    "Another example document to generate embeddings for.",
]
embeddings_generator.embed_documents(documents)
pydantic model langchain.embeddings.EmbaasEmbeddings[source]#
Wrapper around embaas’s embedding service.
To use, you should have the
environment variable EMBAAS_API_KEY set with your API key, or pass
it as a named parameter to the constructor.
Example
# Initialise with default model and instruction
from langchain.embeddings import EmbaasEmbeddings
emb = EmbaasEmbeddings()
# Initialise with custom model and instruction
from langchain.embeddings import EmbaasEmbeddings
emb_model = "instructor-large"
emb_inst = "Represent the Wikipedia document for retrieval"
emb = EmbaasEmbeddings(
    model=emb_model,
    instruction=emb_inst
)
field api_url: str = 'https://api.embaas.io/v1/embeddings/'#
The URL for the embaas embeddings API.
field instruction: Optional[str] = None#
Instruction used for domain-specific embeddings.
field model: str = 'e5-large-v2'#
The model used for embeddings.
embed_documents(texts: List[str]) → List[List[float]][source]#
Get embeddings for a list of texts.
Parameters
texts – The list of texts to get embeddings for.
Returns
List of embeddings, one for each text.
embed_query(text: str) → List[float][source]#
Get embeddings for a single text.
Parameters
text – The text to get embeddings for.
Returns
List of embeddings.
pydantic model langchain.embeddings.FakeEmbeddings[source]#
embed_documents(texts: List[str]) → List[List[float]][source]#
Embed search docs.
rtdocs_stable/api.python.langchain.com/en/stable/reference/modules/embeddings.html