use rocket::form::FromForm;
use serde::Serialize;
#[derive(Debug, FromForm)]
pub(crate) struct TranscriptionRequest<'r> {
pub(crate) file: rocket::fs::TempFile<'r>,
pub(crate) model: Option<String>,
pub(crate) language: Option<String>,
#[allow(dead_code)]
pub(crate) prompt: Option<String>,
pub(crate) response_format: Option<String>,
pub(crate) temperature: Option<f32>,
}
#[derive(Debug, Serialize)]
pub(crate) struct TranscriptionResponse {
pub(crate) text: String,
}
#[derive(Debug, Serialize)]
pub(crate) struct ErrorResponse {
pub(crate) error: ErrorDetail,
}
#[derive(Debug, Serialize)]
pub(crate) struct ErrorDetail {
pub(crate) message: String,
#[serde(rename = "type")]
pub(crate) error_type: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) code: Option<String>,
}