set file correctly in request
This commit is contained in:
parent
3889c80509
commit
86fba439ef
1 changed files with 1 additions and 6 deletions
|
|
@ -120,17 +120,12 @@ async fn transcribe_call(file_path: &Path) -> Result<CreateTranscriptionResponse
|
|||
|
||||
let client = async_openai::Client::new();
|
||||
|
||||
let audio_input = AudioInput {
|
||||
source: InputSource::Path {
|
||||
path: file_path.to_path_buf(),
|
||||
}
|
||||
};
|
||||
let request = CreateTranscriptionRequestArgs::default()
|
||||
.prompt("This is a public safety radio transmission. The speakers could be any of the following communicating between each other: dispatcher, law enforcement officer, fire fighter, or emergency medical services")
|
||||
.language("en")
|
||||
.response_format(AudioResponseFormat::Text)
|
||||
.model("whisper-1")
|
||||
.file(audio_input)
|
||||
.file(file_path)
|
||||
.build()?;
|
||||
|
||||
client.audio().transcribe(request).await
|
||||
|
|
|
|||
Loading…
Reference in a new issue