Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@ragpipe/plugin-gemini

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ragpipe/plugin-gemini

Gemini embedding and generation plugin for ragpipe

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

@ragpipe/plugin-gemini

Google Gemini embedding and generation plugin for ragpipe.

Install

pnpm add ragpipe @ragpipe/plugin-gemini

Usage

import { defineConfig } from "ragpipe";
import { geminiEmbedding, geminiGeneration } from "@ragpipe/plugin-gemini";

export default defineConfig({
  embedding: geminiEmbedding({
    apiKey: process.env.GEMINI_API_KEY ?? "",
    model: "gemini-embedding-001",
  }),
  generation: geminiGeneration({
    apiKey: process.env.GEMINI_API_KEY ?? "",
    model: "gemini-3.1-flash-lite-preview",
    systemPrompt: "Answer based on the provided context.",
  }),
  // ... vectorStore
});

API

geminiEmbedding(options)

Returns an EmbeddingPlugin that calls the Gemini Embedding API.

OptionTypeDefaultDescription
apiKeystringGoogle AI API key (required)
modelstring-Embedding model name (required)
  • Dimensions: 3072
  • Rate limit: 800ms between calls (built-in)
  • Batch support: embedMany() uses batchEmbedContents for efficient bulk embedding

geminiGeneration(options)

Returns a GenerationPlugin that calls the Gemini Content Generation API.

OptionTypeDefaultDescription
apiKeystringGoogle AI API key (required)
modelstring-Generation model name (required)
systemPromptstring"Answer based on the provided context."Default system instruction
  • Streaming: generateStream() returns an AsyncIterable<string> via SSE
  • History: Pass { history } to include conversation context
  • Per-call override: Pass { systemPrompt } at call time to override the default

Get an API Key

  • Go to Google AI Studio
  • Create an API key
  • Set it as GEMINI_API_KEY in your environment

License

MIT

Keywords

ragpipe

FAQs

Package last updated on 10 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts