-
Notifications
You must be signed in to change notification settings - Fork 65
Add voice-assistant support & TUI demo #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Wow, great work @graniet 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds voice-assistant support and a terminal UI demo to the LLM stack. Key changes include:
- Introducing a new audio message type with helper methods and a cond!(has_audio) macro.
- Enhancing memory and chat wrappers to filter out and transcribe audio messages by integrating an optional STT provider.
- Adding a runnable TUI-based voice-assistant example along with feature-gated audio dependencies.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/memory/sliding_window.rs | Filters out audio messages from the sliding window memory recall. |
| src/memory/mod.rs & cond_macros.rs | Adds the new HasAudio condition and helper documentation. |
| src/memory/chat_wrapper.rs | Integrates an STT provider to spawn a transcription pipeline for audio messages. |
| src/chat/mod.rs | Introduces new methods to work with the Audio messageType for audio processing. |
| src/builder.rs; src/agent/builder.rs | Updates agent and builder constructions to support optional STT providers. |
| src/backends/* | Updates backend implementations to gracefully ignore audio messages. |
| examples/agent_audio_example.rs | Provides a complete demo integrating recording, transcription, audio processing, and terminal UI. |
| Cargo.toml | Adds optional dependencies for audio processing and the TUI example. |
Comments suppressed due to low confidence (1)
src/memory/sliding_window.rs:182
- Consider adding a comment to explain why audio messages are filtered out in the sliding window recall, to clarify the intent for future maintainers.
messages.retain(|m| !m.has_audio());
|
|
||
| let mut guard = memory.write().await; | ||
| if let Err(e) = guard.remember_with_role(&transcribed_msg, event.role.clone()).await { | ||
| eprintln!("STT memory save error: {}", e); |
Copilot
AI
Jun 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider replacing eprintln with a proper logging framework to ensure consistent error handling across production code.
| writer.write_sample(s).unwrap(); | ||
| } | ||
| writer.finalize().unwrap(); |
Copilot
AI
Jun 21, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider handling errors explicitly when writing WAV samples instead of using unwrap to prevent potential panics during audio processing.
| writer.write_sample(s).unwrap(); | |
| } | |
| writer.finalize().unwrap(); | |
| if let Err(e) = writer.write_sample(s) { | |
| eprintln!("Error writing WAV sample: {e}"); | |
| return Vec::new(); // Return an empty buffer on error | |
| } | |
| } | |
| if let Err(e) = writer.finalize() { | |
| eprintln!("Error finalizing WAV file: {e}"); | |
| return Vec::new(); // Return an empty buffer on error | |
| } |
Adds first-class audio handling to the LLM stack and a runnable voice-assistant example: