NeMoEmbeddings#

class langchain_community.embeddings.nemo.NeMoEmbeddings[source]#

Bases: BaseModel, Embeddings

Deprecated since version 0.0.37: Directly instantiating a NeMoEmbeddings from langchain-community is deprecated. Please use langchain-nvidia-ai-endpoints NVIDIAEmbeddings interface. It will be removed in None==1.0.0.

NeMo embedding models.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param api_endpoint_url: str = 'http://localhost:8088/v1/embeddings'#
param batch_size: int = 16#
param model: str = 'NV-Embed-QA-003'#
async aembed_documents(texts: List[str]) β†’ List[List[float]][source]#

Call out to NeMo’s embedding endpoint async for embedding search docs.

Parameters:

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

Returns:

List of embeddings, one for each text.

Return type:

List[List[float]]

async aembed_query(text: str) β†’ List[float][source]#

Call out to NeMo’s embedding endpoint async for embedding query text.

Parameters:

text (str) – The text to embed.

Returns:

Embedding for the text.

Return type:

List[float]

embed_documents(documents: List[str]) β†’ List[List[float]][source]#

Embed a list of document texts.

Parameters:
  • texts – The list of texts to embed.

  • documents (List[str])

Returns:

List of embeddings, one for each text.

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]

classmethod validate_environment(values: Dict) β†’ Dict[source]#

Validate that the end point is alive using the values that are provided.

Parameters:

values (Dict)

Return type:

Dict

Examples using NeMoEmbeddings