langchain_community.embeddings.fastembed.FastEmbedEmbeddings¶
class langchain_community.embeddings.fastembed.FastEmbedEmbeddings[source]¶
Bases: BaseModel, Embeddings
Qdrant FastEmbedding models.
FastEmbed is a lightweight, fast, Python library built for embedding generation.
See more documentation at:
* https://github.com/qdrant/fastembed/
* https://qdrant.github.io/fastembed/
To use this class, you must install the fastembed Python package.
pip install fastembed
.. rubric:: Example
from langchain_community.embeddings import FastEmbedEmbeddings
fastembed = FastEmbedEmbeddings()
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 cache_dir: Optional[str] = None¶
The path to the cache directory.
Defaults to local_cache in the parent directory
param doc_embed_type: Literal['default', 'passage'] = 'default'¶
Type of embedding to use for documents
“default”: Uses FastEmbed’s default embedding method
“passage”: Prefixes the text with “passage” before embedding.
param max_length: int = 512¶
The maximum number of tokens. Defaults to 512.
Unknown behavior for values > 512.
param model_name: str = 'BAAI/bge-small-en-v1.5'¶
Name of the FastEmbedding model to use
Defaults to “BAAI/bge-small-en-v1.5”
Find the list of supported models at
https://qdrant.github.io/fastembed/examples/Supported_Models/
param threads: Optional[int] = None¶
The number of threads single onnxruntime session can use.
Defaults to None
async aembed_documents(texts: List[str]) → List[List[float]]¶