Package dev.langchain4j.model.voyageai
Class VoyageAiEmbeddingModel.Builder
java.lang.Object
dev.langchain4j.model.voyageai.VoyageAiEmbeddingModel.Builder
- Enclosing class:
VoyageAiEmbeddingModel
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
encodingFormat
(String encodingFormat) Format in which the embeddings are encoded.Type of the input text.logRequests
(Boolean logRequests) logResponses
(Boolean logResponses) maxRetries
(Integer maxRetries) maxSegmentsPerBatch
(Integer maxSegmentsPerBatch) modelName
(VoyageAiEmbeddingModelName modelName) Name of the model.Name of the model.truncation
(Boolean truncation) Whether to truncate the input texts to fit within the context length.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
baseUrl
-
timeout
-
maxRetries
-
apiKey
-
modelName
Name of the model.- Parameters:
modelName
- Name of the model.- See Also:
-
modelName
Name of the model.- Parameters:
modelName
- Name of the model.- See Also:
-
inputType
Type of the input text. Defaults to null. Other options: query, document.- 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.
- null (default): The input text will be directly encoded without any additional prompt.
- Parameters:
inputType
- Type of input text
-
truncation
Whether to truncate the input texts to fit within the context length. Defaults to true.- If true, over-length input texts will be truncated to fit within the context length, before vectorized by the embedding model.
- If false, an error will be raised if any given text exceeds the context length.
- Parameters:
truncation
- Whether to truncate the input texts.
-
encodingFormat
Format in which the embeddings are encoded. We support two options:- If not specified (defaults to null): the embeddings are represented as lists of floating-point numbers;
- base64: the embeddings are compressed to base64 encodings.
- Parameters:
encodingFormat
- Format in which the embeddings are encoded. Support format is "null" and "base64".
-
logRequests
-
logResponses
-
maxSegmentsPerBatch
-
build
-