nemoguardrails.embeddings.providers.base

View as Markdown

Module Contents

Classes

NameDescription
EmbeddingModelGeneric interface for an embedding model.

API

class nemoguardrails.embeddings.providers.base.EmbeddingModel()
Abstract

Generic interface for an embedding model.

The embedding model is responsible for creating the embeddings given a list of input texts.

engine_name
Optional[str] = None
nemoguardrails.embeddings.providers.base.EmbeddingModel.encode(
documents: typing.List[str]
) -> typing.List[typing.List[float]]
abstract

Encode the provided documents into embeddings.

Parameters:

documents
List[str]

The list of documents for which embeddings should be created.

Returns: List[List[float]]

List[List[float]]: The list of embeddings corresponding to the input documents.

nemoguardrails.embeddings.providers.base.EmbeddingModel.encode_async(
documents: typing.List[str]
) -> typing.List[typing.List[float]]
asyncabstract

Encode the provided documents into embeddings.

Parameters:

documents
List[str]

The list of documents for which embeddings should be created.

Returns: List[List[float]]

List[List[float]]: The list of embeddings corresponding to the input documents.