Open
Conversation
|
Wow, great work @graniet 🚀 |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Consider replacing eprintln with a proper logging framework to ensure consistent error handling across production code.
Comment on lines
+273
to
+275
| writer.write_sample(s).unwrap(); | ||
| } | ||
| writer.finalize().unwrap(); |
There was a problem hiding this comment.
Consider handling errors explicitly when writing WAV samples instead of using unwrap to prevent potential panics during audio processing.
Suggested change
| 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 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds first-class audio handling to the LLM stack and a runnable voice-assistant example: