8000 GitHub - toolittlecakes/pi-gemini-audio-read: Pi extension adding native audio reads for Gemini 3.5 Flash · GitHub
[go: up one dir, main page]

Skip to content

About

Pi extension adding native audio reads for Gemini 3.5 Flash

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-gemini-audio-read

Pi extension that replaces the built-in read tool with a compatible wrapper adding native audio input only for the active google/gemini-3.5-flash model. For every other provider and model, the wrapper exposes the original tool description and delegates all reads unchanged. The agent keeps calling read; there is no slash command, transcription service, proxy model, or local speech-to-text step.

Text files and images are delegated to Pi's original read implementation. Supported audio files keep their raw bytes in tool-result details while exposing only a short text result to Pi's UI. Immediately before provider serialization, the extension hydrates a temporary media carrier in Pi's cloned model context. Pi then serializes the audio directly into the preceding tool result as Gemini functionResponse.parts[].inlineData; no synthetic user message is added. The primary Gemini model receives the raw audio directly in the same tool loop.

Pi persists the raw audio in the tool-result details, so resumed and forked sessions do not depend on the original local file or the temporary Google Files API.

Requirements

  • Pi >=0.80.9
  • Active model google/gemini-3.5-flash
  • Google provider authenticated through Pi (/login google, auth.json, CLI key, or GEMINI_API_KEY)
  • Pi setting blockImages disabled, because Pi's current generic media filter also removes the extension's temporary audio carrier

Install

pi install git:git@github.com:toolittlecakes/pi-gemini-audio-read

Configure the Google provider through Pi once if needed:

pi

Run /login google, then select Gemini 3.5 Flash or launch it directly:

pi --provider google --model gemini-3.5-flash

Update the extension with pi update --extensions, then restart Pi or run /reload.

The agent can call the normal tool:

{"path":"recording.mp3"}

Supported formats

  • MP3 (audio/mp3)
  • WAV (audio/wav)
  • AIFF/AIF (audio/aiff)
  • AAC (audio/aac)
  • OGG Vorbis (audio/ogg)
  • FLAC (audio/flac)

Audio is embedded inline. Files larger than 14 MiB fail explicitly, leaving room under Gemini's 20 MB total request limit after Base64 encoding and prompt overhead. There is no Files API fallback.

Development

bun install
bun run check
bun test

About

Pi extension adding native audio reads for Gemini 3.5 Flash

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0