AutoEmbeddings#

class langchain_mongodb.embeddings.AutoEmbeddings(model: str)[source]#

Methods

__init__(model)

MongoDB AutoEmbeddings

aembed_documents(texts)

Asynchronous Embed search docs.

aembed_query(text)

Asynchronous Embed query text.

embed_documents(texts)

Embed search docs.

embed_query(text)

Embed query text.

Parameters:

model (str)

__init__(model: str)[source]#

MongoDB AutoEmbeddings

AutoEmbedding enables MongoDB to automatically generate and manage embedding vectors. Since the embedding happens on the server, this class doesn’t implement embed_documents or embed_query and simply requires a model name. For supported models, see https://www.mongodb.com/docs/atlas/atlas-vector-search/crud-embeddings/create-embeddings-automatic/?interface=driver&language=python&deployment-type=self#supported-embedding-models

Parameters:

model (str)

async aembed_documents(texts: list[str]) list[list[float]]#

Asynchronous Embed search docs.

Parameters:

texts (list[str]) – List of text to embed.

Returns:

List of embeddings.

Return type:

list[list[float]]

async aembed_query(text: str) list[float]#

Asynchronous Embed query text.

Parameters:

text (str) – Text to embed.

Returns:

Embedding.

Return type:

list[float]

embed_documents(texts: list[str]) list[list[float]][source]#

Embed search docs.

Parameters:

texts (list[str]) – List of text to embed.

Returns:

List of embeddings.

Return type:

list[list[float]]

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

Embed query text.

Parameters:

text (str) – Text to embed.

Returns:

Embedding.

Return type:

list[float]