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.
- Pi
>=0.80.9 - Active model
google/gemini-3.5-flash - Google provider authenticated through Pi (
/login google,auth.json, CLI key, orGEMINI_API_KEY) - Pi setting
blockImagesdisabled, because Pi's current generic media filter also removes the extension's temporary audio carrier
pi install git:git@github.com:toolittlecakes/pi-gemini-audio-readConfigure the Google provider through Pi once if needed:
piRun /login google, then select Gemini 3.5 Flash or launch it directly:
pi --provider google --model gemini-3.5-flashUpdate the extension with pi update --extensions, then restart Pi or run /reload.
The agent can call the normal tool:
{"path":"recording.mp3"}- 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.
bun install
bun run check
bun test