@mediapipe/tasks-genai-experimental
TypeScript icon, indicating that this package has built-in type declarations

0.10.14 • Public • Published

MediaPipe Tasks GenAI Package

This package contains experimental GenAI tasks for MediaPipe.

RAG Pipeline Inference

You can use the RAG Pipeline to augment an LLM Inference Task with existing knowledge.

const genaiFileset = await FilesetResolver.forGenAiTasks();
const genaiExperimentalFileset =
  await FilesetResolver.forGenAiExperimentalTasks();
const llmInference = await LlmInference.createFromModelPath(genaiFileset, ...);
const ragPipeline = await RagPipeline.createWithEmbeddingModel(
  genaiExperimentalFileset,
  llmInference,
  EMBEDDING_MODEL_URL,
);
await ragPipeline.recordBatchedMemory([
  'Paris is the capital of France.',
  'Berlin is the capital of Germany',
]);
const result = await ragPipeline.generateResponse(
  'What is the capital of France?',
);
console.log(result);

Package Sidebar

Install

npm i @mediapipe/tasks-genai-experimental

Weekly Downloads

361

Version

0.10.14

License

Apache-2.0

Unpacked Size

18.4 MB

Total Files

11

Last publish

Collaborators

  • linchan
  • mrschmidt
  • tmullen
  • dancingplatypus
  • google-wombot
  • chuoling