diff --git a/Sources/Services/SpeechToTextService.swift b/Sources/Services/SpeechToTextService.swift index 119bb8a..41a26f8 100644 --- a/Sources/Services/SpeechToTextService.swift +++ b/Sources/Services/SpeechToTextService.swift @@ -153,12 +153,16 @@ internal class SpeechToTextService { let transcriptionURL = openAITranscriptionEndpoint + // Get model name from UserDefaults, defaulting to "whisper-1" + let modelName = UserDefaults.standard.string(forKey: "openAIModel")?.trimmingCharacters(in: .whitespacesAndNewlines) + let model = (modelName?.isEmpty == false) ? modelName! : "whisper-1" + return try await withCheckedThrowingContinuation { continuation in AF.upload( multipartFormData: { multipartFormData in multipartFormData.append(audioURL, withName: "file") - // Azure deployments already specify the model, but it doesn't hurt to include - multipartFormData.append("whisper-1".data(using: .utf8)!, withName: "model") + // Use configured model or default to whisper-1 + multipartFormData.append(model.data(using: .utf8)!, withName: "model") }, to: transcriptionURL, headers: headers diff --git a/Sources/Views/Dashboard/DashboardProvidersView.swift b/Sources/Views/Dashboard/DashboardProvidersView.swift index c32b883..f2d8152 100644 --- a/Sources/Views/Dashboard/DashboardProvidersView.swift +++ b/Sources/Views/Dashboard/DashboardProvidersView.swift @@ -9,6 +9,7 @@ internal struct DashboardProvidersView: View { @AppStorage("hasSetupParakeet") var hasSetupParakeet = false @AppStorage("hasSetupLocalLLM") var hasSetupLocalLLM = false @AppStorage("openAIBaseURL") var openAIBaseURL = "" + @AppStorage("openAIModel") var openAIModel = "whisper-1" @AppStorage("geminiBaseURL") var geminiBaseURL = "" @AppStorage("maxModelStorageGB") var maxModelStorageGB = 5.0 @@ -784,7 +785,26 @@ internal struct DashboardProvidersView: View { .stroke(DashboardTheme.rule, lineWidth: 1) ) } - + + VStack(alignment: .leading, spacing: DashboardTheme.Spacing.xs) { + Text("OpenAI Model") + .font(DashboardTheme.Fonts.sans(11, weight: .medium)) + .foregroundStyle(DashboardTheme.inkMuted) + + TextField("whisper-1", text: $openAIModel) + .textFieldStyle(.plain) + .font(DashboardTheme.Fonts.mono(12, weight: .regular)) + .padding(DashboardTheme.Spacing.sm) + .background( + RoundedRectangle(cornerRadius: 4) + .fill(DashboardTheme.pageBg) + ) + .overlay( + RoundedRectangle(cornerRadius: 4) + .stroke(DashboardTheme.rule, lineWidth: 1) + ) + } + VStack(alignment: .leading, spacing: DashboardTheme.Spacing.xs) { Text("Gemini") .font(DashboardTheme.Fonts.sans(11, weight: .medium))