npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@micdrop/gemini

v1.3.0

Published

Google Gemini implementation for @micdrop/server

Readme

@micdrop/gemini

Micdrop website | Documentation

Google Gemini implementation for @micdrop/server.

This package provides an agent (GeminiAgent), a speech-to-text (GeminiSTT) and a text-to-speech (GeminiTTS) running on the Gemini API. GeminiLive is a realtime model running on the Gemini Live API: it hears the user and answers with its own voice, in place of the three. GeminiClassifier answers typed questions about each turn of the user with the Decisions API.

Installation

npm install @micdrop/gemini

Gemini Agent, STT and TTS

import { GeminiAgent, GeminiSTT, GeminiTTS } from '@micdrop/gemini'
import { MicdropServer } from '@micdrop/server'

const apiKey = process.env.GEMINI_API_KEY || ''

new MicdropServer(socket, {
  agent: new GeminiAgent({
    apiKey,
    model: 'gemini-3.8-flash', // Default model
    thinkingLevel: 'low', // Optional, the lower the sooner the first word
    systemPrompt: 'You are a helpful assistant',
  }),
  stt: new GeminiSTT({
    apiKey,
    model: 'gemini-3.5-transcribe-live', // Default model
    language: 'en-US', // Optional, detected when left out
  }),
  tts: new GeminiTTS({
    apiKey,
    model: 'gemini-3.8-flash-tts', // Default model
    voice: 'Kore', // Default voice
  }),
})

Each one can be combined with the providers of other packages.

Gemini Live

Usage with MicdropServer

import { GeminiLive } from '@micdrop/gemini'
import { MicdropServer } from '@micdrop/server'

const realtime = new GeminiLive({
  apiKey: process.env.GEMINI_API_KEY || '',
  model: 'gemini-3.8-live', // Default model
  systemPrompt: 'You are a helpful assistant',
  voice: 'Kore', // Optional, a prebuilt voice

  // Advanced features (optional)
  autoEndCall: true, // Automatically end call when user requests
})

new MicdropServer(socket, {
  realtime,
  generateFirstMessage: true,
})

The Micdrop client detects when the user speaks, so the automatic activity detection of Gemini is turned off. Tools are added with addTool() right after creating the model, since Gemini reads them when the session opens. When the user interrupts the answer while a tool runs, its result goes in the conversation and reaches the model silently, so it keeps quiet about it.

Events

| Event | Payload | Description | | ----------------------- | ------------------------- | ---------------------------------------------------------------------- | | Audio | Buffer | A chunk of the voice of the model, PCM 16 bits, 24 kHz, mono. | | PartialMessage | string | The transcript of the answer so far. | | Message | MicdropConversationItem | A message, a tool call or a tool result was added to the conversation. | | ToolCall | MicdropToolCall | A tool declared with emitOutput ran, with its parameters and output. | | CancelLastUserMessage | none | The last user message was dropped because it carried no intent. | | SkipAnswer | none | The model gave no spoken answer. | | EndCall | none | The model decided that the call is over. | | Failed | none | The connection could not be restored after its retries. |

gemini-3.8-live-extended-thinking reasons before answering and needs a thinkingLevel, such as 'low'.

Gemini Classifier

Classifies each turn of the user with the Decisions API: yes or no questions, choices and scores answered with calibrated probabilities by gemini-decision-1, on text, images, audio, video or PDF.

import { choice, GeminiClassifier, noul } from '@micdrop/gemini'
import { MicdropServer } from '@micdrop/server'

const classifier = new GeminiClassifier({
  apiKey: process.env.GEMINI_API_KEY || '',
  questions: {
    intent: choice('What does the user in `turn` want?', {
      billing: 'A charge, an invoice, a refund',
      outage: 'The service is down or slow',
      other: 'Anything else',
    }),
    wantsHuman: noul('Does the user in `turn` ask for a human?'),
  },
})

new MicdropServer(socket, {
  stt,
  agent,
  tts,
  classifier,
  classifierOptions: { waitBeforeAnswer: true },
})

Documentation

Read full documentation of the Gemini integration for Micdrop on the website.

License

MIT

Author

Originally developed for Raconte.ai, created and open sourced by Godefroy de Compreignac