VoyageEmbeddings class uses the Voyage AI REST API to generate embeddings for a given text.
The inputType parameter allows you to specify the type of input text for better embedding results. You can set it to query, document, or leave it undefined (which is equivalent to None).
query: Use this for search or retrieval queries. Voyage AI will prepend a prompt to optimize the embeddings for query use cases.document: Use this for documents or content that you want to be retrievable. Voyage AI will prepend a prompt to optimize the embeddings for document use cases.None(default): The input text will be directly encoded without any additional prompt.
- truncation: Whether to truncate the input texts to the maximum length allowed by the model.
- outputDimension: The desired dimension of the output embeddings.
- outputDtype: The data type of the output embeddings. Can be
"float"or"int8". - encodingFormat: The format of the output embeddings. Can be
"float","base64", or"ubinary".
Related
- Embedding model conceptual guide
- Embedding model how-to guides
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.