EmbeddingServiceAdapter#
- class langchain_elasticsearch.embeddings.EmbeddingServiceAdapter(langchain_embeddings: Embeddings)[source]#
Adapter for LangChain Embeddings to support the EmbeddingService interface from elasticsearch.helpers.vectorstore.
Methods
__init__
(langchain_embeddings)embed_documents
(texts)Generate embeddings for a list of documents.
embed_query
(text)Generate an embedding for a single query text.
- Parameters:
langchain_embeddings (Embeddings)
- __init__(langchain_embeddings: Embeddings)[source]#
- Parameters:
langchain_embeddings (Embeddings)
- embed_documents(texts: List[str]) List[List[float]] [source]#
Generate embeddings for a list of documents.
- Parameters:
texts (List[str]) – A list of document text strings to generate embeddings for.
- Returns:
- A list of embeddings, one for each document in the input
list.
- Return type:
List[List[float]]