langchain.embeddings.fake.FakeEmbeddings¶

class langchain.embeddings.fake.FakeEmbeddings(*, size: int)[source]¶

Bases: Embeddings, BaseModel

Fake embedding model.

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.

param size: int [Required]¶

The size of the embedding vector.

async aembed_documents(texts: List[str]) List[List[float]]¶

Asynchronous Embed search docs.

async aembed_query(text: str) List[float]¶

Asynchronous Embed query text.

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

Embed search docs.

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

Embed query text.

Examples using FakeEmbeddings¶