class LlamaCppEmbeddingsThe async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.
Generates embeddings for an array of texts.
Generates an embedding for a single text.
Initializes the llama_cpp model for usage in the embeddings wrapper.
// Initialize LlamaCppEmbeddings with the path to the model file
const embeddings = await LlamaCppEmbeddings.initialize({
modelPath: llamaPath,
});
// Embed a query string using the Llama embeddings
const res = embeddings.embedQuery("Hello Llama!");
// Output the resulting embeddings
console.log(res);