diff --git a/openless-all/app/src-tauri/src/commands.rs b/openless-all/app/src-tauri/src/commands.rs index fd2ce834..57b19613 100644 --- a/openless-all/app/src-tauri/src/commands.rs +++ b/openless-all/app/src-tauri/src/commands.rs @@ -300,6 +300,9 @@ fn asr_transcriptions_url(base_url: &str) -> Result { if trimmed.ends_with("/audio/transcriptions") { return Ok(trimmed.to_string()); } + if trimmed.ends_with("/audio") { + return Ok(format!("{trimmed}/transcriptions")); + } Ok(format!("{trimmed}/audio/transcriptions")) } @@ -734,6 +737,10 @@ mod tests { asr_transcriptions_url("https://api.openai.com/v1").unwrap(), "https://api.openai.com/v1/audio/transcriptions" ); + assert_eq!( + asr_transcriptions_url("https://api.openai.com/v1/audio").unwrap(), + "https://api.openai.com/v1/audio/transcriptions" + ); assert_eq!( asr_transcriptions_url("https://api.openai.com/v1/audio/transcriptions").unwrap(), "https://api.openai.com/v1/audio/transcriptions"