Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

fix: retry dictation without streaming

altic-dev0cd1ad137c69
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index 2653add5..ba15c5b6 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -2061,7 +2061,30 @@ struct ContentView: View {
DebugLogger.shared.info("Using LLMClient for transcription (streaming=\(enableStreaming))", source: "ContentView")
- let response = try await LLMClient.shared.call(config)
+ let response: LLMClient.Response
+ if enableStreaming {
+ do {
+ response = try await LLMClient.shared.call(config)
+ } catch {
+ DebugLogger.shared.warning(
+ "Streaming dictation post-processing failed; retrying without streaming: \(error.localizedDescription)",
+ source: "ContentView"
+ )
+ let fallbackConfig = LLMClient.Config(
+ messages: messages,
+ model: derivedSelectedModel,
+ baseURL: derivedBaseURL,
+ apiKey: apiKey,
+ streaming: false,
+ tools: [],
+ temperature: isTemperatureUnsupported ? nil : 0.2,
+ extraParameters: extraParams
+ )
+ response = try await LLMClient.shared.call(fallbackConfig)
+ }
+ } else {
+ response = try await LLMClient.shared.call(config)
+ }
// Log thinking if present (for debugging)
if let thinking = response.thinking {