UNPKG

@llumiverse/drivers

Version:

LLM driver implementations. Currently supported are: openai, huggingface, bedrock, replicate.

20 lines 673 B
export async function getEmbeddingsForText(driver, options) { const prompt = { instances: [{ task_type: options.task_type, title: options.title, content: options.content }] }; const model = options.model || "text-embedding-004"; 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