From f63547c67a84a811da7d4b00d9fc5f9d98f3c8ad Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Sat, 18 Mar 2023 03:43:07 +0100 Subject: [PATCH] Implement transcription --- sample_audio.mp3 | Bin 0 -> 37407 bytes src/lib.rs | 22 +++++++++ src/transcription.rs | 110 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+) create mode 100644 sample_audio.mp3 create mode 100644 src/transcription.rs diff --git a/sample_audio.mp3 b/sample_audio.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..b405f8d0c871e9cc781419d60f17f72b3ce1e591 GIT binary patch literal 37407 zcmXWiWmMG9*8uP@-QC^YDJ`*dr*wBWNXXLN-QC?K64KoQiU`srjpRP^d;a@!&%W5t zxpVH^xpN2dq&5ry@UBRTWm%L|QP_-LY0)A80h`l$`|1w{N<{H(K6qMW99=_-K$1(r zI!siUUk{M4kiEzEzd~b#f*9S^cDo;>3SXO+bIzPL#y7%Qgq5wL1{xG&oi*9v2V2d| z)CPRD@FXP_@$}ST{S2zLwKS(=`L&E<7@=m!r+epO%jprX(5f?=%Mbqjg($7bY1Xz} z;tvuwDoBq%KQGpJo)fl69Oz&kKTfdP;mf2~VDnPY{Z$}=-EqzM1cWfAsD48b zE4gxzAmWESX$)h7QGR7=S2m5frJ`Hyjb(8uKmPGMBHFG>GI?@d7rsj_-EPJY_ZiCg z=qi?q)@x9aF(ml$(l##YfQ{A?yZ0_=7{o@rPv>amk^hC@Yb*0{J`2cx!_Bu_tP zx#aqpakL@j4TKIx`D?<4)-*ifAIB(i6R*YHwl>x2`{`+V*w;zC>XUG5YY+F{%O61> z$YJ|HhRVuAC3P8zyyA%BIV9*lpIZ9w7nN({C!FLVhg6qW!25FP0FG;p-$!mk{S%fcYBCvrPkiX*!su zlS!lyjoDfFF@twE)cAG6uTN|{n-H#KuM7@!1l6XFp%05gV=98+&CKh9p5c^Wn?nW< zB1QlWTnr+hQHjBR`n%nUfi&C4(U>uBP3nyq4T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"))?.trim().to_string())) @@ -194,4 +196,24 @@ mod tests { assert!(embeddings.as_ref().unwrap().data[0].embedding.len() > 0, "No embeddings found"); println!("Embeddings: {:?}", embeddings.unwrap().data[0].embedding); } + + #[tokio::test] + async fn test_transcription() { + let ctx = get_api(); + assert!(ctx.is_ok(), "Could not load context"); + let ctx = ctx.unwrap(); + + // Original script: "Hello. This is a sample piece of audio for which the whisper AI will generate a transcript" + // Expected result: "Hello, this is a sample piece of audio for which the Whisper AI will generate a transcript." + let transcription = ctx.create_transcription( + TranscriptionRequestBuilder::default() + .model("whisper-1") + .file(AudioFile::MP3(File::open("sample_audio.mp3").await.unwrap())) + .build() + .unwrap() + ).await; + + assert!(transcription.is_ok(), "Could not get transcription: {}", transcription.unwrap_err()); + println!("Transcription: {:?}", transcription.unwrap().text); + } } \ No newline at end of file diff --git a/src/transcription.rs b/src/transcription.rs new file mode 100644 index 0000000..2383dc6 --- /dev/null +++ b/src/transcription.rs @@ -0,0 +1,110 @@ +use derive_builder::Builder; +use reqwest::{multipart::{Form, Part}, Body, Client}; +use serde::Deserialize; +use tokio::fs::File; +use tokio_util::codec::{FramedRead, BytesCodec}; + +use crate::context::{API_URL, Context}; + +#[derive(Debug, Clone)] +pub enum AudioResponseFormat { + Text, + Json, + Srt, + Vtt, + VerboseJson, +} + +#[derive(Debug)] +pub enum AudioFile { + MP3(File), + MP4(File), + MPEG(File), + MPGA(File), + WAV(File), + WEBM(File), +} + +impl AudioFile { + fn file_name(&self) -> &'static str { + match self { + AudioFile::MP3(_) => "file.mp3", + AudioFile::MP4(_) => "file.mp4", + AudioFile::MPEG(_) => "file.mpeg", + AudioFile::MPGA(_) => "file.mpga", + AudioFile::WAV(_) => "file.wav", + AudioFile::WEBM(_) => "file.webm", + } + } + + fn file(self) -> File { + match self { + AudioFile::MP3(file) => file, + AudioFile::MP4(file) => file, + AudioFile::MPEG(file) => file, + AudioFile::MPGA(file) => file, + AudioFile::WAV(file) => file, + AudioFile::WEBM(file) => file, + } + } +} + +impl ToString for AudioResponseFormat { + fn to_string(&self) -> String { + match self { + AudioResponseFormat::Text => "text", + AudioResponseFormat::Json => "json", + AudioResponseFormat::Srt => "srt", + AudioResponseFormat::Vtt => "vtt", + AudioResponseFormat::VerboseJson => "verbose_json", + }.to_string() + } +} + +#[derive(Debug, Builder)] +#[builder(pattern = "owned")] +pub struct TranscriptionRequest { + #[builder(setter(into))] + pub file: AudioFile, + #[builder(setter(into))] + pub model: String, + #[builder(setter(into, strip_option), default)] + pub prompt: Option, + #[builder(setter(into, strip_option), default)] + pub response_format: Option, + #[builder(setter(into, strip_option), default)] + pub temperature: Option, + #[builder(setter(into, strip_option), default)] + pub language: Option, +} + +#[derive(Debug, Deserialize)] +pub struct TranscriptionResponse { + pub text: String, +} + +impl Context { + pub async fn create_transcription(&self, req: TranscriptionRequest) -> anyhow::Result { + let mut form = Form::new(); + let file_name = req.file.file_name(); + form = form.part("file", Part::stream(Body::wrap_stream(FramedRead::new(req.file.file(), BytesCodec::new()))).file_name(file_name)); + form = form.text("model", req.model); + + if let Some(response_format) = req.response_format { + form = form.text("response_format", response_format.to_string()); + } + if let Some(prompt) = req.prompt { + form = form.text("prompt", prompt); + } + + if let Some(temperature) = req.temperature { + form = form.text("temperature", temperature.to_string()); + } + + if let Some(language) = req.language { + form = form.text("language", language.to_string()); + } + + Ok(self.with_auth(Client::builder().build()?.post(&format!("{API_URL}/v1/audio/transcriptions")).multipart(form)).send().await?.json::().await?) + } +} \ No newline at end of file