Repository navigation
feat(audio): dictate a document into an audio file - #7151
Conversation
Asking GAIA to "turn this PDF into audio" used to take two hand-written steps, gave only WAV, and showed no player once the file was saved to a folder of the user's own. One request now does it in the Agent UI and the TUI: the new dictate_document tool reads a PDF, Word, Excel, text or Markdown file, records it with the Kokoro voice and returns an MP3 or WAV. - Two forms. "As written" keeps the author's words; "listening" has the chat model rewrite, part by part, what does not work by ear (tables, charts, footnotes, web addresses, reference codes). auto picks, the result says which and why, and the listening script is saved beside the audio. - The recording always stays in GAIA's audio folder, the only place the Agent UI serves audio from, and a copy goes to the path the user named. text_to_speech does the same, so both get a player. The media boundary is unchanged apart from serving .mp3. - MP3 is Lemonade's own encoding, joined frame by frame: no new dependency, about 2.4x smaller than WAV. - Long documents record piece by piece to disk with progress on the live line in both apps, stop cleanly, and past about two hours of audio are refused with the page range that fits. - What the voice was heard to misread is respelled before recording: decimals, money, version numbers, footnote marks, abbreviations. A new bundled skill, dictation, tells the agent to call the tool without questions and how to report the result. The tool list grows from 105 to 106 and gains a speech bundle.
|
Verdict: Request changes This adds one-sentence document dictation to MP3 or WAV in the Agent UI and the TUI, keeps a playable copy for
Real-world evidenceN/A: no evidence bundle was produced for this run. The PR's own test plan describes manual runs in the Agent UI and the TUI on DeepSeek through Fireworks. It doesn't show their output or screenshots. The verdict rests on reading the code and on running the speech-text rules on their own; the pytest suites couldn't run here, and CI was still pending when this was written. 🔍 Technical details🟡 The footnote-strip rule deletes real numbers after Move the four abbreviation rules ( 🟡 No screenshot of the changed Agent UI card 🟢 Stop waits for a whole rewrite reply ( 🟢 Copy-then-script failure reports an error after the audio copy landed ( Docs drift: I grepped Eval: this change affects the model (a new tool, skill and bundle, plus the Strengths
|
A listening rewrite could record a number the document never states. Gemma 4 E4B wrote "thirteen thousand one hundred ten" for 13,100 and "eighteen" for 180 on the test report, and nothing caught it. Each rewritten part's numbers, in digits or in words, are now compared with the page before anything is recorded. A part that states a figure the document does not is asked for once more; if it is still wrong the dictation is refused and as-written is offered. Figures the script leaves out are returned for the user to check. The prompt also tells the model to copy numbers digit for digit.
|
Verdict: Request changes Neither fix from the last review has landed. The new commit adds a useful figure check to listening scripts, but these two are still open:
🔍 Technical details
|
"See p.14 The table" was spoken as "See p. The table": the rule that drops footnote marks ran before "p.", "pp.", "No." and "Fig." were expanded, so the number after them was taken for a footnote. This hit the as-written form too, which promises the author's words. - Abbreviations are expanded first, and a number after one is never read as a footnote, in speech or when choosing the form. - Stop during a listening rewrite ends the reply in progress instead of waiting for the part to finish. - When the audio reaches the user's folder but the script copy fails, the result says so instead of reporting the whole dictation failed. - A model that cannot answer returns an error instead of escaping the tool. - The audio card's second line reads "Script saved to", matching "Saved to", and a visual test covers the card in English and Arabic.
|
Verdict: Request changes The numbers-after-"p.", "No." and "Fig." fix has landed and is tested. One finding from the last review is still open:
🔍 Technical details
|
Main added named-picture and named-recording requests beside the speech
signal; both are kept. A dictation that names its output file
("save it as report.mp3") no longer also asks for transcribe_media, since
that .mp3 is the result, not a recording to transcribe. The audio card's
visual scene sits beside main's new scenes, and the capability matrix is
regenerated for the new speech bundle.
|
Not merging yet, for two reasons:
The bot's request for English and Arabic screenshots of the audio card is also still open. 🔍 Technical details
|
"Read notes.pdf aloud and save it as report.mp3" offered text-to-speech and the transcription tool, because naming an output audio file never counted as a dictation request and the .mp3 name looked like a recording to transcribe. A message whose only audio file names are save targets (save/write/export/ narrate ... as/to <name>.mp3|.wav|.m4a|.ogg|.flac) now offers dictation first. A message that names an audio file to read from still routes to transcription, so "Transcribe meeting.mp3", "what does interview.mp3 say?" and "Convert interview.mp3 to interview.wav" are unchanged. Also gives dictate_document its activity-list label in English and Arabic and a live-progress phrase, which the flagship tool-label test requires.
|
Both blockers are fixed in 861231c, and the screenshots were already in the description.
🔍 Technical details
|
|
Not merging yet: Unit Tests (Linux) fails on this PR's new Fix: add about three made-up requests that should suggest The routing re-test passes. All 8 dictation phrasings, including "Read notes.pdf aloud and save it as report.mp3" and "Narrate chapter1.txt and save as chapter1.wav", offer 🔍 Technical details
|
# Conflicts: # hub/agents/gaia/python/gaia_agent/chat_agent.py # hub/agents/gaia/python/gaia_agent/tool_requests.py # hub/agents/gaia/python/tests/fixtures/non_claude_system_prompt.txt # hub/skills/README.md # src/gaia/apps/webui/visual/rtl.visual.ts # tests/unit/test_chat_tool_requests.py # tests/unit/test_tool_loader_token_budget.py
The speech tool now snapshots through copy_for_user, so the agent module's before_change import from main went unused after the merge.
|
The
🔍 Technical details
|
|
Verdict: Approve with suggestions You can now ask GAIA to turn a PDF, Word, Excel, text or Markdown file into an MP3 or WAV in one sentence, in both the Agent UI and the TUI. GAIA either reads the file as written or rewrites it so it is easy to follow by ear, and it checks every number in a rewrite against the document before recording. I found nothing that blocks the merge. File paths go through the same read and write permission checks as Worth fixing before or soon after merge:
Real-world evidenceN/A: this job produced no evidence bundle. My verdict rests on reading the code only; I couldn't run the PR's unit tests here because pytest isn't installed on this runner. The PR description reports real runs against the Agent UI and TUI, a listen-back check with Whisper, and English and Arabic screenshots of the audio card, but this job didn't reproduce any of them. Real inference on the Strix Halo pool is left to the next RC's eval, and the description names the categories to watch: 🔍 Technical details🟡 Follow-up: Audio cache keeps a duplicate of every saved recording, with no cleanup ( 🟢 🟢 🟢 Orphaned audio when the script write fails ( 🟢 Doc drift: Checked and fine
Strengths
|
text_to_speech now reports saved_to when the user named a folder, so its card shows the same "Saved to" line a dictation does.
|
Fixed the second suggestion: speaking text into a folder now shows the "Saved to" line on its audio card, like a dictation. The first one, keeping GAIA's own copy alongside the user's, is deliberate: the player only serves files from GAIA's audio folder, so dropping that copy would drop the player. Clearing old audio from that folder is a separate cleanup question for the maintainer. |
|
Verdict: Approve with suggestions This adds a
Real-world evidenceN/A here: no evidence bundle was produced for this run. The PR body carries its own proof: English and Arabic screenshots of the audio card, Agent UI and TUI runs (a 36-page PDF recorded in parts, Stop leaving no partial file), and a Whisper listen-back of 90–96% word match. Nothing was re-run by this review, so the verdict rests on static review plus that author-supplied evidence. Untested by the author: the listening rewrite on Qwen3.6, Linux and macOS, and the packaged desktop app. 🔍 Technical detailsIssues 🟡 Joined MP3 may carry a stale Xing/Info header ( 🟢 🟢 A folder name with a dot is treated as a file ( Strengths
|
…h file cannot be made A long MP3 is joined from many short recordings; a leading Xing/Info or VBRI frame from each one would make a player read the whole file as the first piece's length, so the joiner drops it. A listening script that cannot be written now says where the finished audio is instead of orphaning it, an audio folder that cannot be created is a structured error from text_to_speech, and a folder path ending in a separator is a folder even when its name has a dot. Also adapts the unsupported-format tests to .epub now that main reads .pptx, and lists the dictation mixin in CLAUDE.md's KNOWN_TOOLS table.
…der on Linux On Linux and macOS a dictation saved to "Reports v1.2\" landed in a folder literally named with the trailing backslash; the separator is now stripped before the path is resolved. The dictation skill also gets search queries and held-out suggester examples, which main now requires of every hub skill, and its CHANGELOG entry moves from the released 0.3.6 section to Unreleased.
…to it Saving a dictation to "D:\" went to D:'s current folder, and "C:\" or "C:/" to the chat workspace, because every trailing separator was stripped and left a bare drive letter. Trailing separators are now stripped only when what is left is not a drive, a UNC share root or "/", so roots resolve to themselves while "folder\" and "a/b/" still lose theirs.
# Conflicts: # docs/guides/tui.mdx
Getting a document as audio used to take two hand-described steps, produced only WAV (3 minutes is 9 MB), and showed no player once the file was saved to a folder of your own. Now one sentence does it in the Agent UI and the TUI: attach or name a PDF, Word, Excel, text or Markdown file, say "turn this into audio", and GAIA records it, plays it in the chat, and saves the audio where you asked. It reads the document as written, or rewrites tables, charts, footnotes and web addresses into spoken sentences when it has them, says which it chose, and saves that listening script beside the audio.
What a reviewer should weigh:
dictate_documentreads the file itself, so a long document is never shortened by passing through the model, and a newdictationskill tells the agent to call it without questions.text_to_speechnow does the same. The only change to what the Agent UI serves is.mp3.Limits, stated in the guide: English Kokoro voices only (other Lemonade speech models are not offered, as GAIA has not proven them); charts are described from the document's text, not the picture; one dictation covers about two hours of audio, and a longer document is recorded in page ranges.
Two notes for the reviewer:
tool_selection,gaia_tool_selection,web_system(it holds thetext_to_speechscenario) andrag_quality(the document tools next to it). Thedictationskill is listed as deferred in the skill-scenario coverage test, because the text lanes cannot judge audio.Screenshots
The audio card after a dictation saved to a folder of the user's, from the
rtl.visual.tsscene (English, then Arabic). The path stays left to right inside the Arabic line.Test plan
Run against the real apps from an isolated GAIA home, chat model DeepSeek through Fireworks, voice
kokoro-v1on Lemonade..script.mdsaved in the folder; the reply named the form and whypython -m pytest tests/unit/test_dictation.py tests/unit/test_lemonade_speech.py tests/unit/chat/ui/test_generated_media.py tests/unit/test_chat_tool_requests.pydictate_documentfirst; "Transcribe meeting.mp3", "what does interview.mp3 say?" and six more that read an existing audio file still offertranscribe_media(tests/unit/test_chat_tool_requests.py)python -m pytest tests/unit/test_flagship_tool_labels.py(activity label in English and Arabic, live-progress phrase)python -m pytest hub/agents/gaia/python/tests/test_chat_dictation_tool.py hub/agents/gaia/python/tests/test_chat_tts_tool.pycd src/gaia/apps/webui && npm test && npm run test:rtl(3,449 unit and 456 visual tests pass; a new visual test renders the audio card with its "Saved to" and "Script saved to" lines in English and Arabic, and both were read on screen)cd tui && go test ./internal/ui/...python util/lint.py --tool-descriptions, black, isort, andpython util/check_doc_links.py --internal-only