langchain_voyageai.embeddings
.VoyageAIEmbeddings¶
- class langchain_voyageai.embeddings.VoyageAIEmbeddings[source]¶
Bases:
BaseModel
,Embeddings
VoyageAIEmbeddings embedding model.
Example
from langchain_voyageai import VoyageAIEmbeddings model = VoyageAIEmbeddings()
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 batch_size: int [Required]¶
- param model: str [Required]¶
- param show_progress_bar: bool = False¶
- param truncation: Optional[bool] = None¶
- param voyage_api_key: SecretStr [Optional] (alias 'api_key')¶
- Constraints
type = string
writeOnly = True
format = password
- async aembed_documents(texts: List[str]) List[List[float]] [source]¶
Asynchronous Embed search docs.
- Parameters
texts (List[str]) – List of text to embed.
- Returns
List of embeddings.
- Return type
List[List[float]]
- async aembed_query(text: str) List[float] [source]¶
Asynchronous Embed query text.
- Parameters
text (str) – Text to embed.
- Returns
Embedding.
- Return type
List[float]