Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assistant_v2/FEATURE_PROGRESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ This document tracks which features from the original assistant have been implem
| Push-to-talk text-to-speech interface | Done |
| Interrupt AI speech with push-to-talk | Done |
| Log function invocation names | Done |
| Handle empty transcription results | Done |

Update this table as features are migrated and verified to work in `assistant_v2`.
6 changes: 6 additions & 0 deletions assistant_v2/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex};
use std::time::Instant;
use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};
use tracing::info;

mod record;
mod transcribe;
Expand Down Expand Up @@ -334,6 +335,11 @@ async fn main() -> Result<(), Box<dyn Error>> {
let audio_path = audio_rx.recv().unwrap();
interrupt_flag.store(false, Ordering::SeqCst);
let transcription = transcribe::transcribe(&client, &audio_path).await?;
if transcription.trim().is_empty() {
println!("No transcription");
info!("User transcription was empty. Aborting LLM response.");
continue;
}
println!("{}", "You: ".truecolor(0, 255, 0));
println!("{}", transcription);

Expand Down