langchain.embeddings.gpt4all.GPT4AllEmbeddings¶

class langchain.embeddings.gpt4all.GPT4AllEmbeddings(*, client: Any = None)[source]¶

Bases: BaseModel, Embeddings

GPT4All embedding models.

To use, you should have the gpt4all python package installed

Example

from langchain.embeddings import GPT4AllEmbeddings

embeddings = GPT4AllEmbeddings()

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

Raises ValidationError if the input data cannot be parsed to form a valid model.

embed_documents(texts: List[str]) List[List[float]][source]¶

Embed a list of documents using GPT4All.

Parameters

texts – The list of texts to embed.

Returns

List of embeddings, one for each text.

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

Embed a query using GPT4All.

Parameters

text – The text to embed.

Returns

Embeddings for the text.

validator validate_environment  »  all fields[source]¶

Validate that GPT4All library is installed.

Examples using GPT4AllEmbeddings¶