generated from nhcarrigan/template
feat: template
This commit is contained in:
+27
-2
@@ -316,15 +316,40 @@ fn start_recording(
|
||||
Ok("Recording started".to_string())
|
||||
}
|
||||
|
||||
/// Stop recording and return the transcript.
|
||||
/// Stop recording (for real-time mode, transcription already happened during recording).
|
||||
#[tauri::command]
|
||||
async fn stop_recording(
|
||||
state: State<'_, AppState>,
|
||||
app_handle: tauri::AppHandle,
|
||||
) -> Result<String, String> {
|
||||
let logs = Arc::clone(&state.logs);
|
||||
|
||||
emit_log(&app_handle, &logs, "[Audio] Stopping recording...");
|
||||
|
||||
// Stop the recording and get the duration
|
||||
let duration = {
|
||||
let mut audio_guard = state.audio_capture.lock();
|
||||
if let Some(ref mut capture) = *audio_guard {
|
||||
let samples = capture.stop_recording();
|
||||
samples.len() as f32 / 16000.0
|
||||
} else {
|
||||
return Err("No active recording".to_string());
|
||||
}
|
||||
};
|
||||
|
||||
emit_log(&app_handle, &logs, &format!("[Audio] Recording stopped. Total duration: {:.1}s", duration));
|
||||
Ok("Recording stopped".to_string())
|
||||
}
|
||||
|
||||
/// Stop recording and transcribe all at once (batch mode).
|
||||
#[tauri::command]
|
||||
async fn stop_recording_batch(
|
||||
state: State<'_, AppState>,
|
||||
app_handle: tauri::AppHandle,
|
||||
) -> Result<Vec<TranscriptSegment>, String> {
|
||||
let logs = Arc::clone(&state.logs);
|
||||
|
||||
emit_log(&app_handle, &logs, "[Audio] Stopping recording...");
|
||||
emit_log(&app_handle, &logs, "[Audio] Stopping recording (batch mode)...");
|
||||
|
||||
// Get the audio samples
|
||||
let audio_samples = {
|
||||
|
||||
@@ -78,15 +78,17 @@ impl LlamaSummarizer {
|
||||
|
||||
let prompt = format!(
|
||||
"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n\
|
||||
You are a helpful assistant that creates concise meeting summaries. Focus on:\n\
|
||||
- Key decisions made\n\
|
||||
- Action items and who owns them\n\
|
||||
- Important discussions and their outcomes\n\
|
||||
- Next steps\n\n\
|
||||
Keep the summary structured and easy to scan.<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n\
|
||||
You are a helpful assistant that creates structured meeting summaries. \
|
||||
Format your response using the following template:\n\n\
|
||||
**Summary:** A high level overview of the meeting.\n\n\
|
||||
**Key decisions:** Any important resolutions that the meeting reached.\n\n\
|
||||
**Action Items:**\n\
|
||||
- list of things that must be addressed\n\n\
|
||||
**Discussion points:**\n\
|
||||
- a list of each topic/argument/counterpoint brought up in the meeting.\n\n\
|
||||
Be concise but comprehensive. Focus on capturing all important information.<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n\
|
||||
Please summarize this meeting transcript:\n\n\
|
||||
{}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n\
|
||||
Meeting Summary:\n",
|
||||
{}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n",
|
||||
transcript
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user