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]]

embed_query(text: str) List[float][source]#

Generate an embedding for a single query text.

Parameters:

text (str) – The query text to generate an embedding for.

Returns:

The embedding for the input query text.

Return type:

List[float]