@llumiverse/drivers
Version:
LLM driver implementations. Currently supported are: openai, huggingface, bedrock, replicate.
20 lines • 675 B
JavaScript
export async function getEmbeddingsForText(driver, options) {
const prompt = {
instances: [{
task_type: options.task_type,
title: options.title,
content: options.content
}]
};
const model = options.model || "gemini-embedding-001";
const client = driver.getFetchClient();
const result = await client.post(`/publishers/google/models/${model}:predict`, {
payload: prompt
});
return {
...result.predictions[0].embeddings,
model,
token_count: result.predictions[0].embeddings.statistics?.token_count
};
}
//# sourceMappingURL=embeddings-text.js.map